Fourier Transform · Interactive Simulation
Signal
Wound graph
Center of mass
FT magnitude
1.00 Hz
1.0x
DEMO MODE
① Time domain signal
② Winding machine (complex plane)
③ Almost Fourier transform
winding freq Space play/pause R reset 1-8 presets S sound

What is the Fourier Transform?

The Fourier Transform is one of the most powerful tools in mathematics and engineering. At its core, it answers a simple question: what frequencies are hidden inside a signal? A signal that looks like complicated noise in time might be nothing more than a handful of pure tones layered on top of each other. The Fourier Transform finds those tones.

This simulation visualises the intuition behind the transform in exactly the way 3Blue1Brown's famous video does — by turning the concept of "winding a signal around a circle" into something you can interact with directly.

How to use this simulation

The core idea — The Winding Machine

Imagine taking the time-domain signal (left panel) and "wrapping" it around a circle like winding thread onto a spool. The winding frequency controls how fast you wrap. If you wind at exactly 1 revolution per second, each second of signal maps to one full loop around the circle.

Now imagine computing the center of mass of all the points on that wound-up curve. Most of the time, the curve wraps around fairly symmetrically, and the center of mass sits near the origin. But when your winding frequency happens to match the actual frequency of the signal, the curve lines up beautifully on one side — the center of mass swings far from the origin. That's the detection event.

Almost-FT(f_wind) = (1/T) · ∫₀ᵀ g(t) · e^(−2πi · f_wind · t) dt

where g(t) is the signal and f_wind is the winding frequency. The result is the center of mass of the wound-up graph in the complex plane.

The true Fourier Transform differs from the "Almost" version only in that it doesn't divide by time — meaning a longer signal gives a proportionally larger spike, making it easier to resolve nearby frequencies. This is intimately connected to the Heisenberg Uncertainty Principle.


Technical Details

Signal Generation

Each preset signal is computed analytically as a sum of pure sinusoids sampled at 2000 points per second over a 2-second window, giving 4000 time samples. Square and sawtooth waves use their Fourier series decompositions (adjustable via the "Terms" slider).

Winding Computation

The wound graph is computed by evaluating g(t) · e^(−2πi·f·t) for each sample, mapping time samples onto the complex plane. This is the discrete equivalent of the continuous integral, computed in real time at 60fps.

FT Scan

The frequency-domain panel pre-scans 500 winding frequencies from 0 to 10 Hz and stores the center-of-mass magnitude at each, updated whenever the signal changes. A vertical cursor tracks the current winding frequency.

Sonification

Uses the Web Audio API to generate the actual signal as audio. Each frequency component drives an OscillatorNode at its exact frequency and amplitude. Toggle with the Sound button or the S key.

Rendering

Three independent Canvas2D contexts render at 60fps with requestAnimationFrame. Each canvas resamples to its actual pixel dimensions on resize via ResizeObserver for crisp rendering on HiDPI screens.

Input

Keyboard shortcuts, mouse drag on the winding slider, and touch events are all handled. The winding frequency slider responds to left/right arrow keys. Demo mode triggers after 10 s of no interaction (click, keydown, or touch).


Signal Presets Explained


Future Directions