# Calculate Total Harmonic Distortion (THD)

Discussion in 'Power Electronics' started by Ala Eddine Bakkay, May 13, 2019.

1. ### Ala Eddine Bakkay

6
0
May 13, 2019
Good morning,
I have a distorted electical signal and i have it fundamental after filtering and i want to calculate the Total Harmonic Distortion (THD), so how can i do it ?

2. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,497
2,839
Jan 21, 2010
I would pull out my HP35665A DSA, and get it to compare the signals. Some digital oscilloscopes have FFT functionality and may be able to do this as well.

Ala Eddine Bakkay likes this.
3. ### Nanren888

494
146
Nov 8, 2015
In what form do you have these signals?
Transient electrical signals?
Sampled in a computer?
.
Is the distortion severe? or subtle as it might be in an audio circuit?

Ala Eddine Bakkay likes this.
4. ### Ala Eddine Bakkay

6
0
May 13, 2019
@Steve Thank you for your reply but i want a theoric algorithm

5. ### Ala Eddine Bakkay

6
0
May 13, 2019
I am using STPM34 module for measuring alternative current , the STPM34 calculates each few microseconds the instantaneous current which is distorted and calculate also the fundamental current by applying a filter, so i want to calculate THD with these two signals and find the existant harmonics and its values.

11,655
2,696
Nov 17, 2011

6
0
May 13, 2019
8. ### WHONOES

1,170
319
May 20, 2017
What sort of frequency are you dealing with?

9. ### Ala Eddine Bakkay

6
0
May 13, 2019
a 50-60 Hz signal

10. ### WHONOES

1,170
319
May 20, 2017
who It is generally done using a Fourier Transform (often quoted as a FFT which is a Fast Fourier Transform) so that is what you need to look up.
You will need to digitally sample the offending waveform and then apply the FFT to it which will then reveal all the harmonics associated with you waveform.
It sounds as though you are looking at mains voltage. If you are be very very careful. Industry best practice is to have another person, preferably competent in first aid, in the same room that you are conducting your investigation in who is aware of what you are doing and can come to your aid if you grab hold of something that you shouldn't.
There is of course the option of using the audio input of your computer and use an app that has been designed to recover the information you seek.
Another option is to use a twin T filter tuned to the voltage frequency on test. The idea is that the filter rejects the fundamental leaving just the harmonics form which you can calculate the overall distortion.

Ala Eddine Bakkay likes this.
11. ### Ala Eddine Bakkay

6
0
May 13, 2019
@WHONOES Thank you very much for your clarifications