ELEG 5: Digital Signal Processing Lecture 6: The Fast Fourier Transform; Radix Decimatation in Time Kenneth E. Barner Department of Electrical and Computer Engineering University of Delaware Fall 8 K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4 Outline Review of Previous Lecture Lecture Objectives Efficient Computation of the DFT: FFT Algorithms Direct Computation of the DFT Radix FFT (Decimatation in Time) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4
Review of Previous Lecture Review of Previous Lecture Convolution Equivalence If x(n) and h(n) have durations L and M, then for N L + M y(n) = x(n) h(n) = x(n) N h(n) F y(n) X(ω)H(ω) y(n) DFT N X(k)H(k) Filtering of long sequences Compute DFT of impulse response once; Break input into data blocks; Use overlap save or overlap add method DFT Based Frequency Analysis If L samples of a continuous signal sampled at F s = /T are taken, the DFT frequency resolution is /LT Windowing DFT frequency analysis is affected by the frequency leakage (window sidelobe) resolution (main lobe) tradeoff K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4 Lecture Objectives Lecture Objectives Objective Analyze the computational cost for direct DFT calculation; Derive the radix decimation in time Fast Fourier Transform (FFT) algorithm; Analyze the FFT computational cost Reading Chapters 8 (8.); Next lecture, the radix 4 and decimation in frequency FFT (Chapter 8.) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 4 / 4
Efficient Computation of the DFT: FFT Algorithms Direct Computation of the DFT Direct DFT calculation: X R (k) = N n= N X I (k) = n= Direct Computation of the DFT [ x R (n) cos πkn N + x I(n) sin πkn ] N [ x R (n) sin πkn N x I(n) cos πkn ] N Observations: For each k the above requires: N evaluations of trigonometric functions 4N real multiplication 4(N) real additions The total computational load is N times this O(N ) complexity Objective: Develop a more computationally efficient DFT implementation K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 5 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Objective: Exploit regular patterns that occur in the N point DFT Suppose N = r ν, then x(n) can be decimated in time by a factor of r, where r is is referred to as the radix of the FFT algorithm Most common case: r =. Assume N = ν and decimate x(n) by, [even samples] f (n) = x(n) [odd samples] f (n) = x(n + ) n =,,..., N Also note that: WN π = e j N = e j π N/ = W N Approach: Break X(k) expression into even/odd sample summations, then simplify & relate to F (k) and F (k) X(k) = N x(n)wn kn n= = n even x(n)wn kn + x(n)wn kn n odd K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 6 / 4
Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) X(k) = = n even (N/) m= x(n)wn kn + x(n)wn kn n odd (N/) x(m)wn mk + m= x(m + )W k(m+) N (N/) (N/) = f (m)wn/ km N k f (m)wn/ km m= m= = F (k) + WN k F (k), k =,,..., N Note: f (m) and f (m) are length N/ sequences; F (k) and F (k) are their N/-point DFTs, which have period N/, i.e., ( F k + N ) = F (k) ( F k + N ) = F (k) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 7 / 4 Efficient Computation of the DFT: FFT Algorithms Also, W k+n/ N = W N/ N W N k Radix FFT (Decimatation in Time) πn/ = e j N WN k = W N k. Thus X(k) = F (k) + W k N F (k) X(k + N/) = F (k + N/) + W k+n/ N F (k + N/) = F (k) WN k F (k) Summary X(k) = F (k) + W k N F (k), k =,,..., N X(k + N/) = F (k) W k N F (k), k =,,..., N Observations: F (k) and F (k) are N/-point DFTs (N/) multiplications; N/ multiplications required for W k N F (k) total multiplications = (N/) + N/ = N / + N/ Result: For N large, multiplications have been reduced, from direct computation, by a factor of (N N /) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 8 / 4
Efficient Computation of the DFT: FFT Algorithms Basic computations: Radix FFT (Decimatation in Time) X(k) = F (k) + W k N F (k), k =,,..., N X(k + N/) = F (k) W k N F (k), k =,,..., N The basic computations are represented in a butterfly graph F(k) X(k) F(k) WN k X(k+N/) Example: Suppose N =, then WN k πk = e j = ( ) k ; note k =,,..., N k = and W N k = ( )k = F() F() X() K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 9 / 4 Efficient Computation of the DFT: FFT Algorithms Example: Suppose N = 4, then W k N F() F() Radix FFT (Decimatation in Time) = e j πk 4 = ( j) k k = Butterfly F() F() X() X() k = Butterfly F() F() F() F() -j -j After Reordering X() X() X() X() F() F() X() F() X() F() -j X() K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4
Efficient Computation of the DFT: FFT Algorithms Example: For N = 8 F() Radix FFT (Decimatation in Time) F() X() F() X() F() X() F() W 8 X(4) F() W 8 X(5) F() W 8 X(6) F() W 8 X(7) Observation: Note input/output sample ordering and weighting pattern, which hold for all N K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Approach: Continue decimation to further reduce computations Recall f (n) and f (n) have length N/ = ν ; decimate f (n) and decimate f (n) ν (n) =f (n) n =,,..., N 4 ν (n) =f (n + ) n =,,..., N 4 ν (n) =f (n) n =,,..., N 4 ν (n) =f (n + ) n =,,..., N 4 Observation: We can repeat process used to determine X(k) as a function of F (k) and F (k) Get F (k) in terms of V (k) and V (k) Get F (k) in terms of V (k) and V (k) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4
Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) A repetition of the process yields F (k) = V (k) + WN/ k V (k) k =,,..., N 4 ( F k + N ) = V (k) W k 4 N/ V (k) k =,,..., N 4 F (k) = V (k) + WN/ k V (k) k =,,..., N 4 ( F k + N ) = V (k) W k 4 N/ V (k) k =,,..., N 4 where V ij (k) is the N/4 point DFT of ν ij (n); i, j {, } Observation: For N = ν, there are N/ butterflies per stage and log N decimation stages (N/) log N total complex multiplications and N log N complex additions Result: The FFT algorithm has complexity O(N log N) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Computation Comparison ν N N N log (N) Imprv. Fac. 4 6 4 4. 4 6 56 8. 6 64 4,96 9. 8 56 65,56,4 64.,4,48,576 5, 4.8 Note: In addition to computational savings, the butterfly structure allows computations to be done in place After (a, b) (A, B), inputs no longer needed; store outputs in input memory space efficient memory management K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 4 / 4
Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Note: Input data order depends on the number of decimation stages Example: Suppose N = 8 Input Data Data Decimation Data Decimation x() f () = x() ν () = x() x() f () = x() ν () = x(4) x() f () = x(4) ν () = x() x() f () = x(6) ν () = x(6) x(4) f () = x() ν () = x() x(5) f () = x() ν () = x(5) x(6) f () = x(5) ν () = x() x(7) f () = x(7) ν () = x(7) Result: The data ordering of the last decimation is the order data is fed into the decimation in time FFT algorithm K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 5 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Block representation of 8 point decimation in time FFT Observations: The decimation in time algorithm yields natural order output (DFT) terms, but utilizes shuffled, decimation order, input (time domain) samples K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 6 / 4
Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Note: Reordering is simply bit reversal of the memory address K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 7 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) 8 point decimation in time FFT butterfly signal flow diagram Note: Stage ( samples): W 8 = W Stage (4 samples): W8 = ; W 8 = K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 8 / 4
Example Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) x() Compute DFT ofx() x = {,,, } using radix decimation in time X() x() x() X() x() x() X() X() x() X() x() X() 7 -j 4 4 K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 9 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Example x() -j -j +j Compute DFT ofx() x = {,,, } using radix decimation in time X() x() x() X() x() x() X() X() x() X() x() X() 4 7 -j 4 4 K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4
Example Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) x() Compute DFT ofx() x = {,,, } using radix decimation in time X() x() x() X() x() x() X() X() x() X() x() X() 4 7 -j -j 4 4 K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4 Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) Example x() -j -j +j Compute DFT ofx() x = {,,, } using radix decimation in time X() x() x() X() x() x() X() X() x() X() x() X() 4 4 7 -j -j -j 4 4 -j K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4
Example Efficient Computation of the DFT: FFT Algorithms Radix FFT (Decimatation in Time) x() Compute DFT ofx() x = {,,, } using radix decimation in time X() x() x() X() x() x() X() X() x() X() x() X() 7 -j 4 4 7 -j -j -j +j 4 4 K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 / 4 Lecture Summary -j -j +j Lecture Summary Direct DFT calculation complexity O(N ) FFT calculation complexity O(N log N) Radix Decimation in Time (FFT) algorithm Decompose signal log N times; Basic computation is the butterfly Sample Ordering Affects Radix decimation in time algorithm uses bit reversed order inputs (shuffled samples) and produces natural order outputs Next lecture The radix 4 and decimation in frequency FFT (Chapter 8.) K. E. Barner (Univ. of Delaware) ELEG 5: Digital Signal Processing Fall 8 4 / 4