2025-09-27 9:35 AM
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.
2025-09-27 2:10 PM
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.
2025-10-02 2:36 AM
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