• Tidak ada hasil yang ditemukan

Fast Fourier Transforms

Dalam dokumen 4 Systems of Linear Equations 190 (Halaman 90-98)

2.3 Trigonometric Interpolation

2.3.2 Fast Fourier Transforms

whereN = 2M + 1andN = 2M, respectively, satisfy Ψ(xk) =fk, k= 0,1, . . . N−1,

forxk = 2πk/N if and only if the coefficients ofΨ(x)are given by Ah= 2

N

N1 k=0

fkcoshxk= 2 N

N1 k=0

fkcos2πhk N , Bh= 2

N

N1 k=0

fksinhxk = 2 N

N1 k=0

fksin2πhk N .

Proof. Only the expressions for Ah, Bh remain to be verified. For by (2.3.1.4)

Ah=βh+βN−h= 1 N

N1 k=0

fk(e−hixk+e(N−h)ixk),

Bh=i(βh−βN−h) = i N

N1 k=0

fk(e−hixk−e(N−h)ixk),

and the substitutions (2.3.1.3) yield the desired expressions.

Note that if the support ordinatesfkare real, then so are the coefficients Ah,Bh in (2.3.1.12).

ofN2multiplications, putting it out of reach for even high-speed electronic computers for those large values ofN necessary for a sufficiently accurate discrete representation of the above integrals. The discovery [Cooley and Tukey (1965); it is remarkable that similar techniques were already used by Gauss] of a method for rapidly evaluating (on the order of NlogN multiplications) all expressions (2.3.2.1) for large special values of N has therefore opened up vast new areas of applications. This method and its variations are called fast Fourier transforms.For a detailed treatment see Brigham (1974) and Bloomfield (1976).

There are two main approaches, the originalCooley-Tukey method and one described by Gentleman and Sande (1966), commonly called theSande- Tukey method.

Both approaches rely on an integer factorization ofN and decompose the problem accordingly into subproblems of lower degree. These decom- positions are then carried out recursively. This works best when

N = 2n, n >0 integer.

We restrict our presentation to this most important and most straightfor- ward case, although analogous techniques will clearly work for the more genereal caseN =N1N2· · ·Nn,Nm integer.

The Cooley-Tukey approach is best understood in terms of the inter- polation problem described in the previous section 2.3.1. SupposeN = 2M and consider the two interpolating phase polynomialsq(x) andr(x) of order M =N/2 with

q(x2h) =f2h, r(x2h) =f2h+1, h= 0, . . . , M−1.

The phase polynomial q(x) interpolates all support points of even index, whereas the phase polynomial ˆr(x) =r(x−2π/N) =r(x−π/M) interpo- lates all those of odd index. Since

eMixk =e2πiMk/N =eπik=

+1, k even,

1, k odd,

the complete interpolating phase polynomialp(x) is now readily expressed in terms of the two lower-order phase polynomialsq(x) andr(x):

(2.3.2.2) p(x) =q(x)

1 +eMix 2

+r(x−π/M)

1−eMix 2

. This suggests the followingnstep recursive scheme. Form≤n, let

M = 2m−1 and R= 2n−m. Stepmthen consists of determiningR phase polynomials

p(m)r =β(m)r,0 +βr,1(m)eix+· · ·+βr,2M(m) 1e(2M1)ix, r= 0, . . . , R−1,

from 2Rphase polynomialsp(m−1)r (x),r= 0,. . ., 2R−1, using the recursion (2.3.2.2):

2p(m)r (x) =p(m−1)r (x)(1 +eMix) +p(m−1)R+r (x−π/M)(1−eMix).

This relation gives rise to the following recursion between the coefficients of the above phase polynomials:

(2.3.2.3)

2βr,j(m)=βr,j(m−1)+βR+r,j(m−1)εjm 2βr,M+j(m) =βr,j(m−1)+βR+r,j(m−1)εjm





r= 0, . . . , R−1, j= 0, . . . , M−1, where

