4.10.26 · D3Advanced Topics (Elite Level)

Worked examples — Fourier analysis — DFT, FFT algorithm (Cooley-Tukey)

2,964 words13 min readBack to topic

The scenario matrix

Every DFT/FFT problem you will meet falls into one of these case classes. The columns say what makes the case special; the last column names the worked example that covers it.

Case class What is tricky about it Covered by
DC / constant input all samples equal → one spike at , zeros elsewhere Ex 1
Single impulse (spike) one sample nonzero → flat spectrum, every equal Ex 2
Real cosine, on-grid real input → two mirror spikes ( and ) Ex 3
General real vector, hand DFT full computation, all quadrants of used Ex 4
Same vector via FFT butterflies check algorithm = definition Ex 5
Conjugate-symmetry shortcut real input → compute half, mirror the rest Ex 6
Degenerate: and base cases of the recursion; the "smallest DFTs" Ex 7
Odd length radix-2 fails — must use the raw sum Ex 8
Word problem (real world) sampling a tone, reading the bins in Hz Ex 9
Exam twist: cost counting count multiplies, prove the speedup number Ex 10

The "signs / quadrants" the parent worried about (like in ) show up here as the four locations of on the unit circle: (angle ), (angle ), (angle ), (angle ). Every example below is really just landing on those four points and adding.

The figure below is our master map. The horizontal axis is the real part, the vertical axis the imaginary part, and the white circle is the unit circle (radius ). Each coloured arrow starts at the origin dot and points to one power of : the yellow arrow to (pointing right, angle ), the blue arrow to (straight down, angle because of the minus sign), the pink arrow to (pointing left, angle ), and the second yellow arrow to (straight up, angle ). Every DFT sum below is just adding arrows that land on these four spots.

Figure — Fourier analysis — DFT, FFT algorithm (Cooley-Tukey)

Example 1 — DC / constant input

The four unit arrows below (one per term of the sum) chain head-to-tail and land back at the start dot — that is why the sum is exactly zero.

Figure — Fourier analysis — DFT, FFT algorithm (Cooley-Tukey)

Example 2 — single impulse (the dual of Ex 1)


Example 3 — real cosine sampled exactly on the grid

Figure — Fourier analysis — DFT, FFT algorithm (Cooley-Tukey)

Example 4 — general real vector, full hand DFT (all four quadrants)


Example 5 — the same vector via FFT butterflies

The butterfly figure below shows the two blue inputs and on the left, the yellow outputs on the right, and the pink edges are the ones carrying the twiddle multiply .

Figure — Fourier analysis — DFT, FFT algorithm (Cooley-Tukey)

Example 6 — conjugate-symmetry shortcut


Example 7 — degenerate base cases and


Example 8 — odd length (radix-2 forbidden)


Example 9 — real-world word problem


Example 10 — exam twist: prove the speedup number


Recall

Recall Scenario check

Constant signal , points — spectrum? ::: , all other . Single impulse — spectrum? ::: Flat: for all . Real cosine at integer freq , length — which bins? ::: and , each amplitude . Real sine at freq — bin values? ::: , (imaginary, opposite signs). Why can't radix-2 FFT handle ? ::: is not a power of ; you cannot split into equal even/odd halves. Bin of an -point FFT sampled at sits at what frequency? ::: Hz (for ). How many independent complex bins for a real length- input? ::: (bins through ); the rest are conjugates. Multiply count of a radix-2 FFT? ::: About twiddle multiplies.

See the Convolution Theorem for the payoff of all this speed: fast multiplication of polynomials and integers.