Sound & Harmonics: Hearing Fourier Analysis

A mixture of pure tones: a base frequency f and harmonics at 2f, 3f, 4f, … . Fourier analysis says the recipe — how loud each harmonic is — determines the shape of the wave and the timbre (color) of the sound. Drag the bars below to change the recipe, and listen.

1. The recipe — harmonic amplitudes a1, …, a10

Drag a bar up or down, or use the sliders below, to set how loud each harmonic is. Set it to zero to remove it.

2. The resulting wave

Two periods of the summed wave. Hover a bar above to see that single harmonic drawn on top.

sum of harmonics
y(t)  =  a1 sin(2π·f t) + a2 sin(2π·2f t) + a3 sin(2π·3f t) + ⋯ + a10 sin(2π·10f t)

3. Listen

The sound updates live while you drag the bars. Same recipe + different f = same timbre, different pitch.

What to try / what to notice

Square-wave approximation uses only odd harmonics (1, 3, 5, …) with amplitudes 1, 1/3, 1/5, … and sounds hollow, like a clarinet. Notice the ripples near the jumps of the target square wave. As more harmonics are added, the overshoot becomes narrower but does not disappear: this is the Gibbs phenomenon. Sawtooth approximation uses every harmonic with amplitudes 1, 1/2, 1/3, … and sounds bright and brassy. Soft makes the amplitudes decrease rapidly (like 1/n²), reducing high-frequency content and making this finite sum look gentler. For infinite Fourier series, faster decay of the high-frequency coefficients is closely connected with greater smoothness of the waveform. That link between a wave and its harmonic recipe is exactly what Fourier analysis studies.

4. "Theremin" mode for the harmonic recipe

Press and glide on the pad: left–right changes the base frequency continuously, up–down changes the volume. Release to stop. The tone uses whatever harmonic recipe you set in section 1.

Now playing:

The pitch axis is logarithmic: each octave (a doubling of frequency) has the same width. Turn on White-noise beat to add a simple repeating pulse. The beat frequency is the number of pulses per second.

Audio uses the Web Audio API — works in any modern browser. No data leaves your device.

Back to Collection