Docsity

Fast Fourier Transform (FFT) - Syllabus and Algorithms, Lecture notes of Digital Communication Systems

Toggle sidebar
bg1
Digital Signal Processing – 3
III. Fast Fourier transform
2007 Syllabus: Fast Fourier Transform (FFT) – Radix-2 decimation in time and decimation in
frequency FFT Algorithms, Inverse FFT, and FFT for composite N.
Contents:
3.1 Introduction
3.2 Radix-2 decimation-in-time FFT (Cooley-Tukey)
3.3 Radix-2 decimation-in-frequency FFT (Sande-Tukey)
3.4 Inverse DFT using the FFT algorithm
3.5 *Decimation-in-time algorithm for N = 4 (Cooley-Tukey formulation)
3.6 *Decimation-in-frequency algorithm for N = 4 (Sande-Tukey formulation)
3.7 FFT with general radix
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Fast Fourier Transform (FFT) - Syllabus and Algorithms and more Lecture notes Digital Communication Systems in PDF only on Docsity!

Digital Signal Processing – 3

III. Fast Fourier transform

2007 Syllabus : Fast Fourier Transform (FFT) – Radix-2 decimation in time and decimation in frequency FFT Algorithms, Inverse FFT, and FFT for composite N.

Contents: 3.1 Introduction 3.2 Radix-2 decimation-in-time FFT (Cooley-Tukey) 3.3 Radix-2 decimation-in-frequency FFT (Sande-Tukey) 3.4 Inverse DFT using the FFT algorithm 3.5 *Decimation-in-time algorithm for N = 4 (Cooley-Tukey formulation) 3.6 *Decimation-in-frequency algorithm for N = 4 (Sande-Tukey formulation) 3.7 FFT with general radix

3.1 Introduction

For a finite-duration sequence x(n) of length N , the DFT sum may be written as

X(k) =

1

0

N

n

kn xnWN , k = 0, 1, …, N – 1

where WN = ej^2 / N. There are a total of N values of X(.) ranging from X(0) to X(N–1). The

calculation of X(0) involves no multiplications at all since every product term involves W N^0 =

ej^0 = 1. Further, the first term in the sum always involves^0 W N or ej^0 = 1 and therefore does

not require a multiplication. Each X(.) calculation other than X(0) thus involves ( N– 1 ) complex multiplications. And each X(.) involves ( N– 1 ) complex additions. Since there are N values of X(.)

the overall DFT requires ( N  1 )^2 complex multiplications and N(N–1) complex additions. For

large N we may round these off to N^2 complex multiplications and the same number of complex additions. Each complex multiplication is of the form

(A + jB) (C + jD) = (AC – BD) + j(BC + AD)

and therefore requires four real multiplications and two real additions. Each complex addition is of the form

(A + jB) + (C + jD) = (A + C) + j(B + D)

and requires two real additions. Thus the computation of all N values of the DFT requires 4 N^2 real multiplications and 4 N^2 (= 2 N^2 + 2 N^2 ) real additions. Efficient algorithms which reduce the number of multiply-and-add operations are known by the name of fast Fourier transform (FFT). The Cooley-Tukey and Sande-Tukey FFT

algorithms exploit the following properties of the twiddle factor (phase factor), WN = ej^2 / N

(the factor e j^2 / N is called the N th^ principal root of 1):

  1. Symmetry property^2

k^ N WN

 = – WNk

  1. Periodicity property WN kN = WNk

To illustrate, for the case of N = 8, these properties result in the following relations:

0 W 8 = – 4 W 8 = 1 1 W 8 = – 5 W 8 = 2

1  j

2 W 8 = – 6 W 8 = – j 3 W 8 = – 7 W 8 =   2

1  j

The use of these properties reduces the number of complex multiplications from N^2 to

N

N

log 2 2

(actually the number of multiplications is less than this because several of the

multiplications by WNr are really multiplications by ±1 or ± j and don’t count); and the number of

complex additions are reduced from N^2 to N log 2 N. Thus, with each complex multiplication

requiring four real multiplications and two real additions and each complex addition requiring two real additions, the computation of all N values of the DFT requires

3.2 Radix-2 decimation-in-time FFT (Cooley-Tukey)

Procedure and important points

  1. The number of input samples is N = 2ν^ where ν is an integer.
  2. The input sequence is shuffled through bit-reversal. The index n of the sequence x(n) is expressed in binary and then reversed.
  3. The number of stages in the flow graph is given by ν = log 2 N.
  4. Each stage consists of N/2 butterflies.
  5. Inputs/outputs for each butterfly are separated as follows: Separation = 2 m–^1 samples where m = stage index, stages being numbered from left to right (that is, m = 1 for stage 1, m = 2 for stage 2 etc.). This amounts to separation increasing from left to right in the order 1, 2, 4, …, N/.
  6. The number of complex additions = N log 2 N and the number of complex multiplications

