24.12  The Fast Fourier Transform

Chapter 12 §09 built one unitary matrix, F, that diagonalizes every circulant of its size, and then counted the cost of using it. Forming Fb as a matrix–vector product takes about n2 multiplications, so the elegant three-step recipe “transform, divide, transform back” for a circulant system costs O(n2) — better than elimination, but not dramatically so. The section closed by naming the way out: the powers of ω repeat, splitting one transform of length n into two of length n/2 costs almost nothing, and iterating “brings the cost down to about nlog⁡n”. That algorithm is the fast Fourier transform, and Chapter 12 handed it here, “together with the cost accounting that makes ‘quickly’ precise”.

This section pays that debt. There is no new theorem about F here; there is one matrix identity, proved by computing an entry, and one recurrence, solved exactly.

Throughout, as in Chapter 12 §09, rows, columns, and vector entries are numbered 0,1,…,n−1, and ωn:=e2πi/n. We write Fn for the Fourier matrix of size n of Theorem 12.9.3, so (Fn)jk=ωnjk/n; Chapter 12 wrote it F, the size being fixed there.

24.12.1. Counting the cost of a transform

Chapter 12 §09 defined the discrete Fourier transform of c∈Cn to be c^=nFnc, the vector of eigenvalues pc(ωnj) of the circulant with first row c. It is the unnormalized transform that the algorithm computes, so it is convenient to give its matrix a name of its own.

Definition 24.12.1 (The transform matrix)

For n≥1 let Wn:=nFn∈Mn(C),(Wn)jk=ωnjk(0≤j,k≤n−1), so that c^=Wnc for every c∈Cn.

A cost in this section is a count of arithmetic operations, where one complex addition, one complex subtraction, one complex multiplication, and one complex division each count as one operation; a multiplication by the constant 1 is free, because it is not performed. What is being counted is the work of applying Wn to an arbitrary vector, not the work of writing Wn down.

Applying Wn as a plain matrix–vector product costs n2 multiplications+n(n−1) additions=2n2−n operations: each of the n entries of Wnc is a sum of n products. This figure charges every one of those products, including the 2n−1 whose factor is an entry ωn0=1 of row 0 or column 0; it is the plain matrix–vector product as it is ordinarily performed, and the comparisons below use it as it stands. For n=1024 that is 2096128 operations. The whole of this section is about replacing that number by about 15000.

24.12.2. Splitting a transform in two

Where can a saving possibly come from? The entries of Wn are powers of ωn, and there are only n distinct ones, so the n2 products ωnjkck involve enormous repetition. The single algebraic fact that organizes the repetition is ωn2=e4πi/n=e2πi/m=ωm,where n=2m. Squaring a primitive n-th root of unity gives a primitive m-th root of unity. So if we separate the even-numbered entries of c from the odd-numbered ones, the even half is transformed by Wm, not by anything new. Two objects give the bookkeeping a name.

Definition 24.12.2 (The even-odd permutation, the twiddle matrix, and the butterfly)

Let n=2m with m≥1.

  • (a) The even-odd permutation matrix Pn∈Mn(C) is the permutation matrix determined by (Pnx)t=x2t,(Pnx)m+t=x2t+1(0≤t≤m−1); it lists the even-numbered entries of x first, then the odd-numbered ones, each in their original order.
  • (b) The twiddle matrix is Dm:=diag(1,ωn,ωn2,…,ωnm−1)∈Mm(C). Its entries are powers of ωn, not of ωm.
  • (c) The butterfly matrix is Bn:=(ImDmIm−Dm)∈Mn(C).

In words: Pn is pure data movement and does no arithmetic; Dm supplies the m twiddles that the odd half needs because it starts one place late; and Bn forms the m sums and the m differences that recombine the two halves. Applied to a vector (u,v) split into two halves of length m, the butterfly returns (u+Dmv, u−Dmv).

Theorem 24.12.1 (The Radix-Two Factorization)

Let n=2m with m≥1. Then Wn=Bn(WmOOWm)Pn. Equivalently, for the unitary Fourier matrices, Fn=12Bn(FmOOFm)Pn.

