Fourier Series Builder

Add harmonics one by one — watch the Gibbs phenomenon emerge

The Fourier series approximates any periodic function as a sum of sines and cosines. For a square wave, only odd harmonics contribute: f(x) = (4/π)(sin x + sin 3x/3 + sin 5x/5 + ...). Near discontinuities, the approximation overshoots by ~9% regardless of N — this is the Gibbs phenomenon, a permanent feature of the Fourier partial sum.