Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Fourier transform, DFT and FFT

Compact study notes covering the continuous Fourier transform, the discrete Fourier transform (DFT), and the fast Fourier transform (FFT), with definitions, key theorems, formulas, worked numerical examples (4-point DFT and an 8-point FFT example), common exam mistakes and quick checks.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Fourier transforms let an engineer change a signal between the time (or spatial) domain and the frequency domain. The Discrete Fourier Transform (DFT) and its fast algorithm Fast Fourier Transform (FFT) are used in digital signal processing, communications (e.g., OFDM), filters, image processing and any engineering task that needs spectral analysis or convolution implemented efficiently.

Key ideas

  • Definition: For a function f(t) that is absolutely integrable, the Fourier transform is F(ω) = ∫_{-∞}^{∞} f(t) e^{-i ω t} dt. (Assumption: the integral exists in the usual or distributional sense.)

  • The inverse Fourier transform is f(t) = (1/2π) ∫_{-∞}^{∞} F(ω) e^{i ω t} dω.

  • (Alternate conventions use factors of 2π split between transform and inverse; check your course convention.)

  • Frequency in Hz: If you prefer frequency f (Hz) instead of angular frequency ω, use F(f) = ∫{-∞}^{∞} f(t) e^{-i 2π f t} dt and inverse f(t) = ∫{-∞}^{∞} F(f) e^{i 2π f t} df.

  • Properties: Linearity, time-shift, modulation (frequency shift), scaling, differentiation in time corresponds to multiplication by iω in frequency, convolution theorem: convolution in time ↔ multiplication in frequency and vice versa. State these exactly in exam answers with the chosen transform convention.

  • Discrete-time signals: A discrete-time sequence x[n] (n integer) has a Discrete-Time Fourier Transform (DTFT) X(ω) = ∑{n=-∞}^{∞} x[n] e^{-i ω n}. The DTFT is periodic (2π-periodic) in ω. The inverse DTFT is x[n] = (1/2π) ∫{-π}^{π} X(ω) e^{i ω n} dω.

  • Discrete Fourier Transform (DFT): Used for finite sequences. Given a finite-length sequence x[n] of length N (considered zero outside 0..N-1):

    • Definition: The N-point DFT is X[k] = ∑_{n=0}^{N-1} x[n] e^{-i 2π k n / N}, for k = 0,1,...,N-1. If the samples are taken at sampling rate F_s (Hz), the physical frequency of bin k is f_k = k F_s / N for k = 0..N-1 (bins k > N/2 represent negative frequencies modulo F_s).
    • Inverse DFT (IDFT): x[n] = (1/N) ∑_{k=0}^{N-1} X[k] e^{i 2π k n / N}.
    • (This pair uses unity in forward transform and 1/N in inverse. If your course uses symmetric 1/√N factors, adjust statements accordingly.)
  • Matrix form: DFT is multiplication by the DFT matrix W where W_{k,n} = e^{-i 2π k n / N}. W is unitary up to the normalization factor (W W* = N I with the forward/no-normalization convention above).

  • Periodicity and symmetry: For real x[n], X[k] has conjugate symmetry X[N-k] = X*[k] (prove by conjugating the DFT sum). Also X[k] is periodic with period N (X[k+N]=X[k]).

  • Parseval / Plancherel (discrete): With the above DFT/IDFT normalization, ∑{n=0}^{N-1} |x[n]|^2 = (1/N) ∑{k=0}^{N-1} |X[k]|^2. (This equality is important to check normalization signs in an exam.)

  • Convolution theorem (discrete circular): The circular convolution x ⊛ y (length-N) corresponds to pointwise multiplication: DFT{x ⊛ y} = DFT{x} · DFT{y}. For linear convolution, zero-pad signals to length ≥ (length(x)+length(y)-1) before DFT.

  • Computational cost:

    • Direct DFT via definition costs O(N^2) complex multiplies/adds.
    • FFT (Cooley–Tukey radix-2 decimation-in-time for N a power of two) reduces cost to O(N log2 N) complex operations. This is why FFT is crucial in practice.
  • Cooley–Tukey idea (radix-2 DIT): Split x[n] into even and odd subsequences of length N/2, compute two (N/2)-point DFTs recursively, then combine by multiplying by twiddle factors e^{-i 2π k/N} and using butterflies. Draw a flow graph with N inputs at left, log2(N) stages of butterflies, and N outputs on the right; each stage reduces dependence similarly.

Diagram (what to draw for an FFT flow graph for N=8): draw 8 horizontal lines labelled x[0]..x[7] left to right inputs; split into even indices x[0],x[2],x[4],x[6] (top) and odd x[1],x[3],x[5],x[7] (bottom); show two 4-point DFT blocks, then arrows to combine with multipliers labelled W_N^k (twiddle factors) and butterfly add/subtract nodes, and label outputs X[0]..X[7].

Formulas

F(ω) = ∫_{-∞}^{∞} f(t) e^{-i ω t} dt — F(ω) is Fourier transform, ω in rad·s^{-1}, f(t) in units of signal amplitude; applies when integral converges.

f(t) = (1/2π) ∫_{-∞}^{∞} F(ω) e^{i ω t} dω — inverse transform, same units; applies with same convention as forward transform.

X(ω) = ∑_{n=-∞}^{∞} x[n] e^{-i ω n} — DTFT of sequence x[n]; ω is dimensionless (radians).

X[k] = ∑_{n=0}^{N-1} x[n] e^{-i 2π k n / N} — N-point DFT; k = 0..N-1; x[n] unit as sample amplitude.

x[n] = (1/N) ∑_{k=0}^{N-1} X[k] e^{i 2π k n / N} — N-point IDFT.

