Algorithm Search⌘K

Proofs: Split-radix FFT

These are the human proofs of Split-radix FFT, at full length.

SPLIT-RADIX-FFT computes the DFT of length 2^m with n lg n additions and (n/2) lg n − n + 1 multiplications full

This proof shows: correctness, complexity.

Statement. Let RR be a commutative ring, n=2mn = 2^m with m≥0m \ge 0, and ω∈R\omega \in R with ωn/2=−1\omega^{n/2} = -1 if n≥2n \ge 2 (any ω\omega if n=1n = 1). For every x∈Rnx \in R^n, SPLIT-RADIX-FFT(x,ω)(x, \omega) returns XX with Xk=∑j=0n−1xjωjkX_k = \sum_{j=0}^{n-1} x_j \omega^{jk} for 0≤k<n0 \le k < n. It does exactly A(n)=nlg⁡nA(n) = n \lg n additions and subtractions and exactly

T(n)=13nlg⁡n−89n+1−19(−1)m,G(n)=16nlg⁡n−19n+19(−1)mT(n) = \tfrac13 n \lg n - \tfrac89 n + 1 - \tfrac19 (-1)^m, \qquad G(n) = \tfrac16 n \lg n - \tfrac19 n + \tfrac19 (-1)^m

multiplications by twiddle factors (line L8) and by JJ (line L9), so T(n)+G(n)=n2lg⁡n−n+1T(n) + G(n) = \frac n2 \lg n - n + 1 multiplications in all.

The hypothesis is inherited. If n≥2n \ge 2 then ωn=(ωn/2)2=1\omega^n = (\omega^{n/2})^2 = 1. If n≥4n \ge 4, the call at line L3 has length n/2n/2 and root ω2\omega^2, and (ω2)(n/2)/2=ωn/2=−1(\omega^2)^{(n/2)/2} = \omega^{n/2} = -1; the calls at lines L4 and L5 have length n/4n/4 and root ω4\omega^4, and if n/4≥2n/4 \ge 2 then (ω4)(n/4)/2=ωn/2=−1(\omega^4)^{(n/4)/2} = \omega^{n/2} = -1. So every recursive call satisfies the hypothesis of the statement.

Lemma 1 (the splitting). Let n≥4n \ge 4, q=n/4q = n/4, and let Uk=∑j<2qx2jω2jkU_k = \sum_{j<2q} x_{2j} \omega^{2jk}, Zk=∑j<qx4j+1ω4jkZ_k = \sum_{j<q} x_{4j+1} \omega^{4jk} and Zk′=∑j<qx4j+3ω4jkZ'_k = \sum_{j<q} x_{4j+3} \omega^{4jk}, defined for all integers k≥0k \ge 0. Then for every k≥0k \ge 0,

Xk=Uk+ωkZk+ω3kZk′,X_k = U_k + \omega^k Z_k + \omega^{3k} Z'_k,

and UU has period 2q2q and Z,Z′Z, Z' have period qq in kk.

Proof. Each j∈[0,n)j \in [0, n) is even, or 11 or 33 modulo 44, and in exactly one way of the form 2j′2j', 4j′+14j' + 1 or 4j′+34j' + 3. So XkX_k is the sum of ∑j′x2j′ω2j′k\sum_{j'} x_{2j'} \omega^{2j'k}, ∑j′x4j′+1ω(4j′+1)k=ωkZk\sum_{j'} x_{4j'+1} \omega^{(4j'+1)k} = \omega^k Z_k and ∑j′x4j′+3ω(4j′+3)k=ω3kZk′\sum_{j'} x_{4j'+3} \omega^{(4j'+3)k} = \omega^{3k} Z'_k. The periods follow from ω2⋅2q=ωn=1\omega^{2 \cdot 2q} = \omega^n = 1 and ω4q=ωn=1\omega^{4q} = \omega^n = 1. □\square

Lemma 2 (the L-shaped butterfly). With J=ωqJ = \omega^{q} and 0≤k<q0 \le k < q, put a=ωkZka = \omega^k Z_k, b=ω3kZk′b = \omega^{3k} Z'_k, s=a+bs = a + b and d=J(a−b)d = J(a - b). Then