Idea. Apply both sides to an arbitrary x and compute entry j of the left side. Split the defining sum ∑kωnjkxk into its even k=2t and odd k=2t+1 parts; the relation ωn2=ωm turns each part into a transform of length m, and the odd part carries one spare factor ωnj. That is the whole computation, and it already gives the top half of the answer. For the bottom half, write j=m+i; the relation ωmm=1 makes the two transforms of length m repeat what they gave at i, while ωnm=−1 flips the sign of the spare factor. Sum and difference: the butterfly.

Proof. Let x∈Cn and put u:=Wm(x0,x2,…,xn−2),v:=Wm(x1,x3,…,xn−1), so that ui=∑t=0m−1ωmitx2t and vi=∑t=0m−1ωmitx2t+1 for 0≤i≤m−1, by Definition 24.12.1. By Definition 24.12.2 (a), Pnx is exactly the pair of these two argument vectors stacked, so the right-hand side applied to x is Bn(u,v)=(u+Dmv, u−Dmv).

Now compute entry j of Wnx. Splitting the index k into k=2t and k=2t+1 with 0≤t≤m−1, and using ωn2=ωm, (Wnx)j=∑k=0n−1ωnjkxk=∑t=0m−1ωn2jtx2t+∑t=0m−1ωnj(2t+1)x2t+1=∑t=0m−1ωmjtx2t+ωnj∑t=0m−1ωmjtx2t+1.

Top half. For 0≤j≤m−1 the two sums are uj and vj, so (Wnx)j=uj+ωnjvj=(u+Dmv)j, the last equality by Definition 24.12.2 (b), the j-th diagonal entry of Dm being ωnj.

Bottom half. For j=m+i with 0≤i≤m−1, we have ωmjt=ωmmtωmit=ωmit, since ωmm=1; so both sums repeat their values at i, namely ui and vi. The spare factor is ωnm+i=ωnmωni=eπiωni=−ωni, because ωnm=e2πim/n=eπi=−1. Hence (Wnx)m+i=ui−ωnivi=(u−Dmv)i.

The two halves together say that Wnx equals the right-hand side applied to x, for every x∈Cn; so the two matrices are equal. For the second display, substitute Wn=nFn and Wm=mFm and divide by n, using m/n=1/2.

The identity is a factorization of one matrix into three, and each of the three is cheap for a different reason: Pn does no arithmetic, the middle factor is two copies of a smaller instance of the same problem, and Bn costs O(n). That is the entire content of the fast Fourier transform. Everything below is bookkeeping.

Quick check. Write out Theorem 24.12.1 for n=2 and check it directly.

Solution. Here m=1, so P2=I2 (it lists x0 then x1), W1=(1), and D1=(ω20)=(1). Hence B2=(111−1), and the right-hand side is B2I2I2=B2. And (W2)jk=ω2jk=(−1)jk, which is the same matrix.

Example (The factorization for n=4)

Write out Theorem 24.12.1 for n=4, and check it against the matrix F of Example (The Fourier matrix of size four).

Solution. Here m=2 and ω4=i, so D2=diag(1,i) and B4=(1010010i10−10010−i),P4=(1000001001000001),W2=(111−1). Multiplying, (W2OOW2)P4 has rows (1,0,1,0), (1,0,−1,0), (0,1,0,1), (0,1,0,−1). Applying B4 adds row 3 to row 1, adds i times row 4 to row 2, and so on, giving B4(W2OOW2)P4=(11111i−1−i1−11−11−i−1i)=W4, whose (j,k)-entry is ijk. Dividing by 4=2 returns the matrix F=12W4 written out in Example (The Fourier matrix of size four).

Warning. The twiddles are powers of ωn, not of ωm. If D2 in Example (The factorization for n=4) is taken to be diag(1,ω2)=diag(1,−1), the product becomes the real matrix with rows (1,1,1,1), (1,−1,−1,1), (1,−1,1,−1), (1,1,−1,−1), whereas the second row of W4 is (1,i,−1,−i). The single factor ωnj in the proof is what remembers that the odd-numbered entries start one step later, and it is the only place where the transform of size n differs from two transforms of size m.

24.12.3. The cost, exactly

Read Theorem 24.12.1 from right to left as a procedure.

Algorithm. Input. x∈Cn, with n=2p a power of two.

