A waveform is one description of a signal. Fourier analysis asks for another: how strongly does that signal align with each rotating complex sinusoid?
Two views of the same object
Time-domain samples tell us what happened at each instant. Frequency-domain coefficients tell us how much of each discrete oscillation is required to reconstruct those samples. Neither view creates information; each organises the same finite sequence around a different question.
For a sequence x[n] of length N, the discrete Fourier transform is:
The index k labels a basis function completing exactly k cycles in the observation. If samples arrive at fₛ samples per second, adjacent bins are separated by Δf = fₛ/N hertz. The coefficient is complex: its length gives magnitude and its angle gives phase.
Interactive experiment
Harmonic composer
How do amplitude, frequency and phase appear in a discrete spectrum?
The waveform is the sample-wise sum. Bar height is one-sided amplitude; amber points encode wrapped phase. Phase becomes unstable when magnitude is effectively zero.
What the computation is doing
Each coefficient is an inner product. The transform rotates a reference phasor at bin k, multiplies it by every sample, and sums. A matching component adds coherently; mismatched rotations tend to cancel. Our one-sided plot doubles non-DC magnitudes to account for the omitted negative-frequency partner of a real signal.
Leakage is the boundary speaking
A DFT treats the observed block as one period of an endlessly repeated signal. A tone at 3 Hz in a one-second record fits the boundary. A tone at 3.25 Hz does not: the periodic extension jumps, and energy spreads across bins. This is spectral leakage—not an FFT error. A tapered window reduces the boundary discontinuity at the cost of a wider main lobe and changed amplitude calibration.
DFT and FFT are not synonyms
The DFT defines the representation. Direct evaluation takes order N² complex operations. An FFT is a family of algorithms that exploits symmetry to compute those same coefficients, commonly in order N log N. Normalisation and sign conventions vary between libraries, but an FFT is not a different transform.
Where the intuition breaks
A short record does not contain a perfectly resolved list of eternal tones. Frequency resolution is constrained by observation duration, phase is meaningless near zero magnitude, and a spectrally rich transient can be localised poorly by one transform of the whole record. The STFT trades some frequency precision for time localisation; sampling determines which frequencies were recoverable before the transform began.
Practical checks
- State sample rate, record length, window and normalisation.
- Keep magnitude, power and decibels distinct.
- Construct the frequency axis differently for odd and even lengths.
- Never interpret phase without checking magnitude.