The Fourier transform maps a signal from a position or time representation to a frequency representation. A discrete implementation produces a finite array of complex bins—each with magnitude and phase—rather than an infinitely detailed physical spectrum. The transform only has meaning when its sampling and normalization contract travel with the array.
O(N²) DFT as a readable oracle before replacing it with an FFT; both must satisfy the same round-trip fixture. Keep complex bins intact until a task specifically needs magnitude or phase, because a magnitude-only spectrum cannot reconstruct the signal.The direct DFT maps N samples to N bins. With sample interval Δt, the sample rate is f_s = 1/Δt, and nonnegative bin k initially maps to
The inverse normalization shown here is one valid convention. Other libraries may split scaling differently, but forward and inverse must agree. For real samples, the upper bins conventionally represent negative frequencies after wrapping; do not throw them away merely because a graph only shows the lower half.
Choose a bin-aligned sine wave with 16 samples. The bars are DFT magnitudes; a real sine has matching positive- and negative-frequency bins.
Input sine bin 2; dominant DFT bins 2 and 14, each magnitude 8.0. All other ideal bins are zero up to floating-point error.
Use small analytic fixtures before analyzing a measurement: all-ones input should place its energy at DC; an impulse has equal-magnitude bins; and a bin-aligned sine has its matching conjugate pair. Then round-trip a nontrivial finite array. These tests reveal wrong signs, swapped indexing, missing normalization, and accidental phase loss long before an FFT makes the implementation too opaque to inspect.
Prediction: A sinusoid aligned with a bin has a concentrated conjugate pair; moving it off bin spreads energy into nearby bins.
ForN = 16 and f_s = 160 Hz, calculate the frequencies of bins 2 and 14. Inspect the matching magnitude bars, then state the inverse normalization used by the code. Design an impulse fixture and predict its magnitude spectrum before evaluating it.Use a DFT to expose complex frequency data with declared units and convention. Validate it with DC, impulse, sine, and inverse-reconstruction fixtures before interpreting a magnitude plot from a measured signal.
Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.
\[\text{observable output} = f(\text{inputs},\,\text{state})\]For Fourier Transform, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Waves II — Analysis and Transformations, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.
Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.
This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.
Treat Fourier Transform as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.
Transform sampled signal arrays into documented complex frequency bins and verify inverse reconstruction.