∑_{n=0}^{N-1} |x[n]|^2 = (1/N) ∑_{k=0}^{N-1} |X[k]|^2 — Parseval for the DFT pair above.

Complexity: direct DFT O(N^2); radix-2 FFT O(N log2 N) — big-O costs (operation counts omitted here; see standard references for exact counts).

W_N = e^{-i 2π / N} — a primitive Nth root of unity, called the twiddle factor. W_N^{k n} = e^{-i 2π k n / N}.

Worked examples

Example 1 — 4-point DFT (numerical, exam style) Problem: Compute the 4-point DFT X[k] of x[n] = {1, 0, -1, 0} for n = 0..3. Steps:

  1. Use X[k] = ∑_{n=0}^{3} x[n] e^{-i 2π k n / 4}.
  2. Evaluate term-by-term:
    • X[0] = 1 + 0 + (-1) + 0 = 0.
    • X[1] = 1 + 0 + (-1) e^{-i π} + 0 = 1 + (-1)(-1) = 2.
    • X[2] = 1 + 0 + (-1) e^{-i 2π} + 0 = 1 + (-1)(1) = 0.
    • X[3] = 1 + 0 + (-1) e^{-i 3π} + 0 = 1 + (-1)(-1) = 2. Answer: X = {0, 2, 0, 2}. (Final answer in bold) X = [0, 2, 0, 2].

Example 2 — 8-point DFT computed by FFT idea (numerical) Problem: Compute X[k] for x[n] = {1,2,3,4,0,0,0,0} (n = 0..7). Use the DFT formula but show symmetry and FFT steps to reduce work. Steps:

  1. Because x[n] is real and zero for n≥4, X[k] = ∑_{n=0}^{3} x[n] e^{-i 2π k n / 8}.
  2. Compute values for k = 0..4 and use conjugate symmetry X[8-k] = X*[k] for real input.
  3. Compute numerically using cos/sin of multiples of π/4 (use cos45° ≈ 0.7071):
    • X[0] = 1+2+3+4 = 10.
    • X[1] ≈ 1 + 2 e^{-iπ/4} + 3 e^{-iπ/2} + 4 e^{-i3π/4} ≈ 1 + (1.4142 - i1.4142) + (0 - i3) + (-2.8284 - i2.8284) ≈ -0.4142 - i7.2426.
    • X[2] ≈ 1 + 2 e^{-iπ/2} + 3 e^{-iπ} + 4 e^{-i3π/2} ≈ 1 + (0 - i2) + (-3) + (0 + i4) = -2 + i2.
    • X[3] ≈ 1 + 2 e^{-i3π/4} + 3 e^{-i3π/2} + 4 e^{-i9π/4} ≈ 2.4142 - i1.2426.
    • X[4] = 1 + 2 e^{-iπ} + 3 e^{-i2π} + 4 e^{-i3π} = -2.
  4. Use conjugate symmetry for remaining bins:
    • X[5] = X*[3] ≈ 2.4142 + i1.2426.
    • X[6] = X*[2] = -2 - i2.
    • X[7] = X*[1] ≈ -0.4142 + i7.2426. Answer: X ≈ [10, -0.4142 - i7.2426, -2 + i2, 2.4142 - i1.2426, -2, 2.4142 + i1.2426, -2 - i2, -0.4142 + i7.2426]. (Note: In an exam you may present exact forms with radicals and i; above we give decimal approximations to 4 digits.)

Common mistakes

  • Indexing errors: not wrapping indices modulo N (DFT is periodic) or using linear convolution when circular is intended (forget zero-padding).
  • Using conjugate-symmetry for non-real sequences.
  • Complexity confusion: claiming FFT is O(N) instead of O(N log N), or giving exact counts for multiplications without specifying radix and counting method.
  • Numerical rounding: not keeping enough precision when combining many complex terms in hand calculations.

For your exam

Kinds of questions:

  • Definitions: define Fourier transform, DTFT, DFT, FFT, W_N, and state inversion formulas and assumptions.
  • Short notes: properties (convolution theorem, Parseval), differences between DTFT and DFT, relation between continuous FT and sampled/DFT spectra.
  • Derivations: derive DFT from DTFT by sampling/periodisation, prove Parseval for DFT, derive Cooley–Tukey splitting for radix-2 and show one stage of the butterfly.
  • Numericals: compute small N-point DFTs by hand (N = 4 or 8), show FFT butterfly steps, zero-padding to compute linear convolution via DFT.
  • Diagrams: draw FFT flow graph, DFT matrix structure, time vs frequency plots. What full-marks answers include:
  • Clear statement of conventions (where 2π or normalization factors are placed).
  • Stepwise derivation with indices shown and modular arithmetic used explicitly.
  • Correct diagrams labelled (e.g., in FFT draw inputs x[0]..x[N-1], stages, twiddle factors W_N^k and outputs X[0]..X[N-1]).
  • For numericals: show intermediate arithmetic and final answers with units/precision.

Quick check

  1. Write the N-point DFT definition and its inverse (with the convention used in these notes).
  2. If x[n] is real, what relation connects X[k] and X[N-k]?
  3. Why must you zero-pad two sequences before multiplying their DFTs to get linear convolution?

Answers: 1) X[k] = ∑{n=0}^{N-1} x[n] e^{-i 2π k n / N}, x[n] = (1/N) ∑{k=0}^{N-1} X[k] e^{i 2π k n / N}. 2) X[N-k] = X*[k] (conjugate symmetry for real x[n]). 3) Without zero-padding multiplication gives circular convolution; zero-pad to length ≥ length(x)+length(y)-1 to avoid wrap-around and recover linear convolution.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?