Any signal — a chord, a heartbeat, a stock chart — is secretly a SUM of pure sine waves. The Fourier transform finds them: feed it a wiggle in time, it hands back HOW MUCH of each frequency is inside. That’s how an equalizer, an MRI, and JPEG all work. Here the top is the signal in time; the bottom is its spectrum. Slide to change the mix and watch the peaks move.
The Discrete Fourier Transform maps N time samples to N complex frequency coefficients: X[k]=Σₙ x[n]e^(−2πi kn/N). Each |X[k]| is how much of frequency k the signal contains and arg X[k] its phase; a pure cosine at bin k puts all its energy at k (and its mirror N−k). The transform is invertible (the IDFT rebuilds x exactly) and energy is conserved (Parseval). It is the mathematical core of spectral analysis, audio EQ, image compression (JPEG’s DCT), MRI, and filtering. A fail-loud self-check throws unless a cosine at a known bin produces its peak there. ◆ real signal math, node-verified.
The DFT assumes a periodic, evenly-sampled, finite window; a frequency between bins SPREADS across neighbours (leakage) — addressed by [[the-window-function]]. The transform pair and Parseval energy are exact.