Fourier Explorer
What does a periodic signal look like taken apart, one frequency at a time?
A finite sum of sine waves, built one harmonic at a time. Set how many harmonics are active, their common fundamental frequency, and each one's own amplitude and phase, then watch the sum in time and its discrete amplitude spectrum update together.
Time domain
- individual harmonics
- f(t), the sum
Frequency domain — discrete amplitude spectrum
Each line is one active harmonic, placed at its own frequency n·f₀ with height equal to its amplitude Aₙ. Phase is set per harmonic below, not shown on this axis — amplitude and phase are independent choices, and two spectra can look identical while their waveforms differ entirely in where their harmonics line up in time.
Per-harmonic amplitude and phase (3 active)
Harmonic 1 · 1.00 Hz
Harmonic 2 · 2.00 Hz
Harmonic 3 · 3.00 Hz
- Composition
- Custom
- Period 1/f₀
- 1.00 s
- Highest frequency
- 3.00 Hz
- f(t) at t
- 0.000
Adjust any amplitude or phase and the composition stops matching any preset exactly — which is expected, not an error.
The model
A finite Fourier series sums sine waves, each an integer multiple of one fundamental frequency :
The -th term — the -th harmonic — has its own frequency , amplitude and phase ; harmonic is the fundamental itself. Superposition is linear, so the sum at any instant is just the terms added together, exactly as in the Wave Superposition instrument — this one simply allows more than two.
This is a Fourier series, built for a signal that already repeats every seconds. It is not a Fourier transform: a transform takes a signal — periodic or not — and produces a function of continuous frequency, via an integral over all time, not a sum of finitely many terms. Nothing here computes one. What a Fourier transform of a genuinely periodic signal returns is, in fact, exactly this: a discrete set of spikes at — which is why the lower panel is drawn as discrete lines rather than a continuous curve. It is the spectrum of what this instrument builds, not an approximation of something else.
The presets, and why their coefficients are what they are
A true square wave’s Fourier series carries only the odd harmonics, with amplitude :
A true sawtooth’s series carries every harmonic, at , alternating in sign:
A negative coefficient is the same sine with its amplitude’s sign flipped — equivalently, the same amplitude with added to the phase, since . Every amplitude in this instrument is non-negative; the sawtooth preset’s alternating sign is carried entirely in , set to or .
Both series are infinite. The presets here use all 8 harmonics this instrument allows and are only that — an approximation, visibly short of the sharp corner or edge they are approaching. Lower the harmonic count on either preset and the approximation visibly coarsens; the ripple that remains near each discontinuity even at 8 harmonics, and which does not shrink away as more are added, has a name — the Gibbs phenomenon — and is a real feature of truncating this particular kind of series, not a flaw in the instrument.
What the two panels show
The upper panel is against time, over two fundamental periods; the individual harmonics may be shown alongside it, each too faint to read on its own but visibly entering the sum. The lower panel is the amplitude spectrum: one line per active harmonic, placed at its own frequency with height . Phase does not appear on that axis — it is set, per harmonic, in the controls below — which is itself worth noticing: two signals can share an amplitude spectrum and still look nothing alike in time, if their harmonics are shifted relative to one another.
Amplitude is in arbitrary units, as elsewhere in the Little Laboratory; frequency is in hertz and time in seconds.