εm:=e2πi/2m, m= 0, . . . , n.

The recursion is initiated by putting

βk,0(0):=fk, k= 0, . . . , N−1, and terminates with

βj:=β0,j(n), j= 0, . . . , N−1.

This recursion typifies the Cooley-Tukey method.

The Sande-Tukey approach chooses a clever sequence of additions in the sums "N−1

k=0 fke−jixk. Again with M = N/2, we assign to each termfke−jixk an opposite termfk+Me−jixk+M. Summing respective oppo- site terms in (2.3.2.1) producesN sums ofM =N/2 terms each. Splitting those N sums into two sets, one for even indicesj = 2hand one for odd indices j = 2h+ 1, will lead to two problems of evaluating expressions of the form (2.3.2.1), each problem being of reduced degreeM =N/2.

Using the abbreviation

εm=e2πi/2m

again, we can write the expressions (2.3.2.1) in the form N βj =

N−1

k=0

fkεjkn , j= 0,1, . . . , N−1.

Here nis such that N = 2n. Distinguishing between even and odd values ofj and combining opposite terms gives

N β2h=

N−1

k=0

fkε2hkn =

M−1

k=0

(fk+fk+M)εhkn−1=:

M1 k=0

fkεhkn−1

N β2h+1=

N−1

k=0

fkε(2h+1)kn =

M1 k=0

((fk−fk+M)εkn)εhkn−1=:

M1 k=0

fkεhkn−1

forh= 0,. . .,M 1 andM :=N/2, sinceε2n =εn−1,εMn =1. Here fk =fk+fk+M

fk=

fk−fk+M εkn

'

k= 0, . . . , M−1.

In order to iterate this process for m=n,n−1,. . ., 0, we let M :=

2m−1,R:= 2n−mand introduce the notation

fr,k(m), r= 0, . . . , R−1, k= 0, . . . ,2M−1,

withf0,k(n)=fk,k= 0,. . .,N−1.f0,k(n−1)andf1,k(n−1)represent the quantities fk andfk, respectively, which were introduced above. In general we have, withM = 2m−1andR= 2n−m,

(2.3.2.4) N βjR+r=

2M−1

k=0

fr,k(m)εjkm, r= 0,1, . . . , R−1, j= 0,1, . . .2M−1,

with the quantitiesfr,k(m)satisfying the recursions:

(2.3.2.5)

fr,k(m−1)=fr,k(m)+fr,k+M(m) fr+R,k(m−1)= (fr,k(m)−fr,k+M(m) )εkm







m=n, n−1, . . . ,1, r= 0,1, . . . , R−1, k= 0,1, . . . , M−1.

Proof.Suppose (2.3.2.4) is correct for somem≤n, and letM:=M/2 = 2m−2, R := 2R = 2n−m+1. For j = 2h and j = 2h+ 1, respectively, we find by combining opposite terms

N βhR+r=N βjR+r=

M1 k=0

(fr,k(m)+fr,k+M(m) )εjkm =

2M1 k=0

fr,k(m−1)εhkm−1,

N βhR+r+R=N βjR+r=

M1 k=0

(fr,k(m)−fr,k+M(m) )εjkm

=

M1 k=0

(fr,k(m)−fr,k+M(m) )εkmεhkm−1=

2M1 k=0

fr+R,k(m−1)εhkm−1, wherer= 0,. . .,R−1,j= 0, . . ., 2M 1.

The recursion (2.3.2.5) typifies the Sande-Tukey method. It is initiated by

f0,k(n):=fk, k= 0, . . . , N 1, and terminates with

βr:= 1

Nfr,0(0), r= 0,1, . . . , N−1.

Returning to the Cooley-Tukey method for a more detailed algorithmic formulation, we are faced with the problem of arranging the quantitiesβ(m)r,j in a one-dimensional array:

β[κ(m, r, j)] :=˜ βr,j(m), κ= 0, . . . , N−1.

