Fourier Series — Square Wave

Rotating phasors (epicycles) summing to approximate a square wave

Fourier's theorem states any periodic function can be decomposed into a sum of sinusoids. A square wave uses only odd harmonics: f(t) = (4/π)·Σ sin((2k−1)ωt)/(2k−1). Each circle here is a rotating phasor at frequency (2k−1)ω. As N → ∞ the approximation converges everywhere except at discontinuities — the Gibbs phenomenon — where a ~9% overshoot persists regardless of how many terms are added.