Xk=Uk+s,Xk+2q=Uk−s,Xk+q=Uk+q+d,Xk+3q=Uk+q−d.X_k = U_k + s, \quad X_{k + 2q} = U_k - s, \quad X_{k+q} = U_{k+q} + d, \quad X_{k+3q} = U_{k+q} - d.

Proof. We have J2=ωn/2=−1J^2 = \omega^{n/2} = -1, so J3=−JJ^3 = -J and J4=1J^4 = 1. Apply Lemma 1 at k+rqk + rq for r=0,1,2,3r = 0, 1, 2, 3. By the periods, Zk+rq=ZkZ_{k + rq} = Z_k and Zk+rq′=Zk′Z'_{k+rq} = Z'_k, and Uk+2q=UkU_{k + 2q} = U_k, Uk+3q=Uk+qU_{k + 3q} = U_{k+q}. The twiddle factors are ωk+rq=Jrωk\omega^{k + rq} = J^r \omega^k and ω3(k+rq)=J3rω3k\omega^{3(k + rq)} = J^{3r} \omega^{3k}. For r=0r = 0 this gives Xk=Uk+a+bX_k = U_k + a + b. For r=2r = 2, J2=J6=−1J^2 = J^6 = -1, so Xk+2q=Uk−a−bX_{k+2q} = U_k - a - b. For r=1r = 1, J3=−JJ^3 = -J, so Xk+q=Uk+q+Ja−Jb=Uk+q+dX_{k+q} = U_{k+q} + J a - J b = U_{k+q} + d. For r=3r = 3, J3=−JJ^3 = -J and J9=JJ^9 = J, so Xk+3q=Uk+q−Ja+Jb=Uk+q−dX_{k+3q} = U_{k+q} - J a + J b = U_{k+q} - d. □\square

Correctness. By induction on mm. For n=1n = 1, line L1 returns xx, and X0=x0X_0 = x_0. For n=2n = 2, ω=ωn/2=−1\omega = \omega^{n/2} = -1, so X0=x0+x1X_0 = x_0 + x_1 and X1=x0−x1X_1 = x_0 - x_1, which line L2 returns. Let n≥4n \ge 4. The recursive calls satisfy the hypothesis and are on shorter inputs, so by induction lines L3, L4 and L5 compute the sequences UU (for 0≤k<2q0 \le k < 2q), ZZ and Z′Z' (for 0≤k<q0 \le k < q) of Lemma 1: line L3 gets the DFT of (x2j)(x_{2j}) with root ω2\omega^2, and lines L4 and L5 get those of (x4j+1)(x_{4j+1}) and (x4j+3)(x_{4j+3}) with root ω4\omega^4. Line L6 sets J=ωqJ = \omega^q. At k=0k = 0 the factors ω0\omega^0 are 11, so line L8 sets a=Z0a = Z_0 and b=Z0′b = Z'_0 without a product, which are the values of Lemma 2. By Lemma 2, lines L9 to L11 write the correct values to positions k,k+q,k+2q,k+3qk, k + q, k + 2q, k + 3q. As kk runs over [0,q)[0, q) and rr over {0,1,2,3}\{0, 1, 2, 3\}, k+rqk + rq runs over [0,n)[0, n) exactly once (division by qq). So line L12 returns XX.

Inverse. If nn is a unit and ω\omega is a principal nn-th root of unity (for example, RR a field, where ω\omega has order exactly nn because ωn/2=−1≠1\omega^{n/2} = -1 \ne 1), then ω−1\omega^{-1} also satisfies (ω−1)n/2=−1(\omega^{-1})^{n/2} = -1, and the procedure with ω−1\omega^{-1} followed by division by nn inverts the DFT, as shown on the page of the inverse discrete Fourier transform.

Operation count. For n≥4n \ge 4 each iteration of lines L7 to L11 does 66 additions and subtractions (a+ba + b, a−ba - b and four at lines L10 and L11), one product by JJ, and two twiddle products unless k=0k = 0. With q=n/4q = n/4 iterations, the recurrences are