Among suitable maps (m, r, j) κ(m, r, j), the following is the most straightforward:

κ= 2mr+j; m= 0, . . . , n, r= 0, . . . ,2n−m1, j= 0, . . . ,2m1.

It has the advantage, that the final results are automatically in the correct order. However, two arrays ˜β[ ], ˜β[ ] are necessary to accommodate the left- and right-hand sides of the recusion (2.3.2.3). We can make do with only one array ˜β[ ] if we execute the transformations “in place”, that is, if we let each pair of quantitiesβr,j(m),βr,M(m)+j occupy the same positions in β[ ] as the pair of quantities˜ βr,j(m−1), βR+r,j(m−1), from which the former are computed. In this case, however, the entries in the array ˜β[ ] are being permuted, and the maps which assign the positions in ˜β[ ] as a function of integersm, r,j become more complicated. Let

τ =τ(m, r, j)

be a map with the above mentioned replacement properties, namely β[τ(m, r, j)] =˜ βr,j(m)

with (2.3.2.6)

τ(m, r, j) =τ(m−1, r, j)

τ(m, r, j+ 2m−1) =τ(m−1, r+ 2n−m, j) ' 



m= 1, . . . , n,

r= 0, . . . ,2n−m1, j = 0, . . . ,2m−11, and

(2.3.2.7) τ(n,0, j) =j, j= 0, . . . , N−1.

The last condition means that the final resultβj will be found in position j in the array ˜β:βj = ˜β[j].

The conditions (2.3.2.6) and (2.3.2.7) define the mapτ recursively. It remains to determine it explicitly. To this end, let

t=α0+α1·2 +· · ·+αn−1·2n−1, αj ∈ {0,1},

be the binary representation of an integert, 0≤t <2n. Then putting (2.3.2.8) ρ(t) :=αn−1+αn−2·2 +· · ·+α0·2n−1

defines a permutation of the integerst= 0,. . ., 2n1 calledbit reversal.The bit-reversal permutation is symmetric, i.e.ρ(ρ(t)) =t.

In terms of the bit-reversal permutation ρ, we can express τ(m, r, j) explicitly:

(2.3.2.9) τ(m, r, j) =ρ(r) +j,

for allm= 0, 1,. . .,n,r= 0, 1,. . ., 2n−m1,j= 0, 1,. . ., 2m1.

Proof.If again

t=α0+α1·2 +· · ·+αn−1·2n−1, αj ∈ {0,1}, then by (2.3.2.6) and (2.3.2.7)

t=τ(n,0, t) =

τ(n−1,0, t) ifαn−1= 0, τ(n−1,0, t−2n−1) ifαn−1= 1.

Thus

t=τ(n,0, t) =τ(n−1, αn−1, α0+· · ·+αn−2·2n−2), and, more generally,

t=τ(n,0, t) =τ(m, αn−1+· · ·+αm·2n−m−1, α0+· · ·+αm−1·2m−1) for allm=n−1,n−2,. . ., 0. Forr=αn−1+· · ·+αm·2n−m−1, we find

ρ(r) =αm·2m+· · ·+αn−1·2n−1

andt=ρ(r) +j, where j=α0+· · ·+αm−1·2m−1. By the symmetry of bit reversal,

τ(m, ρr), j) = ¯r+j,

where ¯ris a multiple of 2m, 0≤r <¯ 2n, and 0≤j <2m. Observe that if 0≤j <2m−1, then

t=τ(m, ρr), j) =τ(m−1, ρr), j) = ¯r+j,

t¯=τ(m, ρr), j+ 2m−1) =τ(m−1, ρr) + 2n−m, j) = ¯r+j+ 2m−1 mark a pair of positions in ˜β[ ] which contain quantities connected by the Cooley-Tukey recursions (2.3.2.3).

In the following pseudo-algol formulation of the classical Cooley- Tukey method, we assume that the array ˜β[ ] is initialized by putting

β[ρ(k)] :=˜ fk, k= 0, . . . , N−1,

