Fourier series visualiser: build a square wave from sines
Add sine waves one at a time and watch them build a square, triangle or sawtooth wave.
How it works
- Any periodic signal is a sum of sines at whole multiples (harmonics) of its fundamental frequency.
- A square wave uses only odd harmonics, with amplitudes falling as 1/k.
- A triangle wave also uses odd harmonics, but they fall as 1/k², so it converges much faster.
- Near a sudden jump the sum always overshoots by about 9%: the Gibbs phenomenon.
Try this
- Choose Square and slide from 1 to 50 terms: the overshoot at each edge never goes away.
- Switch to Triangle: three terms already look close.
- Compare how much power the first term alone carries for each waveform.
Common questions
Why does a square wave only have odd harmonics?
It has half-wave symmetry: the second half of each period is the first half flipped. That cancels every even harmonic.
Where is this used?
Everywhere signals are analysed: audio, power electronics (harmonic distortion), communications and filter design.
More simulators
- Bode plot generatorDraw the magnitude and phase of a transfer function from its gain, poles and zeros, and read the phase margin.
- Sampling and aliasingMove the signal frequency and the sampling rate and see exactly when the samples start lying about the frequency.
- AM, FM and QPSKSee what AM, FM and QPSK signals look like in time and frequency, and how noise causes bit errors.
- Smith chartPlace a load on the Smith chart, read its reflection coefficient, VSWR and return loss, and see what a length of line does to it.
- All toolsCalculators and simulators.