Output. Wnx.

  1. If n=1, return x.
  2. Split x into its even-numbered and odd-numbered entries (no arithmetic).
  3. Compute u and v, the transforms of the two halves, by applying this procedure to each of them.
  4. Multiply: set v0′:=v0, and vi′:=ωnivi for 1≤i≤m−1, where m=n/2.
  5. Return (u+v′, u−v′).

The procedure returns Wnx for every n=2p, by induction on p: for p=0 step 1 returns x=W1x, and for n=2m the inductive hypothesis makes the u and v of step 3 the two transforms of length m named in the proof of Theorem 24.12.1, so steps 4 and 5 return (u+Dmv, u−Dmv), which that proof identifies with Wnx. What is left is the cost.

Theorem 24.12.2 (The Cost of the Fast Fourier Transform)

Let C(n) be the number of operations the procedure above performs on an input of length n=2p, with p≥0. Then C(1)=0, C(2m)=2C(m)+3m−1(m≥1), and the solution of this recurrence is exactly C(2p)=32p2p−2p+1,that isC(n)=32nlog2⁡n−n+1. In particular C(n)=O(nlog⁡n).

Idea. Step 3 is where the recursion sits and contributes 2C(m); steps 4 and 5 are the only arithmetic outside it, and both are linear in n. Count them once, carefully: step 4 is m−1 multiplications, the factor ωn0=1 at i=0 not being applied at all, and step 5 is m additions and m subtractions. Then solve the recurrence by induction on p, which works because the recursion halves the length exactly.

Proof. For n=1 the procedure returns its input and does nothing, so C(1)=0.

Let n=2m with m≥1. Step 2 only moves data. Step 3 calls the procedure twice on length m, costing 2C(m). Step 4 copies v0, which is no arithmetic, and forms ωnivi for i=1,…,m−1, which is m−1 multiplications. Step 5 forms m sums and m differences, which is 2m operations. Adding, C(2m)=2C(m)+(m−1)+2m=2C(m)+3m−1.

Now induct on p. For p=0, the formula gives 32⋅0⋅1−1+1=0=C(1). Let p≥1 and suppose C(2p−1)=32(p−1)2p−1−2p−1+1. Taking m=2p−1 in the recurrence, C(2p)=2(32(p−1)2p−1−2p−1+1)+3⋅2p−1−1=32(p−1)2p−2p+2+32⋅2p−1=32p2p−2p+1, where the last line collects 32(p−1)2p+322p=32p2p. This completes the induction. Substituting n=2p, so p=log2⁡n, gives the stated formula, and 32nlog2⁡n−n+1≤32nlog2⁡n for n≥1, so C(n)=O(nlog⁡n).

The exact formula is worth tabulating against the 2n2−n of a plain matrix–vector product.

n C(n) 2n2−n
2 2 6
8 29 120
32 209 2016
1024 14337 2096128

At n=1024 the ratio is about 146, and it grows without bound, because (2n2−n)/C(n) behaves like 43n/log2⁡n. This is the sense in which the transform can be applied “quickly”: the exponent drops from 2 to 1, up to a logarithm, and the constant 32 in front is small.

Warning. The recursion needs n even at every level, so n=2p is the clean case. For n odd and greater than 1 the factorization of Theorem 24.12.1 does not apply at all, and the procedure above cannot start. For n=2aq with q odd, it descends a levels and then must transform vectors of length q some other way; if q is large, nothing has been gained. The remedy is either to split by other factors of n, as in Exercise (C1: Splitting into three), or, for the convolution use below, to pad with zeros up to the next power of two — which at most doubles n and so changes the cost by a bounded factor.

Example (A transform of length eight)

Compute W8c for c=(1,2,3,4,1,2,3,4) by the procedure, showing every level, and check the result against the direct definition at one entry.

Solution. Level 1. The even-numbered entries are (1,3,1,3) and the odd-numbered ones are (2,4,2,4).

Level 2, applied to (1,3,1,3). Its even and odd halves are (1,1) and (3,3), whose transforms are W2(1,1)=(2,0) and W2(3,3)=(6,0). Here n=4, so D2=diag(1,i) and D2(6,0)=(6,0). The butterfly gives (2+6, 0+0, 2−6, 0−0)=(8,0,−4,0). So u=(8,0,−4,0).

