Mathematics · Simulator 043
Add sine waves together, one harmonic at a time, and watch a square, sawtooth or triangle wave emerge. Set your own harmonic amplitudes, compare the waveform with its frequency spectrum, and find the stubborn overshoot at sharp jumps.
CollegeFourier series: college mathematics and engineering
Any reasonable periodic signal can be written as a sum of sines and cosines at whole-number multiples of its fundamental frequency (a Fourier series):
f(t) = Σₙ bₙ sin(2π n t / T)
The smoother the wave, the faster its harmonics shrink. At a jump, partial sums always overshoot by about 9% of the jump, however many terms you add. This is the Gibbs phenomenon: the overshoot gets narrower but not shorter.
The spectrum chart shows |bₙ| for each harmonic (a line spectrum). In audio, these harmonics are what make a note sound like a flute (few harmonics) or a buzzy synthesiser (many).
Sine-only (odd-symmetric) series; the custom mode lets you set the first eight amplitudes. No sound is played.
A square wave and a triangle wave both have the fundamental amplitude b₁ at n = 1. How much weaker is the 9th harmonic than the fundamental in each?
Square: bₙ ∝ 1/n, so the 9th is 1/9 ≈ 11% of the fundamental. Triangle: bₙ ∝ 1/n², so 1/81 ≈ 1.2%. That is why a triangle wave sounds much softer and purer than a square wave at the same pitch.
Square wave of height ±1: bn = 4/(nπ) for odd n, so b₁ ≈ 1.273, b₃ ≈ 0.424, b₅ ≈ 0.255.
At the middle of the top (t = T/4) the sines are +1, −1, +1, so three terms give 1.273 − 0.424 + 0.255 ≈ 1.10. More terms bring it closer to 1.
Energy: the fundamental alone carries b₁²/2 ≈ 0.81 of the square wave's power, 81%. The rest is spread over the higher harmonics.
Triangle wave: b₁ = 8/π² ≈ 0.811 but b₃ = −8/(9π²) ≈ −0.090, nine times smaller, because triangle harmonics fall as 1/n² instead of 1/n. That is why a triangle sounds much softer than a square wave.
Choose the square wave and set the highest harmonic to 5, then to 25.
A way of writing a repeating signal as a sum of sine waves at whole-number multiples of its basic frequency. Each sine's amplitude says how much of that harmonic the signal contains.
A square wave looks the same, flipped upside down, half a period later. Even harmonics do not have that symmetry, so their coefficients come out zero.
Near a sudden jump, a Fourier sum always overshoots by about 9% of the jump size. Adding more terms makes the overshoot narrower but never smaller.