is N

N

log 2 2

  1. The elementary computation block in the flow graph, called the butterfly, is shown here. This is an in-place calculation in that the outputs ( A + B WNk ) and ( A – B WNk ) can be computed and stored in the same locations as A and B.

A + BWNk

A – BWNk

k WN

A

B

Separation of 1

Separation of 2

Separation of 4

Stage 1 Stage 2 Stage 3

Example 3.2.1 [2002] Radix-2, 8-point, decimation-in-time FFT for the sequence

n → 0 1 2 3 4 5 6 7 x(n) = {1, 2 3 4 – 4 – 3 – 2 – 1}

Solution The twiddle factors are

0 W 8 = 1 1 W 8 = ej^2 /^8 = ej^ /^4 = 2

  • j 2

2

W 8 = 

j 2 / 82

e  = e  j^ /^2 = – j W 83 = 

j 2 / 83 e  = ej^3 /^4 = – 2

  • j 2

One of the elementary computations is shown below:

The signal flow graph follows:

A + BWNk = 1 – 4 = – 3

A – BWNk = 1 + 4 = 5

0 W 8 = 1

A

B

0

W 8

2

W 8

1

W 8

3

W 8

2

W 8

0

W 8

2

W 8

0

W 8

0

W 8

0

W 8

0

W 8

0

W 8

000 000 x(0) = 1 X(0) = 0

001 100 x(4) = – 4

111 111 x(7) = – 1

110 011 x(3) = 4

101 101 x(5) = – 3

100 001 x(1) = 2

010 010 x(2) = 3

011 110 x(6) = – 2

X(7) =

X(6) =

X(5) =

X(4) =

X(1) =

X(2) =

X(3) =

Stage 3 ↓

Bit-reversed order ↓

Natural Stage 1 ↓ Stage 2 ↓ ↓ order

3.3 Radix-2 decimation-in-frequency FFT (Sande-Tukey)

Procedure and important points

  1. The number of input samples is N = 2ν^ where ν is an integer.
  2. The input sequence is in natural order; the output is in bit-reversed order.
  3. The number of stages in the flow graph is given by ν = log 2 N.
  4. Each stage consists of N/2 butterflies.
  5. Inputs/outputs for each butterfly are separated in the reverse order from that of the DIT. The separation decreases from left to right in the order N/2 , … , 4, 2, 1.
  6. The number of complex additions = N log 2 N and the number of complex multiplications

is N

N

log 2 2

  1. The basic computation block in the flow graph of the DIF FFT is the butterfly shown here. This is an in-place calculation in that the two outputs ( A + B ) and ( A – B ) WNk can be computed and stored in the same locations as A and B.

A + B

( A – B ) WNk

k WN

A

B

Example 3.3.1 [Cf. Example 2.1] Radix-2, 8-point, decimation-in-frequency FFT for the sequence

n → 0 1 2 3 4 5 6 7 x(n) = {1, 2 3 4 – 4 – 3 – 2 – 1}

Solution The twiddle factors are the same as in the DIT FFT done earlier (both being 8-point DFTs):

0 W 8 = 1 1 W 8 = ej^2 /^8 = 2

  • j 2

2

W 8 = 

j 2 / 82

e  = e  j^ /^2 = – j W 83 = 

j 2 / 83 e  = ej^3 /^4 = – 2

  • j 2

One of the elementary computations is shown below:

The signal flow graph follows:

X(7) =

A + B

( A – B ) WNk = (1 + 4) 1 = 5

0 W 8 = 1

A

B

2

W 8

1

W 8

0

W 8

0

W 8

0

W 8

2

W 8

0

W 8

0

W 8

0

W 8

2

W 8

0

W 8

3

W 8

x(0) = 1

Natural order ↓ (^) Stage 1 ↓ Stage 2 ↓ Stage 3 ↓

x(7) = – 1

x(6) = – 2

x(5) = – 3

x(4) = – 4

x(3) = 4

x(2) = 3

x(1) = 2

X(0) =

Bit-reversed ↓ order

X(4) =

X(2) =

X(6) =

X(1) =

X(5) =

X(3) =

(DIT Template) The elementary computation (Butterfly):

The signal flow graph:

A + BWNk

A – BWNk

k WN

A

B

