230 likes | 613 Views
Fourier Transforms. Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms. Discrete Fourier Transform (DFT). Fourier Transform assumes a continuous signal of infinite duration and bandwidth.
E N D
Fourier Transforms • Discrete Fourier Transform (DFT) Algorithms • Fast Fourier Transform (FFT) Algorithms Digital Kommunikationselektronik TNE027 Lecture 5
Discrete Fourier Transform (DFT) • Fourier Transform assumes a continuous signal of infinite duration and bandwidth. • For practical representation, we must sample in time and frequency, and amplitude must be quantized. • Discrete Fourier Transform assumes N samples in time and frequency. DFT: X[k] = Σx[n] e–j2kn/N = Σx[n] WNkn IDFT:x[n] =(1/N)Σ X[k] e j2kn/N = (1/N)Σ X[k] WN –kn where WNkn = e– j2kn/N N-1 N-1 n=0 n=0 N-1 N-1 k=0 k=0 Digital Kommunikationselektronik TNE027 Lecture 5
Effect of Sampling in Time and Frequency • By sampling in time, we get a periodic spectrum with the sampling frequency fs. The approximation of a Fourier transform by a DFT is reasonable only if the frequency components of x(t) are concentrated on a smaller range than the Nyquist frequency fs/2. Digital Kommunikationselektronik TNE027 Lecture 5
By sampling in the frequency domain, the time function becomes periodic, i.e., the DFT assumes the time series to be periodic. If an N-sample DFT is applied to a signal that does not complete an integer number of cycles with an N-sample window, a phenomenon called leakage occurs. Digital Kommunikationselektronik TNE027 Lecture 5
If possible, we should choose the sampling frequency and the analysis window in such a way that it covers an integer number of periods of x(t), if x(t) is periodic. • We can also decrease leakage by using a window function that tapers smoothly to zero on both sides. See Example 6.1: Windowing. Digital Kommunikationselektronik TNE027 Lecture 5
Vector/matrix notation and an alternative inversion algorithm X = Wx x = (1/N) W*X x = (1/N) W*X= (1/N) (WX*)* When computing IDFT, we can compute the DFT of X*, i.e., WX*. The result of IDFT is the conjugate of the result of WX*scaled by (1/N). Digital Kommunikationselektronik TNE027 Lecture 5
The Fast Fourier Transform (FFT) Algorithms • FFT uses different multidimensional index maps of the input and output sequences. • Two-dimensional index transform: n = An1 + Bn2 mod N where 0 n1 N1–1, 0 n2 N2–1 and N = N1 N2 See equation (6.18) on page 259. Digital Kommunikationselektronik TNE027 Lecture 5
The Cooley-Tukey FFT Algorithm • The Cooley-Tukey FFT is the most universal of all FFT algorithms, because any factorization of N is possible. Digital Kommunikationselektronik TNE027 Lecture 5
Index transform (index mapping) n = N2n1 + n2 k = k1 + N1k2 where 0 n1 N1–1, 0 n2 N2–1, 0 k1 N1–1, 0 k2 N2–1 and N = N1 N2 X[k] = Σx[n] e–j2kn/N = Σx[n] WNkn WNkn = WN(k1 + N1k2)(N2n1 + n2 ) = WNN2n1k1 + N1N2n1k2 +n2 k1 + N1n2k2 N-1 N-1 n=0 n=0 Digital Kommunikationselektronik TNE027 Lecture 5
WNN2n1k1= e–j2 N2n1k1 /N = e–j2 n1k1 /N1=WN 1n1k1 WN N1N2n1k2 = e–j2 N1N2n1k2 /N= e–j2 n1k2 = 1 WN N1n2k2 = e–j2 N1n2k2 /N = e–j2 n2k2 /N2=WN 2n2k2 X[k1,k2] = ΣWN 2n2k2(WN n2k1Σx[n1,n2] WN 1n1k1) = ΣWN 2n2k2x[n2,k1] N2-1 N1-1 n1=0 n2=0 N2-1 n2=0 Digital Kommunikationselektronik TNE027 Lecture 5
Algorithm 6.8: Cooley-Tukey Algorithm An N = N1 N2 -point DFT can be done using the following steps: • Compute an index transform of the input sequence according to: n = N2n1 + n2 • Compute the N2 DFTs of length N1. • Apply the twiddle factors WN n2k1to the output of the first transform stage. • Compute the N1 DFTs of length N2. • Compute an index transform of the output sequence according to: k = k1 + N1k2 See Example 6.9: Cooley-Tukey FFT for N = 12. Digital Kommunikationselektronik TNE027 Lecture 5
Radix-r Cooley-Tukey Algorithm • Radix-r algorithms, N = rs , S is the number of stages. • The most popular algorithms are of basis r = 2 or r =4, because the necessary basic DFTs can be implemented without any multiplications. Digital Kommunikationselektronik TNE027 Lecture 5
1 2-point DFT, Butterfly X(0) = x(0)e0 + x(1)e0 = x(0) + x(1) X(1) = x(0)e0 + x(1)e–j2 /2 = x(0) x(1) x(0) X(0) x(1) X(1) Digital Kommunikationselektronik TNE027 Lecture 5
1 1 1 1 4-point FFT n = 2n1 + n2 k = k1 + 2k2 x(0) X(0) x(2) X(2) W0 x(1) X(1) W2 x(3) X(3) Digital Kommunikationselektronik TNE027 Lecture 5
1 1 Rearrange the positions of x(1) and x(2) x(0) X(0) x(1) X(2) 1 W0 x(2) X(1) W2 x(3) X(3) 1 Group Digital Kommunikationselektronik TNE027 Lecture 5
Decimation-in-frequency (DIF) FFT algorithm See Fig. 6.12 and Table 6.3. • The Decimation-in-frequencyalgorithm starts in the frequency domain to split the original DFT into shorter DFTs. • The input values typically occur in natural order, while the index of the frequency values is in bit-reversed order. • The decimation-in-time (DIT) FFT algorithm can be found in the book “Fundamentals of Signals and Systems using the WEB and MATLAB”, pages 339-342. Digital Kommunikationselektronik TNE027 Lecture 5
Number of complex multiplications and add/subtract operations • For r = 2 and S stages (S = log2N), the number of complex twiddle factor multiplications is (S – 1)N/2 = ((log2N)– 1) N/2. The number of complex add/subtract operations is SN = (log2N) N. • Compare with the direct DFT computation: • Complex multiplications: NN • Complex add/subtract operations: N(N – 1) Digital Kommunikationselektronik TNE027 Lecture 5
Index transform for radix-2 Cooley-Tukey FFT using bit reversing • Reversing of the bit sequence of the index. Example: For the 8-point FFT in Fig. 6.12, the output at the second position (index 0012) of the output is X[4] (index: 1002) after bit reversing. • Index transform for radix-4 Cooley-Tukey FFT using digit reversing • Build “digits” of two bitsand then reverse the order of these digits. See Fig. 6.13. Digital Kommunikationselektronik TNE027 Lecture 5
Radix-2 Cooley-Tukey Algorithm Implementation • Butterfly processor • Complex multiplication • Complex multiplication with the twiddle factor is often implemented with 4 real multiplications and two add/subtract operations. • A more efficient complex multiplier is implemented with 3 real multiplications and 3 add/subtract operations. See Algorithm 6.10. Digital Kommunikationselektronik TNE027 Lecture 5