whereρis the bit-reversal permutation (2.3.2.8). This “scrambling” of the initial values can also be carried out “in place”, because the bit-reversal permutation is symmetric and consists, therefore, of a sequence of pairwise interchanges or “transpositions”. In addition, we have deleted the factor 2 which is carried along in the formulas (2.3.2.3), so that finally

βj := 1 N

β[j],˜ j= 0, . . . , N 1.

The algorithm then takes the form form:= 1 step1 until n do

begin for j:= 0 step 1 until 2m−11 do begin e:=εjm;

for ¯r:= 0 step 2m until 2n1 do beginu:= ˜βr+j]; v:= ˜βr+j+ 2m−1]×e;

β˜[¯r+j] :=u+v; ˜βr+j+ 2m−1] :=u−v end

end end ;

If the Sande-Tukey recursions (2.3.2.5) are used, there is again no prob- lem if two arrays of lengthN are available for new and old values, respec- tively. However, if the recursions are to be carried out “in place” in a single array ˜f[ ], then we must again map index triplesm,r,jinto single indices τ. This index map has to satisfy the relations

τ(m−1, r, k) =τ(m, r, k), τ(m−1, r+ 2n−m, k) =τ(m, r, k+ 2m−1)

form=n,n−1,. . ., 1,r= 0, 1,. . ., 2n−m1,k= 0, 1,. . ., 2m−11.

If we assume

τ(n,0, k) =k fork= 0, . . . , N 1,

that is, if we start out with the natural order, then these conditions are precisely the conditions (2.3.2.6) and (2.3.2.7) written in reverse. Thus τ =τ(m, r, k) is identical to the index map τ considered for the Cooley- Tukey method.

In the following pseudo-algolformulation of the Sande-Tukey method, we assume that the array ˜f[ ] has been initialized directly with the values fk:

f˜[k] :=fk, k= 0,1, . . . , N−1.

However, the final results have to be “unscrambled” using bit reversal, βj:= 1

N

f˜[ρ(j)], j= 0, . . . , N−1 :

form:=n step 1 until 1 do

begin for k:= 0 step1 until 2m−11 do begin e:=εkm;

for ¯r:= 0 step 2m until 2n1 do begin

u:= ˜fr+k]; v:= ˜fr+k+ 2m−1];

f˜[¯r+k] :=u+v; ˜fr+k+ 2m−1] := (u−v)×e end

end end ;

If all valuesfk, k= 0,. . .,N−1, are real andN = 2M is even, then the problem of evaluating the expressions (2.3.2.1) can be reduced in size by putting

gh:=f2h+i f2h+1, h= 0,1, . . . , M−1, and evaluating the expressions

γj := 1 M

M−1

h=0

ghe2πijh/M, j= 0,1, . . . , M−1.

The desired valuesβj,j = 0,. . .,N−1, can be expressed in terms of the valuesγj,j= 0,. . .,M 1. Indeed, one has withγM :=γ0

(2.3.2.10) βj= 1

4(γj+ ¯γM−j) + 1

4i(γj−γ¯M−j)e2πij/N, j= 0,1, . . . , M βN−j= ¯βj, j= 1,2, . . . , M−1.

Proof.It is readily verified that 1

4(γj+ ¯γM−j) = 1 N

M−1

h=0

f2he2πij2h/N, 1

4i(γj−γ¯M−j) = 1 N

M−1

h=0

f2h+1e2πij(2h+1)/N+2πij/N.

In many cases, particularly if all values fk are real, one is actually interested in the expressions

Aj:= 2 N

N−1

k=0

fkcos2πjk

N , Bj:= 2 N

N1 k=0

fksin2πjk N

forj= 0, 1,. . .,M, which occur, for instance, in Theorem (2.3.1.12). The valuesAj,Bj are connected with the corresponding values forβj via the relations (2.3.1.4).

Dalam dokumen 4 Systems of Linear Equations 190 (Halaman 90-98)