Level 2, applied to (2,4,2,4). Its even and odd halves are (2,2) and (4,4), whose transforms are W2(2,2)=(4,0) and W2(4,4)=(8,0). Again n=4 and D2(8,0)=(8,0), so the butterfly gives (4+8, 0, 4−8, 0). So v=(12,0,−4,0).

Level 1, recombination. Now n=8 and D4=diag(1,ω8,i,ω83) with ω8=eπi/4, so D4v=(12, 0, −4i, 0), the irrational entries of D4 never appearing because v1=v3=0. The butterfly gives W8c=(20, 0, −4−4i, 0, −4, 0, −4+4i, 0).

Check at j=2. By Definition 24.12.1, (W8c)2=∑kω82kck=∑kikck since ω82=i. This is 1+2i−3−4i+1+2i−3−4i=−4−4i, matching. The zeros in the odd positions are not an accident. Since c repeats with period 4, that is ck+4=ck, splitting the defining sum at k=4 gives (W8c)j=∑k=03ck(ω8jk+ω8j(k+4))=(1+(−1)j)∑k=03ω8jkck, using ω84j=(eπi)j=(−1)j. The factor 1+(−1)j is 0 at every odd j.

24.12.4. What the speed buys

Two corollaries, both immediate now, and both paying off Chapter 12 §09.

Chapter 12 §09 proved the Convolution Theorem: c∗d^=c^⊙d^ entrywise (Theorem 12.9.6 (b)). Before this section that identity converted an O(n2) convolution into three O(n2) transforms, which is no gain at all. With Theorem 24.12.2 it becomes a genuine algorithm.

Corollary 24.12.3 (Convolution in O(nlog⁡n))

Let n=2p. The cyclic convolution c∗d of two vectors in Cn can be computed in 3C(n)+2n=92nlog2⁡n−n+3 operations, where C is as in Theorem 24.12.2. Consequently, the product of two polynomials in C[x] of degree at most d can be computed in O(dlog⁡d) operations.

Proof. The inverse transform costs the same. By Theorem 12.9.3, Fn−1=Fn∗, and Fn is symmetric because (Fn)jk=ωnjk/n is unchanged by swapping j and k; hence Fn∗=Fn― and Wn−1=1nFn−1=1nFn―=1nWn―. Conjugating the identity of Theorem 24.12.1 entry by entry, and noting that Pn is real, gives Wn―=Bn―(Wm―OOWm―)Pn, which is the same factorization with every ωn replaced by ωn―=ωn−1. The procedure therefore runs verbatim with ωn−1 in place of ωn and computes Wn―y in C(n) operations.

The algorithm. By Theorem 12.9.6 (b) and the definition c^=Wnc, Wn(c∗d)=(Wnc)⊙(Wnd),soc∗d=1nWn―((Wnc)⊙(Wnd)). Computing Wnc and Wnd costs 2C(n); the n entrywise products cost n; the inverse transform costs C(n); the n divisions by n cost n. The total is 3C(n)+2n, and substituting the formula of Theorem 24.12.2 gives 92nlog2⁡n−3n+3+2n, as stated.

Polynomials. Let p=∑l=0dplxl and q=∑l=0dqlxl, and choose n=2P with n≥2d+1 and n<4d+2, which is possible since the powers of two are spaced by a factor of two. Let c,d∈Cn be the coefficient vectors padded with zeros. The coefficient of xr in pq, for 0≤r≤2d, is ∑lcldr−l summed over 0≤l≤r, while (c∗d)r=∑l=0n−1cldr−l with the subscript read modulo n. The two agree: a term of the second sum with l>r has d-subscript r−l+n, and it can be nonzero only if l≤d and r−l+n≤d, which forces n≤d+l−r≤2d, contradicting n≥2d+1. So the coefficients of pq are the first 2d+1 entries of c∗d, computable in 3C(n)+2n operations with n<4d+2, which is O(dlog⁡d).

