Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) Algorithms

Graduate Depth 87 in the knowledge graph I know this Set as goal
Unlocks 20 downstream topics
dft fft algorithms computational

Core Idea

The DFT X[k] = Σ x[n]e^(-j2πkn/N) computes the frequency content of a finite-length sequence, with O(N²) operations. The FFT (Cooley-Tukey algorithm) reduces this to O(N log N), making real-time spectral analysis practical. FFT is the foundation of digital signal processing.

Explainer

From the discrete-time Fourier transform (DTFT), you know how to represent a sequence's frequency content — but the DTFT result X(e^jω) is a continuous, periodic function of frequency that you cannot store or compute exactly on a computer. The DFT solves this by sampling the DTFT at exactly N equally-spaced frequency points: ωₖ = 2πk/N for k = 0, 1, …, N−1. The result is N complex numbers X[0] through X[N−1] that completely represent the N-point input sequence x[0] through x[N−1]. Crucially, the DFT is invertible — you can recover x[n] exactly from X[k] using the inverse DFT. Nothing is lost; it is simply a change of basis.

The formula X[k] = Σₙ x[n] · e^(−j2πkn/N) says that each output X[k] is an inner product between the input sequence and a complex sinusoid at frequency k/N cycles per sample. From complex numbers, you know that e^(jθ) is a unit-magnitude complex number at angle θ — a point on the unit circle. The quantity W = e^(−j2π/N) is the fundamental twiddle factor: a rotation by 2π/N radians clockwise. The powers W^(kn) are N evenly-spaced points on the unit circle, and computing X[k] is equivalent to asking: how well does the input sequence correlate with each of these rotating complex exponentials? Large |X[k]| means the input contains a strong component at frequency k/N.

The computational problem with this approach is cost. Computing all N outputs requires, naively, N multiplications for each of the N outputs — N² complex multiplications total. For N = 1024, that is about one million operations. For N = 65536 (typical in audio processing), it is over four billion. The Fast Fourier Transform (FFT), specifically the Cooley-Tukey algorithm, reduces this to O(N log₂ N) by exploiting the algebraic structure of the twiddle factors. The key insight: W^(kn) is periodic with period N in both k and n, so many of the N² multiplications produce identical twiddle factors and their contributions can be combined rather than recomputed. The algorithm recursively splits the N-point DFT into two N/2-point DFTs (one for even-indexed inputs, one for odd-indexed inputs), each of which splits further, until the base case of 1-point DFTs (trivially equal to the input itself). After log₂(N) levels of splitting, the results are combined bottom-up using small butterfly operations. For N = 65536, this reduces four billion operations to about one million — a 4000× speedup.

Interpreting DFT output correctly requires knowing what each index k means. X[0] is the DC component — the average of the entire sequence. X[1] corresponds to exactly one complete cycle across the N samples (the fundamental frequency). X[k] at k = N/2 is the Nyquist frequency — the highest resolvable frequency, equal to half the sampling rate. For a real-valued input signal (which most physical signals are), the spectrum is conjugate symmetric: X[N−k] = X[k]*, meaning the second half of the DFT output mirrors the first half. Only the first N/2 values carry unique frequency information. When you see a spectrum plotted showing only the positive frequencies, this symmetry is why: the negative-frequency half is redundant for real signals and is typically discarded or folded.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionFundamental Theorem of Calculus Part 1Fundamental Theorem of Calculus Part 2U-SubstitutionIntegration by PartsSeparable Differential EquationsIntegrating Factor Method for First-Order Linear ODEsFirst-Order Linear Ordinary Differential EquationsSecond-Order Linear Homogeneous Differential EquationsCharacteristic Equation Method for Linear ODEsComplex Roots and Oscillatory SolutionsSpring-Mass Systems and Mechanical VibrationsResonance and Damping in Forced VibrationsRLC Circuit Applications of Differential EquationsIntroduction to Differential EquationsLaplace Transform: Fundamentals and PropertiesZ-Transform: Fundamentals for Discrete-Time SignalsDiscrete-Time Fourier Transform (DTFT)Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) Algorithms

Longest path: 88 steps · 394 total prerequisite topics

Prerequisites (3)

Leads To (4)