<< Chapter < Page Chapter >> Page >

To summarize, we will rewrite [link] according to this interpretation.First, we define two new N / 2 point data sequences x 0 ( n ) and x 1 ( n ) , which contain the even and odd-numbered datapoints from the original N point sequence, respectively:

x 0 ( n ) = x ( 2 n ) x 1 ( n ) = x ( 2 n + 1 ) ,

where n = 0 , . . . , N / 2 - 1 . This separation of even and odd points is called decimation in time . The N point DFT of x ( n ) is then given by

X ( k ) = X 0 ( k ) + e - j 2 π k / N X 1 ( k ) for k = 0 , . . . , N - 1 .

where X 0 ( k ) and X 1 ( k ) are the N / 2 point DFT's of the even and odd points.

X 0 ( k ) = DFT N / 2 [ x 0 ( n ) ] X 1 ( k ) = DFT N / 2 [ x 1 ( n ) ]

While [link] requires less computation than the original N point DFT, it can still be further simplified.First, note that each N / 2 point DFT is periodic with period N / 2 . This means that we need to only compute X 0 ( k ) and X 1 ( k ) for N / 2 values of k rather than the N values shown in [link] . Furthermore, the complex exponential factor e - j 2 π k / N has the property that

- e - j 2 π k N = e - j 2 π k + N / 2 N .

These two facts may be combined to yield a simpler expression for the N point DFT:

X ( k ) = X 0 ( k ) + W N k X 1 ( k ) X ( k + N / 2 ) = X 0 ( k ) - W N k X 1 ( k ) for k = 0 , . . . , N / 2 - 1

where the complex constants defined by W N k = e - j 2 π k / N are commonly known as the twiddle factors .

Divide and conquer DFT of equation (13). The N -point DFT is computed using the two N / 2 -point DFT's X 0 ( N / 2 ) ( k ) and X 1 ( N / 2 ) ( k ) .

[link] shows a graphical interpretation of [link] which we will refer to as the “divide-and-conquer DFT”. We start on the left side with the data separated intoeven and odd subsets. We perform an N / 2 point DFT on each subset, and then multiply the output of the odd DFT by the required twiddlefactors. The first half of the output is computed by addingthe two branches, while the second half is formed by subtraction.This type of flow diagram is conventionally used to describe a fast Fourier transform algorithm.

Implementation of divide-and-conquer dft

In this section, you will implement the DFT transformationusing [link] and the illustration in [link] . Write a Matlab function with the syntax

X = dcDFT(x)

where x is a vector of even length N , and X is its DFT. Your function dcDFT should do the following:

  1. Separate the samples of x into even and odd points.
    The Matlab command x0 = x(1:2:N) can be used to obtain the “even” points.
  2. Use your function DFTsum to compute the two N / 2 point DFT's.
  3. Multiply by the twiddle factors W N k = e - j 2 π k / N .
  4. Combine the two DFT's to form X .

Test your function dcDFT by using it to compute the DFT's of the following signals.

  1. x ( n ) = δ ( n ) for N = 10
  2. x ( n ) = 1 for N = 10
  3. x ( n ) = e j 2 π n / N for N = 10

Inlab report

  1. Submit the code for your function dcDFT .
  2. Determine the number of multiplies that are required in this approach to computing an N point DFT. (Consider a multiply to be one multiplication ofreal or complex numbers.)
    Refer to the diagram of [link] , and remember to consider the N / 2 point DFTs.

Recursive divide and conquer

Recursion of the decimation-in-time process. Now each N / 2 -point is calculated by combining two N / 4 -point DFT's.

The second basic concept underlying the FFT algorithm is that of recursion. Suppose N / 2 is also even. Then we may apply the same decimation-in-timeidea to the computation of each of the N / 2 point DFT's in [link] . This yields the process depicted in [link] . We now have two stages of twiddle factorsinstead of one.

How many times can we repeat the process of decimating the input sequence? Suppose N is a power of 2, i.e. N = 2 p for some integer p . We can thenrepeatedly decimate the sequence until each subsequence contains only two points.It is easily seen from [link] that the 2 point DFT is a simple sum and difference of values.

X ( 0 ) = x ( 0 ) + x ( 1 ) X ( 1 ) = x ( 0 ) - x ( 1 )
8-Point FFT.

[link] shows the flow diagram that results for an 8 point DFT when we decimate 3 times.Note that there are 3 stages of twiddle factors (in the first stage, the twiddle factors simplify to “1”).This is the flow diagram for the complete decimation-in-time 8 point FFT algorithm.How many multiplies are required to compute it?

Write three Matlab functions to compute the 2, 4, and 8 point FFT's using the syntax

X = FFT2(x)

X = FFT4(x)

X = FFT8(x)

The function FFT2 should directly compute the 2-point DFT using [link] , but the functions FFT4 and FFT8 should compute their respective FFT's using the divide and conquer strategy.This means that FFT8 should call FFT4 , and FFT4 should call FFT2 .

Test your function FFT8 by using it to compute the DFT's of the following signals. Compare these results to the previous ones.

  1. x ( n ) = δ ( n ) for N = 8
  2. x ( n ) = 1 for N = 8
  3. x ( n ) = e j 2 π n / 8 for N = 8

Inlab report

  1. Submit the code for your functions FFT2 , FFT4 and FFT8 .
  2. List the output of FFT8 for the case x ( n ) = 1 for N = 8 .
  3. Calculate the total number of multiplies by twiddle factors required for your 8 point FFT. (A multiply is a multiplication by a real or complexnumber.)
  4. Determine a formula for the number of multiplies required for an N = 2 p point FFT. Leave the expression in terms of N and p . How does this compare to the number of multiplies requiredfor direct implementation when p=10?

If you wrote the FFT4 and FFT8 functions properly, they should have almost the exact same form. The only difference between them is the length of the input signal,and the function called to compute the (N/2)-pt DFTs. Obviously, it's redundant to write a separate function for each specificlength DFT when they each have the same form. The preferred method is to write a recursive function, which means that the function calls itself within the body. It is imperative that a recursive function has a condition for exiting withoutcalling itself, otherwise it would never terminate.

Write a recursive function X=fft_stage(x) that performs one stage of the FFT algorithm for a power-of-2 length signal.An outline of the function is as follows:

  1. Determine the length of the input signal.
  2. If N=2, then the function should just compute the 2-pt DFT as in [link] , and then return.
  3. If N>2, then the function should perform the FFT steps described previously (i.e. decimate, compute (N/2)-pt DFTs, re-combine),calling fft_stage to compute the (N/2)-pt DFTs.

Note that the body of this function should look very similar to previous functions written in this lab.Test fft_stage on the three 8-pt signals given above, and verify that it returns the same results as FFT8 .

Submit the code for your fft_stage function.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?

Ask