Online Circuit Simulator
Square wave harmonics and THD example
We typically respond within one business day.
Harmonics of a square wave. The Harmonics section under the scope takes the wave apart.
Open this example in the simulator
What does this circuit show?
V1 is a 60 Hz square wave between -5 V and +5 V across R1. Open Harmonics under the scope to see its spectrum.
What should you notice?
Only odd harmonics appear: the 3rd is a third of the fundamental, the 5th a fifth, and the even ones are missing. THD reads about 48 %.
Why does it happen?
The Fourier series of a square wave of peak Vp is (4Vp/π)(sin ωt + sin 3ωt/3 + sin 5ωt/5 + ...). The fundamental is 4 × 5/π = 6.37 V, and THD = √(π²/8 - 1) = 48.3 % when every harmonic is counted.
What can you try?
Change V1 into a sine (an AC source of the same peak). THD drops to nearly 0 and only the fundamental is left.
What is a common mistake?
Expecting the 2nd harmonic to be the largest after the fundamental. A wave with half-wave symmetry, like this one, has no even harmonics at all.
Related examples
From our engineering work
Get your project started
We typically respond within one business day.