What is THD and how it is calculated?
The total harmonic distortion (THD or THDi) is a measurement of the harmonic distortion present in a signal and is defined as the ratio of the sum of the powers of all harmonic components to the power of the fundamental frequency. Distortion factor, a closely related term, is sometimes used as a synonym.
Why do we calculate THD?
THD gives information about non‑linear behavior
As mentioned above, Total Harmonic Distortion is a useful technique to analyze any non‑linear behavior of a system. You can do this with a Fast Fourier Transform (FFT). The measured signal is transformed from the time domain (see Figure 1) into the frequency domain.