Warning. Convolution wraps around; polynomial multiplication does not. Padding to length n≥2d+1 is not a convenience, it is the hypothesis. Take p=q=1+x, so d=1, and convolve the unpadded vectors c=d=(1,1) in C2: the answer is (c0d0+c1d1, c0d1+c1d0)=(2,2), the coefficient vector of 2+2x, whereas (1+x)2=1+2x+x2. The x2 term has wrapped around onto the constant term, because in Cn the exponents are read modulo n and x2≡1. Padding to c=d=(1,1,0,0) in C4 gives (1,2,1,0), which is right.

Corollary 24.12.4 (Solving a Circulant System in O(nlog⁡n))

Let n=2p, let C∈Mn(C) be an invertible circulant with first row c, and let b∈Cn. Then the solution of Cx=b can be computed in 3C(n)+2n operations.

Proof. By Theorem 12.9.4, C=FnΛFn∗ with Λ=diag(pc(1),…,pc(ωnn−1)), and the diagonal of Λ is exactly c^=Wnc; the letter D is reserved here for the twiddle matrix of Definition 24.12.2. Since C is invertible, every c^j≠0 by Corollary 12.9.5 (d), so Λ−1 exists and x=C−1b=FnΛ−1Fn∗b=1nWn((Wn―b)⊘c^), where ⊘ is entrywise division and the last equality uses Fn=n−1/2Wn and Fn∗=n−1/2Wn―, as in the proof of Corollary 24.12.3. The three transforms cost C(n) each, by Theorem 24.12.2 and the first part of that proof; the n divisions and the n final scalings by 1/n cost 2n. Sanity check at C=In: then c=e0, c^=(1,…,1), and the formula returns 1nWnWn―b=1n(nIn)b=b, using WnWn―=nFnFn∗=nIn.

Remark. None of this is a new theorem about the discrete Fourier transform. The matrix Fn, the factorization C=FnΛFn∗ of Theorem 12.9.4, and the Convolution Theorem (Theorem 12.9.6) are exactly as Chapter 12 left them; Theorem 24.12.1 is an identity between matrices all of which were already known, and Theorem 24.12.2 counts operations. The transform is a change of basis, and the fast Fourier transform is a way of applying that change of basis in O(nlog⁡n) operations instead of O(n2). What changes is not what can be computed but what can be computed at the sizes that occur.

24.12.5. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Write down the matrix Wn, and say how it is related to the Fourier matrix Fn of Chapter 12.
  • (b) State Theorem 24.12.1, and say what each of the three factors on the right costs to apply.
  • (c) How many operations does Wnx cost as a plain matrix–vector product, and how many by the fast algorithm when n=2p?
  • (d) True or false: the fast Fourier transform computes a different transform from the one in Chapter 12, which is why it is faster. Justify your answer.
  • (e) Why does the algorithm require n to be a power of two, and what is done when it is not?

Solution.

  • (a) Wn=nFn, with (Wn)jk=ωnjk for 0≤j,k≤n−1 and ωn=e2πi/n (Definition 24.12.1). It is the matrix of the discrete Fourier transform c↦c^ of Chapter 12 §09.

  • (b) Wn=Bn(WmOOWm)Pn for n=2m. Applying Pn costs nothing, since it only moves entries; the middle factor costs two transforms of length m; and Bn costs m−1 multiplications and 2m additions and subtractions.

  • (c) Directly: n2 multiplications and n(n−1) additions, that is 2n2−n. By the algorithm: C(n)=32nlog2⁡n−n+1 (Theorem 24.12.2).

  • (d) False. Theorem 24.12.1 is an identity between matrices, so the algorithm returns Wnx exactly, in exact arithmetic. It is faster because it applies the same matrix by a cheaper route, not because it computes something else.

  • (e) The factorization needs n=2m, and the recursion needs that at every level, so it needs n=2p. For other n one either pads with zeros to the next power of two, which is legitimate for convolution provided the padded length still exceeds the degree of the product (see the warning after Corollary 24.12.3), or splits by a different factor of n, as in Exercise (C1: Splitting into three).

B. Practice

Exercise (B1: A transform of length four)

Let c=(1,1,−1,−1)∈C4.

  • (a) Compute W4c by the procedure of this section, showing the two halves and the twiddles.
  • (b) Check the answer by evaluating the symbol pc at the fourth roots of unity.
  • (c) Count the operations your computation in (a) used, and compare with C(4).

