SARATH THARAYILST
WRITEUPSCONCEPTSPROJECTSLABABOUT
SARATH THARAYIL
മ
IGARATIPO: AMAZON TRIBUTARIES
/ SYSTEM

Building thoughtful software, writing notes, and shipping experiments across data, AI, and the web.

No cookies, no tracking. Preferences are stored locally in your browser. Anonymous view counts are kept server-side.

Hey, there's a story for the river above/© 2026 Sarath Tharayil/IST --:--:--
← LAB

Fourier Epicycles

Jun 6, 2026

The Discrete Fourier Transform says any periodic signal is a sum of sinusoids. Geometrically: any closed curve is a sum of circles. This makes it visible — N spinning circles, each at a different frequency, stacked tip to tail, whose combined tip traces your shape exactly.

CIRCLES64

DFT of heart sampled at 64 frequencies. More circles = better approximation.

/ NOTES
HOW IT WORKS

The path is sampled at N points. A DFT computes amplitude and phase for each frequency. Epicycles are sorted by amplitude — the biggest circle first. The tip traces the reconstructed path.

PRESETS
HeartThe classic cardioid-like parametric curve.
StarA five-pointed star path.
SquareStraight edges — needs many harmonics to approximate sharp corners.
DrawPaint your own closed curve freehand.
WHAT TO TRY

Reduce N to 3 and watch the coarse approximation. Increase to full N for exact reconstruction. Draw mode: click and drag to paint a shape, then press Play.