Signals / complex Fourier series

Fourier Sketch

Draw a path. The browser samples it as a periodic complex signal, finds its Fourier coefficients, and rebuilds the drawing with rotating vectors.

Draw → decompose → trace

Drag one continuous stroke in the field. The cyan dashed source is closed before sampling; magenta is its retained Fourier reconstruction.

Signal controls

More components retain more detail; the largest amplitudes are added first.

Sampling ledger

stroke points180
DFT samples128
time0.000

Every component is one complex coefficient: a radius, a phase, and an integer rotation frequency. Their vector sum is the tracing point.

All 128 terms exactly reproduce this 128-sample signal. More than 128 terms would add no information unless the sketch is sampled more densely.

Dominant components

The circle radii in the canvas are coefficient amplitudes.

rankfrequencyamplitudephase
1-10.69390°
2+20.094-90°
3-30.085-90°
4-20.066-90°
5-40.057-90°
6+10.042-90°
7+00.03990°
8+40.031-90°

The equation behind the pen

z(t) = Σₖ cₖ · ei2πkt

The direct discrete Fourier transform (DFT) computes the cₖ values from 128 evenly spaced samples. Using all 128 coefficients reconstructs that sampled periodic signal. A 1024-term version would need 1024 samples and a faster FFT, otherwise it would only duplicate frequency information.

A freehand path is not naturally periodic, so this demo closes the final point back to the first before taking the DFT. Try a loop for the cleanest reconstruction.