Solution.

  • (a) The even-numbered entries are (1,−1) and the odd-numbered ones are (1,−1). Both transform to W2(1,−1)=(1−1, 1+1)=(0,2), so u=v=(0,2). With n=4, D2=diag(1,i), so D2v=(0,2i). The butterfly gives W4c=(0+0, 2+2i, 0−0, 2−2i)=(0, 2+2i, 0, 2−2i).

  • (b) The symbol is pc(x)=1+x−x2−x3 (Definition 12.9.1), and c^j=pc(ij). Then pc(1)=1+1−1−1=0; pc(i)=1+i+1+i=2+2i, using −i2=1 and −i3=i; pc(−1)=1−1−1+1=0; and pc(−i)=1−i+1−i=2−2i. The four values agree with (a).

  • (c) Each W2 costs 2 operations (one sum, one difference), so the two halves cost 4; the twiddles cost 1, since the factor 1 is free and only i⋅2 is a multiplication; the final butterfly costs 4. The total is 9, and C(4)=32⋅4⋅2−4+1=9. A direct matrix–vector product would cost 2⋅16−4=28.

Exercise (B2: A transform of length eight)

Let c=(2,1,0,3,2,1,0,3)∈C8. Compute W8c by the procedure, showing both levels, and verify entry j=2 directly from Definition 24.12.1.

Solution. Level 1. Even-numbered entries (2,0,2,0); odd-numbered entries (1,3,1,3).

Level 2 on (2,0,2,0). Halves (2,2) and (0,0), with transforms (4,0) and (0,0). Here the inner n is 4, so D2=diag(1,i) and D2(0,0)=(0,0). The butterfly gives u=(4,0,4,0).

Level 2 on (1,3,1,3). Halves (1,1) and (3,3), with transforms (2,0) and (6,0); D2(6,0)=(6,0); the butterfly gives v=(8,0,−4,0).

Level 1, recombination. Now n=8 and D4=diag(1,ω8,i,ω83), so D4v=(8,0,−4i,0). Hence W8c=(4+8, 0, 4−4i, 0, 4−8, 0, 4+4i, 0)=(12,0,4−4i,0,−4,0,4+4i,0).

Check at j=2. Since ω82=i, Definition 24.12.1 gives (W8c)2=∑kikck=2+i+0−3i+2+i+0−3i=4−4i, as computed.

Exercise (B3: A product of polynomials by convolution)

Let p=1+2x+3x2 and q=2+x in C[x].

  • (a) What is the smallest power of two n for which the recipe in the proof of Corollary 24.12.3 is valid? Write down the padded coefficient vectors c and d.
  • (b) Compute c∗d directly from the definition of cyclic convolution, and read off pq.
  • (c) Show that using n=3 instead would give the wrong answer, and identify which coefficient wraps onto which.

Solution.

  • (a) The product pq has degree 3, so 4 coefficients are needed and any n≥4 works; the smallest power of two is n=4. The padded vectors are c=(1,2,3,0) and d=(2,1,0,0).

  • (b) With subscripts modulo 4 and d0=2, d1=1, d2=d3=0, the sum (c∗d)r=∑lcldr−l keeps only l=r and l=r−1, so (c∗d)r=2cr+cr−1: c∗d=(2+0, 4+1, 6+2, 0+3)=(2,5,8,3). Hence pq=2+5x+8x2+3x3, which one checks by expanding: (1+2x+3x2)(2+x)=2+x+4x+2x2+6x2+3x3.

  • (c) Length 3 holds p and q but not the four coefficients of pq, and although 3 is not a power of two it shows the wrap plainly: with c=(1,2,3), d=(2,1,0), and subscripts modulo 3, c∗d=(2+3, 4+1, 6+2)=(5,5,8), which is pq with the coefficient 3 of x3 added onto the constant term, since x3≡1 modulo x3−1. The requirement n≥2d+1 in Corollary 24.12.3 is exactly what rules this out.

C. Going deeper

Exercise (C1: Splitting into three)

