Understanding the total harmonic distortion calculator — concept and principle
Total harmonic distortion (THD) measures how much a signal departs from a pure sine wave because of harmonics, the components at 2, 3, 4 … times the fundamental frequency. This calculator combines the levels of the fundamental and its harmonics into THD in percent and decibels. It is used for audio amplifiers, power supplies, inverters and power-quality checks.
How it is calculated
Amplitudes (RMS voltage or current): THD = √(V₂² + V₃² + V₄² + …) ÷ V₁
Powers: THD = √(ΣPn ÷ P₁)
THD (dB) = 20 × log₁₀(THD)
THD relative to total RMS: THDR = THD ÷ √(1 + THD²)
Total RMS ÷ fundamental = √(1 + THD²)
- Enter the fundamental and the harmonic levels in the same unit, as a list.
The principle
Any repeating waveform can be split into a sine wave at the fundamental frequency plus sine waves at whole-number multiples (Fourier analysis). A perfect sine has only the fundamental. Distortion in an amplifier or a non-linear load creates extra harmonics. Because harmonics at different frequencies are independent, their powers add, so the combined harmonic RMS is the square root of the sum of squares. Dividing by the fundamental gives a single ratio. Power levels are already squared amplitudes, so they are summed directly before taking the root.
Worked example
Default inputs: RMS amplitudes, fundamental 1, harmonics 0.02, 0.01, 0.005, 0.003.
- Squares: 0.0004 + 0.0001 + 0.000025 + 0.000009 = 0.000534.
- √0.000534 = 0.02311, so THD = 2.311 %.
- THD (dB) = 20 × log₁₀(0.02311) = −32.72 dB.
- THDR = 0.02311 ÷ √(1.000534) = 2.31 %; total RMS ÷ fundamental = 1.0003.
- The strongest harmonic is the 2nd, and 4 harmonics were entered.
| Fundamental level (1st harmonic) | THD (%) |
|---|---|
| 0.25 | 9.243 |
| 0.5 | 4.622 |
| 0.75 | 3.081 |
| 1 | 2.311 |
| 1.25 | 1.849 |
| 1.5 | 1.541 |
| 2 | 1.155 |
How to read the result
Lower is better. Good audio amplifiers often specify THD well below 0.1 % at rated power. In power systems, voltage and current THD are limited by standards such as IEEE 519 and IEC 61000 to protect equipment; the allowed values depend on the voltage level and the type of system. Even harmonics often indicate asymmetry, while odd harmonics come from symmetric clipping or non-linear loads like rectifiers.
Common mistakes
- Mixing amplitude and power levels in the same list.
- Using dB values directly; convert them to linear ratios first.
- Comparing THD with THD+N, which also includes noise.
- Measuring too few harmonics, which underestimates THD for heavily distorted waves.
Frequently asked questions
What is the difference between THD and THD+N?
THD+N also includes noise and other non-harmonic components, so it is always equal to or higher than THD.
How do I convert harmonic levels in dB to ratios?
For amplitudes, ratio = 10^(dB ÷ 20) relative to the fundamental.
Why does THDR differ from THD?
THDR divides by the total RMS instead of the fundamental; the two are nearly equal when distortion is small.
Sources: IEC 61000 series, Electromagnetic compatibility (harmonic distortion definitions) · Analog Devices EngineerZone, "What is THD (Total Harmonic Distortion)?"