Transcript Linearity
EE345S Real-Time Digital Signal Processing Lab Spring 2006 Fast Fourier Transform Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin Lecture 17 Discrete-Time Fourier Transform • Forward transform of discrete-time signal x[n] X (w ) jw n x [ n ] e n – Assumes that x[n] is two-sided and infinite in duration – Produces X(w) that is periodic in w (in units of rad/sample) with period 2 p due to exponential term • Inverse discrete-time Fourier transform 1 p jwn x[n] X (w )e dw 2p p • Basic transform pairs x[n] [n] X (w ) 1 x[n] 1 X (w ) (w 2pk ) k 17 - 2 Discrete Fourier Transform (DFT) • Discrete Fourier transform (DFT) of a discretetime signal x[n] with finite extent n [0, N-1] N 1 X [k ] x[n] e j 2p nk N n 0 X (w ) w 2p k for k = 0, 1, …, N-1 N Two-Point DFT X[k] periodic with period N due to exponential X [0] x[0] x[1] Also assumes x[n] periodic with period N X [1] x[0] x[1] • Inverse discrete Fourier transform N 1 1 x[n] X [k ] e N k 0 • Twiddle factor WN e j 2p N j 2p nk N 1 N 1 x[n] X [k ] WNnk N k 0 17 - 3 Discrete Fourier Transform (con’t) • Forward transform N 1 • X [k ] x[n] WNnk N2 complex multiplications N (N –1) complex additions N2 integer multiplications N2 modulo indexes into lookup table of twiddle factors n 0 for k = 0, 1, …, N-1 Exponent of WN has period N • Memory usage x[n]: N complex words of RAM X[k]: N complex words of RAM WN : N complex words of ROM • Halve memory usage Allow output array X[k] to write over input array x[n] Exploit twiddle factors symmetry Computation • Inverse transform 1 N 1 x[n] X [k ] WNnk N k 0 for n = 0, 1, …, N-1 Memory usage? Computational complexity? 17 - 4 Fast Fourier Transform Algorithms • Communication system application: multicarrier modulation using harmonically related carriers Discrete multitone modulation in ADSL & VDSL modems OFDM transceivers such as in IEEE 802.11a wireless LANs • Efficient divide-and-conquer algorithm Compute discrete Fourier transform of length N = 2n ½ N log2 N complex multiplications and additions How many real complex multiplications and additions? • Derivation: Assume N is even and power of two N 1 X [k ] x[n] W n 0 nk N N 1 x[n] W n even nk N N 1 nk x [ n ] W N n odd 17 - 5 Fast Fourier Transform (cont’d) • Substitute n = 2r for n even and n = 2r+1 for odd X [k ] N / 2 1 x[2r ] W 2 rk N r 0 N / 21 ( 2 r 1) k x [ 2 r 1 ] W N r 0 x[2r ] W 2 rk N r 0 N / 2 1 W • Using the property W e 2l N X [k ] N / 21 x[2r ] W r 0 rk N /2 W k N x[2r 1] W N / 21 k N 2 rk N r 0 j 2p 2l N e j 2pl N /2 WNl / 2 N / 21 k rk x [ 2 r 1 ] W G [ k ] W N /2 N H[k ] r 0 One FFT length N => two FFTs length N/2 Two-Point FFT X [0] x[0] x[1] Repeat process until two-point FFTs remain Computational complexity of two-point FFT? X [1] x[0] x[1] 17 - 6 Linear Convolution by FFT • Linear convolution x[n] has length Nx and h[n] has length Nh y[n] has length Nx+Nh-1 y[n] h[m] x[n m] m • Linear convolution requires NxNh real-valued multiplications and 2Nx + 2Nh - 1 words of memory • Linear convolution by FFT of length N = Nx+Nh - 1 Zero pad x[n] and h[n] to make each N samples long Compute forward DFTs of length N to obtain X[k] and H[k] Y[k] = H[k] X[k] for k = 0…N-1: may overwrite X[k] with Y[k] Take inverse DFT of length N of Y[k] to obtain y[n] • If h[n] is fixed, then precompute and store H[k] 17 - 7 Linear Convolution by FFT • Implementation complexity using N-length FFTs 3 N log2 N complex multiplications and additions 2 N complex words of memory if Y[k] overwrites X[k] • FFT approach requires fewer computations if 12( N x Nh 1) log2 ( N x Nh 1) N x Nh • Disadvantages of FFT approach – Uses twice the memory: 2(Nx +Nh -1) complex words vs. 2Nx + 2Nh - 1 words – Often requires floating-point arithmetic FFT under fixed– Adds delay of Nx samples to buffer x[n] point arithmetic? whereas linear convolution is pointwise – Creates discontinuities at boundaries of blocks of input data, 17 - 8 which can be overcome by overlapping blocks