Fourier Factory

Can you create a complex sound using simple waves?

Every repeating sound can be written as a sum of pure sine waves at whole-number multiples of one frequency. Choose a shape, then move the harmonics yourself.

How deep do you want to go?

Fourier Factory

Rotating phasors

Each circle spins at its harmonic’s speed with radius equal to its amplitude. The tip of the chain traces the sum.

Harmonics

Starting shape
9
220 Hz

Plays at a low level, band-limited below 20 kHz. The level is normalised so changing the mix does not make it louder.

Waveform (two periods)

Line spectrum

Exact amplitudes of the harmonics you chose (not an estimate). Computed from real data

Each slider is one pure tone. The first is the fundamental and sets the pitch. The others are harmonics at 2×, 3×, 4×… its frequency. Change their mix and the pitch stays put while the character of the sound, its timbre, changes.

Why do the corners ring?

Add more harmonics and the edges of the square wave get steeper, but the overshoot next to each jump never goes away. It settles at about 9% of the jump, and only its width shrinks. This is the Gibbs phenomenon, and it is why sharp edges in band-limited audio always ripple.

5

Measured overshoot with 5 harmonics: 9.12% of the jump
Limit as harmonics → ∞: 8.95% of the jump

How does a computer find the harmonics?

A Fast Fourier Transform (FFT) measures a block of N samples and reports energy in N/2 + 1 frequency bins spaced fs/N apart. A sine that falls exactly on a bin shows as one clean line. Move it between bins and the energy leaks into its neighbours. Windows trade a wider peak for much less leakage, and a longer block sharpens frequency while blurring time.

1,000.00 Hz
Computed with LabSound’s FFT on a 0 dBFS test sine at fs = 48 kHz. Amplitude-normalised so a sine centred on a bin reads 0 dBFS with any window. Computed from real data
Bin spacing Δf = fs/N
23.438 Hz
Block length N/fs
42.67 ms
Offset from nearest bin
−0.333 bin
Highest bin level
−0.63 dBFS

Try “Move half a bin”: the peak drops and spreads. That drop is called scalloping loss and it is the reason measurement tools choose their window carefully.

What this shows

Simple sine waves, added with the right amplitudes and phases, rebuild a complex periodic waveform, and an FFT can measure those amplitudes back with known errors.

What this does not show

Real instruments are not perfectly periodic: their harmonics drift, decay and include noise. A static Fourier series is a model of a steady tone, not of a whole performance.

Sources

  1. J. Fourier, Théorie analytique de la chaleur (1822).
  2. A. V. Oppenheim & R. W. Schafer, Discrete-Time Signal Processing, 3rd ed., Pearson, 2010.
  3. F. J. Harris, “On the use of windows for harmonic analysis with the discrete Fourier transform,” Proc. IEEE 66(1), 1978, pp. 51–83.
  4. E. Hewitt & R. E. Hewitt, “The Gibbs–Wilbraham phenomenon: an episode in Fourier analysis,” Arch. Hist. Exact Sci. 21, 1979.
  5. R. Plomp & H. J. M. Steeneken, “Effect of phase on the timbre of complex tones,” J. Acoust. Soc. Am. 46, 1969.
  6. Xiph.Org, “Digital Show & Tell” (video and notes).