A(n)=A(n/2)+2A(n/4)+32n,T(n)=T(n/2)+2T(n/4)+n2−2,G(n)=G(n/2)+2G(n/4)+n4,A(n) = A(n/2) + 2A(n/4) + \tfrac32 n, \quad T(n) = T(n/2) + 2T(n/4) + \tfrac n2 - 2, \quad G(n) = G(n/2) + 2 G(n/4) + \tfrac n4,

for n≥4n \ge 4, with A(1)=0A(1) = 0, A(2)=2A(2) = 2, and TT and GG zero at n=1,2n = 1, 2, since lines L1 and L2 do no multiplications. Each recurrence determines its function from its two initial values, so it suffices to check that the claimed formulas take these values and satisfy the recurrences. Write ϵ=(−1)m\epsilon = (-1)^m, so (−1)m−1=−ϵ(-1)^{m-1} = -\epsilon and (−1)m−2=ϵ(-1)^{m-2} = \epsilon.

  • AA: nlg⁡nn \lg n is 00 at n=1n = 1 and 22 at n=2n = 2, and n2(m−1)+2⋅n4(m−2)+32n=nm−n2−n+32n=nm\frac n2 (m - 1) + 2 \cdot \frac n4 (m - 2) + \frac32 n = nm - \frac n2 - n + \frac32 n = nm.
  • TT: at n=1n = 1, 0−89+1−19=00 - \frac89 + 1 - \frac19 = 0; at n=2n = 2, 23−169+1+19=0\frac23 - \frac{16}{9} + 1 + \frac19 = 0. And T(n/2)+2T(n/4)=16n(m−1)−49n+1+19ϵ+16n(m−2)−49n+2−29ϵ=13nm−12n−89n+3−19ϵT(n/2) + 2T(n/4) = \frac16 n (m-1) - \frac49 n + 1 + \frac19 \epsilon + \frac16 n (m - 2) - \frac49 n + 2 - \frac29 \epsilon = \frac13 nm - \frac12 n - \frac89 n + 3 - \frac19 \epsilon; adding n2−2\frac n2 - 2 gives T(n)T(n).
  • GG: at n=1n = 1, 0−19+19=00 - \frac19 + \frac19 = 0; at n=2n = 2, 13−29−19=0\frac13 - \frac29 - \frac19 = 0. And G(n/2)+2G(n/4)=112n(m−1)−118n−19ϵ+112n(m−2)−118n+29ϵ=16nm−14n−19n+19ϵG(n/2) + 2G(n/4) = \frac1{12} n(m - 1) - \frac1{18} n - \frac19 \epsilon + \frac1{12} n (m - 2) - \frac1{18} n + \frac29 \epsilon = \frac16 nm - \frac14 n - \frac19 n + \frac19 \epsilon; adding n4\frac n4 gives G(n)G(n).

Adding, T(n)+G(n)=12nlg⁡n−n+1T(n) + G(n) = \frac12 n \lg n - n + 1.

Time and space. Each call does O(1)O(1) work besides its counted operations and its loop, and the number of calls C(n)=1+C(n/2)+2C(n/4)C(n) = 1 + C(n/2) + 2C(n/4) with C(1)=C(2)=1C(1) = C(2) = 1 is O(n)O(n) (by induction, C(n)≤2n−1C(n) \le 2n - 1, since 1+(n−1)+2(n2−1)=2n−21 + (n - 1) + 2(\frac n2 - 1) = 2n - 2). So the time is Θ(nlog⁡n)\Theta(n \log n). A call of length nn holds its three partial results and its output, O(n)O(n) entries, while it runs; along a root-to-leaf path the lengths at least halve, so the live storage is O(n+n/2+…)=O(n)O(n + n/2 + \ldots) = O(n), plus the table of nn powers and a recursion stack of depth lg⁡n\lg n. The extra space is Θ(n)\Theta(n). ■\blacksquare

Back to Split-radix FFT