(DIF Template) The elementary computation (Butterfly):

The signal flow graph:

A + B

( A – B ) WNk

k WN

A

B

3.4 Inverse DFT using the FFT algorithm

The inverse DFT of an N -point sequence { X(k) , k = 1, 2, … , ( N – 1)} is defined as

x(n) = N

(^1) 

0

N

k

kn X kWN , n = 0, 1, … , N – 1

where WN = ej^2 / N. Take the complex conjugate of x(n) and multiply by N to get

N x*(n) = 

1

0

N * ( )

k

kn X kWN

The right hand side of the above equation is simply the DFT of the sequence X*(k) and can be computed by using any FFT algorithm. The desired output sequence is then found by taking the conjugate of the result and dividing by N

x(n) = N

1 *

0

N

k

kn X kWN

Example 3.4.1 Given the DFT sequence X(k) = {0, (– 1 – j), j, (2+j), 0, (2–j), – j, (–1+j)} obtain the IDFT x(n) using the DIF FFT algorithm. Solution This is an 8-point IDFT. The 8-point twiddle factors are, as calculated earlier,

0 W 8 = 1 1 W 8 = ej^2 /^8 = 2

  • j 2

2

W 8 = 

j 2 / 82

e  = e  j^ /^2 = – j W 83 = 

j 2 / 83 e  = ej^3 /^4 = – 2

  • j 2

The elementary computation (Butterfly) is shown below:

The signal flow graph follows:

A + B

( A – B ) WNk

k WN

A

B

X*(0) = 0

Natural order ↓ (^) Stage 1 ↓ Stage 2 ↓ Stage 3 ↓

X*(7) =

X*(6) = j

X*(5) =

X*(4) = 0

X*(3) =

X*(2) =–j

X*(1) =

8 x*(0) =

Bit-reversed ↓ order

8 x*(4) =

8 x*(2) =

8 x*(6) =

8 x*(1) =

8 x*(5) =

8 x*(3) =

8 x*(7) =

0

W 8

x(n) = 

x(n) = {0.25, – 0.78, 0.5, 0.78, – 0.25, 0.28, – 0.5, – 0.28}

Note Because of the conjugate symmetry of { X(k) }, we should expect the sequence { x(n) } to be real-valued. The MATLAB program:

X = [0, (-1-j), j, (2+j), 0, (2-j), -j, (-1+j)], x = ifft(X)

Example 3.4.2 [2002] Given the DFT sequence X(k) = {0, (1–j), j, (2+j), 0, (2–j), (–1+j), – j} obtain the IDFT x(n) using the DIF FFT algorithm. Solution There is no conjugate symmetry in { X(k) }. Using MATLAB

X = [0, 1-1j, 1j, 2+1j, 0, 2-1j, -1+1j, -1j] x = ifft(X) The IDFT is

x(n) = {0.5, (-0.44 + 0.037i), (0.375 - 0.125i), (0.088 + 0.14i), (-0.75 + 0.5i), (0.44 + 0.21i), (-0.125 - 0.375i), (-0.088 - 0.39i)}

3.7 FFT with general radix

As mentioned in the introduction, if the number of points, N , can be expressed as N = (^) rm , and if the computation algorithm is carried out by means of a succession of r -point transforms, the resultant FFT is called a radix- r algorithm. In a radix- r FFT, an elementary computation ( EC ) consists of an r -point DFT followed by the multiplication of the r results by the appropriate twiddle factor. The number of EC s required is

Cr = N r

N

log r

which decreases as r increases. Of course, the complexity of an EC increases with increasing r. For r = 2, the EC (the butterfly) consists of a single complex multiplication and two complex additions; for r = 4, the EC requires three complex multiplications and several complex additions. Suppose that we desire an N -point DFT where N is a composite number that can be factored into the product of integers

N = N 1 N 2 … Nm

If, for instance, N = 64 and m = 3, we might factor N into the product 64 = 4 x 4 x 4, and the 64- point transform can be viewed as a three-dimensional 4 x 4 x 4 transform. If N is a prime number so that factorization of N is not possible, the original signal can be zero-padded and the resulting new composite number of points can be factored. We illustrate in the table below the situation for N = 64. Since 64 = 2^6 , we can have a radix-2 FFT; alternatively, since 64 = 4^3 , we can also have a radix-4 FFT.

N = 64 = 2^6 = 4^3 = 8^2 Radix-2 Radix-4 Radix- No. of stages (^) log 264 = 6 log 464 = 3 log 864 = 2 No. of EC s per stage 64/2 = 32 64/4 = 16 64/8 = 8