WHAT we want: write xn as a combination of the simplest periodic functions on N points — the complex exponentials e2πikn/N, one per integer frequency k.
Step 1 — Propose the basis. Define vectors e(k) with components en(k)=e2πikn/N.
Why this step? On a discrete grid of N points, only N distinct frequencies exist (frequency k and k+N give the same samples since e2πi(k+N)n/N=e2πikn/N). So we need exactly N basis vectors.
Step 2 — Show they are orthogonal. Compute the inner product (with conjugate):
⟨e(k),e(j)⟩=∑n=0N−1e2πikn/Ne−2πijn/N=∑n=0N−1(e2πi(k−j)/N)n.
This is a geometric series with ratio r=e2πi(k−j)/N.
Why this step? Orthogonality means we can extract each coefficient independently — no solving a linear system.
If k=j: every term is 1, sum =N.
If k=j: r=1 but rN=e2πi(k−j)=1, so ∑nrn=r−1rN−1=0.
Thus ⟨e(k),e(j)⟩=Nδkj.
Step 3 — Project. Write xn=N1∑kXke2πikn/N (inverse). Taking the inner product with e(k) and using orthogonality kills all but one term, giving
Xk=∑n=0N−1xne−2πikn/N=∑nxnωNnk.
That is the DFT. The minus sign appears because we conjugate when projecting.
Assume N is even (radix-2 needs N=2m). Split:
Xk=∑n evenxnωNnk+∑n oddxnωNnk.
Let n=2m (even) and n=2m+1 (odd), m=0,…,N/2−1:
Xk=∑mx2mωN2mk+ωNk∑mx2m+1ωN2mk.
Key identity:ωN2=e−4πi/N=e−2πi/(N/2)=ωN/2.
Why this matters:ωN2mk=ωN/2mk, so each inner sum is exactly a DFT of length N/2:
Xk=Ek+ωNkOk
where Ek=DFTN/2(even part), Ok=DFTN/2(odd part).
The free second half (the symmetry that gives the speedup):Ek and Ok are periodic with period N/2, and ωNk+N/2=ωNN/2ωNk=−ωNk. Therefore:
Xk=Ek+ωNkOk,Xk+N/2=Ek−ωNkOk,k=0,…,2N−1.
Let T(N) = work to do an N-point FFT. We do two half-size FFTs plus N/2 butterflies (O(N) combine):
T(N)=2T(N/2)+cN.
By the Master Theorem (or unrolling log2N levels, each costing cN):
T(N)=O(Nlog2N).Why logN levels? Halving N repeatedly until size 1 takes log2N steps; each full level touches all N values once.
#flashcards/maths
DFT formula for Xk? ::: Xk=∑n=0N−1xnωNnk with ωN=e−2πi/N.
Why are the DFT basis vectors usable independently? ::: They are orthogonal: ⟨e(k),e(j)⟩=Nδkj (geometric-series argument).
Why does the k=j inner product vanish? ::: Geometric series with ratio r=1 but rN=1, so (rN−1)/(r−1)=0.
Cooley–Tukey split — what two sub-DFTs appear? ::: Length-N/2 DFTs of the even-indexed and odd-indexed samples, Ek and Ok.
Key identity that makes sub-sums into half-size DFTs? ::: ωN2=ωN/2.
The butterfly equations? ::: Xk=Ek+ωNkOk and Xk+N/2=Ek−ωNkOk.
Why does Xk+N/2 come almost free? ::: ωNk+N/2=−ωNk, so only a sign flips.
FFT recurrence and its solution? ::: T(N)=2T(N/2)+cN⇒O(Nlog2N).
Speedup factor over naïve DFT? ::: N/log2N.
For real input, relation between Xk and XN−k? ::: XN−k=Xk (conjugate symmetry).
Why the 1/N in the IDFT? ::: Basis vectors have squared norm N; normalization undoes it.
Recall Feynman: explain to a 12-year-old
Imagine you record a chord on a piano as a wiggly line. The DFT is a machine that listens and tells you "this much C, this much E, this much G." Doing it the slow way is like checking every note against every moment of the recording — tons of checking. The FFT is a smart shortcut: it splits the recording into "even moments" and "odd moments," figures out each smaller piece, then glues them back with one quick twist each. Splitting again and again means way less work — and that's how your phone shows music bars dancing in real time.
Dekho, DFT ka matlab simple hai: tumhare paas N samples hain (jaise sound ya signal), aur tum jaanna chahte ho ki usme kaun kaun si frequencies kitni hain. Iske liye hum signal ko pure rotating waves (e−2πikn/N) ke combination me todte hain. Har wave alag frequency k ki hoti hai, aur formula Xk=∑nxnωNnk bas yeh "kitna" measure karta hai. Yeh waves orthogonal hoti hain (geometric series se prove hota hai), isiliye har coefficient alag se nikal aata hai — koi bada equation solve nahi karna padta.
Ab problem yeh hai ki naive tareeke se yeh N2 operations leta hai, jo bade N ke liye bahut slow hai. Yahin pe FFT (Cooley–Tukey) ka jaadu aata hai. Idea: samples ko even index aur odd index me baant do. Dono halves khud apne aap me chhoti DFT (N/2 size) ban jaate hain — kyunki ek mast identity hai, ωN2=ωN/2. Phir dono ko jodne ke liye butterfly use karte hain: Xk=Ek+ωNkOk aur Xk+N/2=Ek−ωNkOk. Dhyaan do — neeche wala output bas sign flip se mil gaya, free me! Ek multiply me do output.
Yeh splitting baar baar karte raho, toh log2N levels banti hain, har level N work, total O(NlogN). N=220 pe yeh lagbhag 50,000 guna fast hai naive se. Isiliye MP3, JPEG, MRI, mobile audio bars — sab FFT pe chalte hain.
Ek common galti: log sochte hain FFT aur DFT alag-alag answer dete hain. Nahi! FFT bas DFT ka fast algorithm hai, answer bilkul same. Aur radix-2 FFT ke liye N ka power-of-2 hona zaroori hai, warna mixed-radix ya Bluestein lagta hai. Inverse karte waqt 1/N lagana mat bhoolna, warna scale bigad jaata hai.