DFT & FFT Computation. Why DFT ? The two reasons : – It allows us to determine the frequency...

of 32/32
DFT & FFT Computation
  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of DFT & FFT Computation. Why DFT ? The two reasons : – It allows us to determine the frequency...

  • Slide 1

DFT & FFT Computation Slide 2 Why DFT ? The two reasons : It allows us to determine the frequency content of a signal (Spectral Analysis) Perform frequency analysis on a digital computer. Slide 3 Fourier Transform Vs Discrete Fourier Transform : Fourier Transform Continuous function of and so cannot be processed by digital system. DFT Converts the continuous function of to a discrete function of DFT obtained by sampling one period of the Fourier Transform X() at a finite number of frequency points. Sampling performed at N equally spaced points in the period 0 < < 2 (or) at k = 2 k / N; 0 < k < N 1. Slide 4 Discrete Fourier Transform : The Discrete Fourier Transform (DFT) converts time domain data to frequency domain data. where the Twiddle Factor is The Inverse DFT (IDFT) coverts frequency domain data to the time domain The DFT/IDFT requires N 2 complex multiplies and N(N-1) complex additions Slide 5 Problem : Compute 4 point DFT of casual three sample sequence given by x[n] = 1/3 ; 0 < n < 2 = 0; else. Solution : |X(k)| = {1, 1/3, 1/3, 1/3} Angle of X(k) = {0, -/2, 0, /2} Slide 6 Properties of DFT : Linearity : If DFT{x 1 [n]} = X 1 (k) and DFT{x 2 [n]} = X 2 (k) Then DFT{ax 1 [n] + bx 2 [n]} = a X 1 (k) + b X 2 (k) Periodicity : If x[n] and x(k) are an N point DFT pair, then x[n + N] = x[n]; for all N X(k + N) = X(k); for all N Slide 7 Properties of DFT : Time Reversal : If DFT{x[n]} = X(k) Then DFT{x[N - n]} = X(N - k) Shifting : If DFT{x[n]} = X(k) Then DFT{x[n n 0 ]} = X(k) e -j2 kn 0 /N. Slide 8 Properties of DFT : Circular convolution : If DFT{x 1 [n]} = X 1 (k) and DFT{x 2 [n]} = X 2 (k) Then DFT{x 1 [n] x 1 [n]} = X 1 (k) X 2 (k) Multiplication of two sequence : If DFT{x 1 [n] x x 2 [n]} = 1/N {X 1 (k) X 2 (k)} (Dual of Circular convolution) * * Slide 9 Relation between DFT with Z and Fourier Transform: Z transform of x[n] is Relation : X(k) = X(z) | z = e j2 k/N Fourier Transform of x[n] is Relation : X(k) = X() | = 2 k/N Slide 10 Divide and Conquer Slide 11 Slide 12 Fast Fourier Transform (FFT): It is a method (or algorithm) for computing the DFT with reduced number of calculations. The computational efficiency is achieved divide and conquer approach. In an N point sequence, N = r m, where r radix. For radix 2 FFT, N = 2 m, for radix 4 FFT, N = 4 m and so on Slide 13 Fast Fourier Transform (FFT): In radix 2 FFT, the N point sequence is decimated into 2 point sequence 2 point DFT is computed. From the result of 2 point DFTs 4 point DFTs can be computed. From the result of 4 point DFTs 8 point DFTs can be computed and so on until we get N point DFT. For N point sequence (DFT : FFT) : Total number of addition N(N-1) : N log 2 N. Total number of multiplication N 2 : (N/2) log 2 N. Slide 14 Comparison of number of computation in direct DFT and FFT: Number of points N Direct computationRadix 2 FFT Complex additions N(N 1) Complex Multiplication N 2 Complex additions Nlog 2 N Complex Multiplication (N/2)log 2 N 4 8 16 32 64 128 12 56 240 992 4032 16,256 16 64 256 1,024 4,096 16,384 8 24 64 160 384 896 4 12 32 80 192 448 Slide 15 The decimation-in-frequency (DIF) FFT algorithm Introduction: Decimation in frequency is an alternate way of developing the FFT algorithm It is different from decimation in time in its development, although it leads to a very similar structure Slide 16 The decimation in frequency FFT (continued) Consider the original DFT equation . Separate the first half and the second half of time samples: Slide 17 Continuing with decimation in frequency... For k even, let For k odd, let These expressions are the N/2-point DFTs of Slide 18 These equations describe the following structure: Slide 19 Continuing by decomposing the odd and even output points we obtain Slide 20 and replacing the N/4-point DFTs by butterflys we obtain Slide 21 The DIF FFT is the transpose of the DIT FFT To obtain flowgraph transposes: Reverse direction of flowgraph arrows Interchange input(s) and output(s) DIT butterfly: DIF butterfly: Comment: We will revisit transposed forms again in our discussion of filter implementation Slide 22 The DIF FFT is the transpose of the DIT FFT Comparing DIT and DIF structures: DIT FFT structure: DIF FFT structure: Alternate forms for DIF FFTs are similar to those of DIT FFTs Slide 23 Comparison of DIT and DIF: Difference between DIT and DIF: In DIT, the input is bitreversed while the output is in natural order. For DIF, the reverse is time, i.e., input is normal order, while output is bitreversed. However, both DIT and DIF can go from the normal to shuffled data or viceversa. Considering the butterfly diagram, in DIF, the complex multiplication takes place after the addsubtract operation. Similarities: Both algorithm requires same number of operations to compute DFT. Both algorithms require bitreversed at same place during computation. Slide 24 Computation of IDFT through FFT: Take conjugate of X(k) [say X*(k)]. Compute the Npoint DFT of X*(k) using radix2 FFT. Take conjugate of the output sequence of FFT. Divide the sequence obtained in step3 by N. the resultant sequence is x[n]. Note : Thus a single FFT algorithm serves the evaluation of both direct and inverse DFTs. Slide 25 Problem: In an LTI system the input x[n] = { 1, 1, 1 } and the impulse response h[n] = { -1, -1 }. Determine the response of LTI system by radix2 DIT and DIF FFT. Solution : y[n] = { -1, -2, -2, -1 }. Slide 26 Convolution: The output or response of an LTI system is given by X[n] N 1 samples. h[n] N 2 samples. Y[n] N 1 + N 2 1 samples. Slide 27 Sectioned convolution : If one of the sequence (either the input sequence or impulse response sequence) is very much larger than the other, then it is very difficult to compute the linear convolution using DFT for the following reasons : The entire sequence should be available before convolution can be carried out. This makes long delay in getting the output. Large amounts of money is required to store the sequence. The larger sequence is sectioned into size of the smaller sequence. Linear convolution of each section of longer sequence and the smaller sequence is performed. The output sequence obtained from the convolutions of all the section are combined to get the overall output sequence. Slide 28 Overall add method: Let N 1 length of longer sequence, N 2 length of smaller sequence. The longer sequence be divided into sections of size N 3 (same as N 2 ) samples. The linear convolution of each divided section with smaller sequence will produce an output sequence of size N 3 +N 2 -1. The last N 2 - 1 samples of each output sequence overlaps with the first N 2 1 samples of next section While combining the output sequences of the various sectioned convolutions, the corresponding samples of overlapped regions are added and the samples of non overlapped regions are retained as such. Slide 29 Overall add method: Slide 30 Overall save method: Let N 1 length of longer sequence, N 2 length of smaller sequence. The longer sequence be divided into sections of size N 3 (same as N 2 ) samples. The smaller and the sectioned longer sequence (N 3 ) are converted into the size of the output sequence (N 3 + N 2 1) by appending with zeros. The convolution between N 2 with the sections of N 3 is carried by means circular convolution. Slide 31 Overall save method: Slide 32 Problem: Perform the linear convolution of the following sequence by (i) overlap add method and (ii) overlap save method. x[n] = {1, -1, 2, -2, 3, -3} and h[n] = {-1, 1}. Also sketch the output sequence. Solution : (i) y[n] = {-1, 2, -3, 4, -5, 6, -7, 8, -4} (ii) y[n] = { *, 2, -3, 4, -5, 6, -7, 8, -4} y[n] = {-1, 2, -3, 4, -5, 6, -7, 8, -4, *}