cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring Total Harmonic Distortion (THD) in Voltage with STM32F4

Aurelio_B
Associate

Hello everione!

I’m working on a project where I need to measure the total harmonic distortion (THD) of voltage and visualize its harmonics. The fundamental frequency is 50Hz. I’m relatively new to STM32, and I’d appreciate any guidance on libraries or tools I could use for this task, or if there are any similar projects that could serve as a starting point. I appreciate any suggestions or resources you can share, thanks.

2 REPLIES 2
AScha.3
Super User

Hi,

Afaik DFT is used for something like this, or FFT and then adding the harmonics.

You can write it yourself, or search on GitHub for DFT or FFT, or use the cmsis math library.

If you feel a post has answered your question, please click "Accept as Solution".
Andrew Neil
Super User

Surely, the only thing that would be specific to STM32 would be the use of the ADC to collect the measurements?

Check out the Cube Firmware pack for examples - including ADC ...
https://www.st.com/en/embedded-software/stm32cubef4.html

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.