Let n=3m with m≥1, let ωn=e2πi/n, and for s=0,1,2 let u(s):=Wm(xs, x3+s, …, x3(m−1)+s)∈Cm.

  • (a) Prove that for 0≤q≤2 and 0≤i≤m−1, (Wnx)qm+i=∑s=02ω3qsωnisui(s), where ω3=e2πi/3.
  • (b) Deduce a recursive procedure for n=3p, and show that its cost C3 satisfies C3(3m)≤3C3(m)+12m and hence C3(3p)≤4p3p=4nlog3⁡n.

Hint for (a): imitate the proof of Theorem 24.12.1, splitting the index k by its remainder modulo 3 and using ωn3=ωm and ωnm=ω3.

Solution.

  • (a) Write k=3t+s with 0≤s≤2 and 0≤t≤m−1, which lists each k∈{0,…,n−1} exactly once. Then, using ωn3=e6πi/n=e2πi/m=ωm, (Wnx)j=∑s=02∑t=0m−1ωnj(3t+s)x3t+s=∑s=02ωnjs∑t=0m−1ωmjtx3t+s. Put j=qm+i. Since ωmm=1, we get ωmjt=ωmit, so the inner sum is ui(s) by Definition 24.12.1. And ωnm=e2πim/n=e2πi/3=ω3, so ωnjs=ωn(qm+i)s=(ωnm)qsωnis=ω3qsωnis. Substituting gives the stated formula.

  • (b) The procedure is: split x by the remainder of the index modulo 3 (no arithmetic); transform the three parts recursively, getting u(0),u(1),u(2); multiply ui(s) by ωnis for s=1,2 and all i; and for each i apply W3 to the resulting triple, placing the three outputs at positions i, m+i, and 2m+i. Correctness is (a).

Cost. The recursive calls cost 3C3(m). The twiddles are 2m multiplications, the factors for s=0 being 1. Each three-point transform (a,b,c)↦(a+b+c, a+ω3b+ω32c, a+ω32b+ω3c) costs at most 4 multiplications and 6 additions, that is 10 operations, and there are m of them. Hence C3(3m)≤3C3(m)+2m+10m=3C3(m)+12m.

Now put Dp=C3(3p)/3p. The inequality with m=3p−1 reads 3pDp≤3⋅3p−1Dp−1+12⋅3p−1, that is Dp≤Dp−1+4. Since D0=C3(1)=0, induction gives Dp≤4p, so C3(3p)≤4p3p. With n=3p, that is 4nlog3⁡n=O(nlog⁡n).

Exercise (C2: The fourth power of the transform)

Let n≥1 and let Rn∈Mn(C) be the permutation matrix with (Rn)jl=1 when j+l≡0(modn) and 0 otherwise, so that (Rnx)j=xn−j with the subscript read modulo n.

  • (a) Prove that Wn2=nRn.
  • (b) Deduce that Wn4=n2In and Fn4=In, and that every eigenvalue of Fn lies in {1,i,−1,−i}.
  • (c) Deduce a second proof that Wn−1=1nWn―.

Solution.

  • (a) By Definition 24.12.1 and the definition of the matrix product, (Wn2)jl=∑k=0n−1ωnjkωnkl=∑k=0n−1(ωnj+l)k. Put z=ωnj+l, so zn=1. If n divides j+l, then z=1 and the sum is n. Otherwise z≠1 by Example (Roots of Unity), and the geometric-series identity (z−1)(1+z+⋯+zn−1)=zn−1=0 used in the proof of Theorem 12.9.3 gives ∑kzk=0, since z−1≠0. So (Wn2)jl=n exactly when j+l≡0(modn) and 0 otherwise, which is nRn.

  • (b) The map j↦−j modulo n is its own inverse, so Rn2=In and Wn4=(nRn)2=n2In. Since Wn=nFn, we get n2Fn4=n2In, so Fn4=In. Hence x4−1 annihilates Fn; if Fnv=λv with v≠0, then v=Fn4v=λ4v, so λ4=1 and λ∈{1,i,−1,−i} by Example (Roots of Unity).

  • (c) From (a), Wn⋅1nWnRn=RnRn=In, so Wn−1=1nWnRn. Its (j,l)-entry is 1n times entry (j,n−l) of Wn, namely 1nωnj(n−l)=1nωn−jl=1nωnjl―, using ωnn=1 and |ωn|=1. That is the (j,l)-entry of 1nWn―.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.