Visualise how any signal can be decomposed into a sum of simple sine waves. Draw a custom waveform and watch spinning circles (epicycles) reconstruct it — the core idea behind Fourier analysis.
Discrete Fourier Transform decomposes a signal into frequency components. Each spinning circle represents one frequency, amplitude and phase.
Draw a shape or select a preset. Watch epicycles trace the shape. Add or remove frequency terms to see how accuracy improves.
Fourier analysis is everywhere: JPEG compression, MP3 audio, MRI scanning, seismology, speech recognition — invented by Joseph Fourier in 1822 to study heat flow.
This demo builds periodic waveforms by adding together pure sine tones, illustrating the central result of the Fourier series: any repeating signal can be expressed as a sum of harmonically related sinusoids. Eight harmonics sit on a fundamental of 220 Hz (the note A3), and the integer multiples 2f, 3f and so on form the harmonic spectrum. By adjusting each harmonic's amplitude aₙ you reshape the composite wave in real time, watch its frequency spectrum, and hear the resulting timbre through the Web Audio oscillators.
The composite curve is computed as the additive sum aₙ·sin((n+1)t) over eight harmonics, then normalised and drawn alongside its faint individual components and a frequency-spectrum bar chart. Preset buttons load the classic amplitude recipes: sawtooth (aₙ = 1/n), square (odd harmonics only, 1/n), triangle (odd harmonics, 1/n²) and a single sine.
Pick a preset (Sawtooth, Square, Triangle or Sine) or drag the eight amplitude sliders aₙ, each labelled with its frequency from 220 Hz up to 1760 Hz. Press the Sound button to play the harmonics as live oscillators, and toggle Epicycles to see rotating circles whose radii match each amplitude trace the wave.
Joseph Fourier introduced these series in 1822 while studying heat conduction, not sound. The same maths now underpins JPEG image compression, MP3 audio, MRI reconstruction and seismology, because each works in the frequency domain.
Fourier synthesis is the process of building a complex periodic waveform by adding together simple sine waves at harmonic frequencies. It is the reverse of Fourier analysis, which breaks a signal apart into those components. This simulation sums eight sine harmonics above a 220 Hz fundamental to construct waves such as sawtooth, square and triangle.
For every point along the horizontal axis it evaluates the sum of aₙ·sin((n+1)t) for harmonics one to eight, where aₙ is each slider's amplitude and t runs over one full period. The result is normalised to fit the view and drawn as the bright composite curve, with the faint coloured traces showing the contribution of individual harmonics.
Each slider sets the amplitude aₙ of one harmonic, scaled from 0 to 1, and its label shows the matching frequency (220 Hz, 440 Hz, 660 Hz and so on up to 1760 Hz). The presets simply load known amplitude patterns: 1/n for a sawtooth, odd-only 1/n for a square, odd-only 1/n² for a triangle, and a single term for a pure sine.
Yes within the model's limits. The Sound button creates eight real sine oscillators tuned to the exact harmonic frequencies and weighted by your slider values, so the timbre you hear matches the waveform on screen. Because only eight harmonics are used, sharp-edged waves like the square show gentle ripples rather than perfectly vertical sides.
Their symmetry forces all even harmonics to vanish in the Fourier series, so only odd multiples of the fundamental remain. The visible rounding of the square wave near its edges, which persists no matter how many terms are added, is the Gibbs phenomenon, a fundamental feature of truncated Fourier series rather than a flaw in the simulation.