Sei sulla pagina 1di 47

Fourier transform of discrete time signals

Discrete Fourier Transform


Inverse Discrete Fourier Transform
Properties of Discrete Fourier Transform
Computation of discrete Fourier transform
FFT algorithms
Decimation in Time (DIT)
Decimation in Frequency (DIF)

Time domain signal

Frequency domain signal

1
Fourier series (Periodic signals) & Fourier Transform
(Finite energy signals)
Useful in the analysis & design of LTI system.
Decomposes the signals in terms of sinusoidal or
complex exponential components (sin t or e j )
To represent in frequency domain
Converts Time domain signal to a frequency domain
signal

Fourier Transform (FT) is a way of transforming a continuous


signal into the frequency domain.
Discrete Time Fourier Transform (DTFT) is a Fourier Transform of
a sampled signal.
Discrete Fourier Transform (DFT) is a discrete numerical
equivalent using sums instead of integrals that can be computed on a
digital computer.
Finally, FFT is a highly elegant and efficient algorithm, which is
still one of the most used algorithms in speech processing,
communications, frequency estimation, etc one of the most highly
developed area of DSP.

2
Fourier series Fourier Transform
Gives the harmonic content of a Gives the frequency information
periodic time function for an aperiodic signals (Finite
energy signals)
Discrete frequency spectrum Continuous frequency spectrum

DTFT DFT
Sampling is performed only in Obtained by performing
time domain sampling operation in both the
time and frequency domains

Continuous function of Discrete frequency spectrum

The Fourier transform of a continuous time aperiodic signal is given


by
X( j) = x(t)e jt dt for all

The conditions for the existence of the Fourier transform is follows


the Dirichlet conditions which are:
1 .The signal x(t) has a finite no. of discontinuities.
2.The signal x(t) has a finite no. of maxima and minima.
3.The signal x(t) is absolutely integrable that is

x ( t ) dt <

3
The discrete time Fourier transform of finite energy aperiodic signal
x(n) is representation of signal in terms of complex exponential
sequence e-jn where is a real frequency variable.
The discrete time Fourier transforms of x(n) is defined as

X(e j ) = X() = x(n)e
n =
jn

where X() represents the frequency content if signal is x(n).

Physically X() is a decomposition of x(n) into its frequency


components.

ITDFT
The Inverse Discrete Time Fourier Transform (ITDFT)
is given by,

1
x (n ) =
2
X()e jn d

4
Relationship between Z-Transform &
Fourier Transform
Let us consider a sequence x(n) having z-
transform with ROC that includes the unit
circle. where z = re j


X(re j ) = x (n )r
n =
n jn
e (1)
The Fourier transform of x(n) is given by

(2)
j
X(e ) =
x(n)e jn
n =

In the z-plane this corresponds to the locus of


points on the unit circle z = 1 . Hence X(ej) is
equal to X(z) evaluated along the unit circle, or
X ( e j ) = X ( z ) z = e j

For X(ej) to exists, the ROC of X(z) must


include the unit circle.

10

5
Discrete Fourier Transform
DFT of a discrete time signal x(n) is a finite duration
discrete frequency sequence.
DFT sequence is denoted by X(k).
DFT is obtained by sampling one period of the Fourier
Transform X() of the signal x(n) at a finite no. of
frequency points.
X(k) = X() = 2k ; for k = 0,1, 2, 3...(N-1)
N

Sampling is performed at N equally spaced points in the


period 0 2 at k = 2k /N; 0 k N-1

DFT converts the continuous function of to a


discrete function of .
Thus, DFT allows us to perform frequency
analysis on a digital computer.

DFT is important for two reasons:


1. To perform spectral analysis.
2. To perform filtering operations in frequency
domain.

6
Compute the N-point DFT of the following finite length
sequence given as,
(a). 1, n - even, 0 n N -1
x(n) =
0, n - odd, 0 n N -1

(b). x(n) = a n , 0 n N - 1

1, n - even,0 n N -1
(a). x(n) =
0, n - odd,0 n N -1
N1 2 k n
j
DFT{x(n)} = X(k) = x(n)e N
for k = 0,1, 2, ....(N-1)
n =0
N 1 2 k n
j
2
N
= e
N
2
for k = 0, 2, ....
n =0 2
N
=
2
N N
, k = 0, 2, ....
X(k) = 2 2
0, otherwise

7
(b). x(n) = a n , 0 n N - 1
N1 2 k n
j
DFT{x(n)} = X(k) = x(n)e N
for k = 0,1, 2, ....(N-1)
n =0

N 1 2 k n
j
X(k) = a e n N
for k = 0, 1, 2, ....(N -1)
n =0
n
N 1 j 2Nk
= ae
n =0
2 k
j xN
N
1 a e N
1 a N
= 2 k
= 2 k
j j
N N
1 ae 1 ae

1. Linearity :
The DFT obeys the law of linearity.
If

8
2. Periodicity

3. Time reversal of a sequence:

9
4. Circular shift of a sequence:

5. Circular frequency shift:

10
6. Multiplication of two sequences:

7. DF of even and odd sequences :


The DFT of an even sequence is purely real.
The DFT of an odd sequence is purely imaginary.
Therefore DFT can be evaluated using cosine and sine transforms for even and
odd sequences respectively.

For even sequence,


N -1
2 nk
X(k) = x(n) cos
n =0 N
For odd sequence,
N -1
2 nk
X(k) = x(n) sin
n =0 N

11
N-point DFT of a finite duration sequence x(n)
of length L, where N L, is defined as,
N1 2 k n
j
DFT{x(n)} = X(k) = x(n)e N
for k = 0,1, 2,....(N-1)
n=0

The Inverse Discrete Fourier Transform (IDFT)


is given by,

1 N 1 j( 2 )kn
x ( n ) = X ( k )e N , n = 0, 1, ...(N - 1)
N k =0

Compute 4-point DFT of causal three sample


sequence given by,
1
, 0n2
x(n) = 3
0, else
N1 2 k n
j
X(k) = x(n)e N
for k = 0,1, 2,....(N-1)
n =0

3 2 k n
j
X (k ) =
n =0
x (n )e 4

12
k 3 k
j j
2 j k 2
X(k ) = x (0) + x (1)e + x ( 2) e + x (3)e
1 j
k

= 1 + e 2 + e j k + 0
3
1 k k
X(k) = 1 + cos j sin + cos k j sin k
3 2 2
The values of X(k) can be evaluated for k = 0, 1, 2, 3

1
When k = 0; X(0) = [3] = 1 0
3
1 j 1
When k = 1; X(1) = [1 j 1] = =
3 3 3 2

1
When k = 2; X(2) = [1 1 + 1] = 1 0
3 3
1
When k = 3; X(3) = [1 + j 1] = j = 1
3 3 3 2

The 4 - point DFT sequence x(n) is given by,


1 1 1
X(k) = 1 0, , 0 ,
3 2 3 3 2
1 1 1
Magnitude, X(k) = 1, , ,
3 3 3

Phase , X(k) = 0, , 0 ,
2 2

13
The 4 - point DFT sequence x(n) is given by,
1 1 1
X(k) = 1 0, , 0 ,
3 2 3 3 2
1 1 1
Magnitude, X(k) = 1, , ,
3 3 3

Phase , X(k) = 0, , 0 ,
2 2


X(k)
. . 2

. . .
0 1 2 3 k


2
0 1 2 3 4 k
Magnitude response Phase response

Ex. Pr:
Find 4 - point DFT of x(n) = {1, 2, 3, 4} and
draw magnitude spectrum.
k 3 k
j j
2 j k 2
X(k ) = x (0) + x (1)e + x ( 2) e + x (3)e
k 3 k
j j
2 j k 2
= 1 + 2e + 3e + 4e

Ans: X(k) = {10, 2.828, 2, 6.32}

14
Find IDFT for X(k) = {3, -1, 3, -1}
1 N 1 j( 2 )kn
x ( n ) = X ( k )e N , n = 0, 1, ...(N - 1)
N k =0
1 3 j( 2 )kn
x ( n ) = X ( k )e N , n = 0, 1, 2, 3
4 k =0

x (n ) =
1
4
[ j( )n j( 3 )n
3 e 2 + 3e jn e 2 ]
x (n ) = {1, 0, 2, 0}

Find the 8-point DFT and IDFT for the given


sequence x(n) = {1, 2, 3, 4}
Solution: N-point DFT is given by,
N1 2 k n
j
X(k) = x(n)e N
for k = 0,1, 2,....(N-1)
n =0

7 k n
j
X(k) = x(n)e 4
for k = 0,1, 2,....7
n =0

15
k k 3 k
j j j
X(k ) = x (0) + x (1)e 4
+ x ( 2) e 2
+ x (3)e 4
+ x ( 4 ) e j k
5k 3k 7k
j j j
4 2 2
+ x (5)e + x ( 6) e + x (7 )e
k k 3 k
j j j
4 2 4
X ( k ) = 1 + 2e + 3e + 4e

For k = 0,
X (0) = 1 + 2 + 3 + 4 = 10
For k = 1,
3
j j j
4 2 4
X (1) = 1 + 2e + 3e + 4e
= - 0.4142 - j 7.2426

k k 3 k
For k = 2, X ( k ) = 1 + 2e
j
4
+ 3e
j
2
+ 4e
j
4

3
j j
X (2) = 1 + 2e 2
+ 3e j + 4e 2

= - 2 + j2
For k = 3,
3 3 9
j j j
X (3) = 1 + 2e 4 + 3e 2 + 4e 4

= 2.4142 - j1.2426

For k = 4,
X(4) = 1 + 2e j + 3e j2 + 4e j3
= 1- 2 + 3 - 4 = - 2

16
k k 3 k
For k = 5, X ( k ) = 1 + 2e
j
4
+ 3e
j
2
+ 4e
j
4

5 5 15
j j j
X (5) = 1 + 2e 4 + 3e 2 + 4e 4

= 2.4142 + j1.2426

3 9
For k = 6, X (6) = 1 + 2e
j
2
+ 3e j3 + 4e
j
2

= - 2 - j2
For k = 7, j
7
j
7
j
21
X(7) = 1 + 2e 4 + 3e 2 + 4e 4

= - 0.4142 + j 7.2426
The 8 - point DFT of the given x(n) is,
X(k) = {10, (- 0.4142 - j 7.2426), (- 2 + j2), (2.4142 - j1.2426),
(- 2), (2.4142 + j1.2426), (- 2 - j2), (- 0.4142 + j 7.2426)}

Pr.: Find the circular convolution of the given


data sequences,
x1(n) = {1, 3, 5, 7} & x2(n) = {2, 4, 6,8}
.
x1(1)=3
x2(3)=8
+
N 1
y(n ) = x1 (k ) x 2 ([n k ]N )
k =0

.
x1(2)=5
x2(2)+
=6
+x2(0)
=2
. x1(0)=1

y(0) = x1(0)x 2(0) + x1(1) x2(3)

.
x+
2(1)=4

x1(3)=7
+ x1(2) x2(2) + x1(3) x2(1)
= 2 + 28 + 30 +24
= 84

17
x1(n) = {1, 3, 5, 7} & x2(n) = {2, 4, 6,8}
y(1) = x1(0)x 2(1) + x1(1) x2(0)
+ x1(2) x2(3) + x1(3) x2(2)

.
x1(1)=3
x2(0)=2
+
= 4 + 42 + 40 +6
= 92

.
x1(2)=5 x (3)
2
=8
+ .
+x=42(1) x1(0)=1

.+
x2(2)=6
x1(3)=7

x1(n) = {1, 3, 5, 7} & x2(n) = {2, 4, 6,8}


y(2) = x1(0)x 2(2) + x1(1) x2(1)
+ x1(2) x2(0) + x1(3) x2(3)

.
x1(1)=3
x2(1)=4
+
= 6 + 56 + 10 +12
= 84

.
x1(2)=5 x2(0)
=2
+ +x2(2)
=6
. x1(0)=1

.+
x2(3)=8
x1(3)=7

18
x1(n) = {1, 3, 5, 7} & x2(n) = {2, 4, 6,8}
y(3) = x1(0)x 2(3) + x1(1) x2(2)
+ x1(2) x2(1) + x1(3) x2(0)

.
x1(1)=3
x2(2)=6
+
= 8 + 14 + 20 +18
= 60

.
x1(2)=5 x2(1)
=4 +
x2(3)
+=8 . x1(0)=1

.+
x2(0)=2
x1(3)=7

y(n) = {84, 92, 84, 60}

Method for computing DFT with reduced number of


calculations.
Decomposition of N-point DFT into successively smaller
DFTs.
In an N-point sequence, if N = rm, then sequence can be
decimated into r-point sequences.
For each r-point sequence, r-point DFTs are computed.
From the results of r-point DFTs, r2-point DFTs are computed.
From the results of r2-point DFTs, r3-point DFTs are computed
and so on until we get rm-point DFT.
Hence, m - number stages of computation and r - radix of
the FFT algorithm.

19
Radix--2 FFT
Radix
Efficient algorithm for computing N-point DFT.
N-point sequence is decimated into 2-point
sequences and the 2-point DFT for each
decimated sequence is computed.
From the results of 2-point DFTs, the 4-point
DFTs are computed.
From the results of 4-point DFTs, the 8-point
DFTs are computed and so on until we get N-
point DFT.

For performing radix-2 FFT, the value of N


should be such that, N - even.
Total number of complex additions = Nlog2N
Total number of complex multiplications
= (N/2) log2N.
For DFT
Total number of complex additions = N(N-1)
Total number of complex multiplications = N2

20
The number of complex multiplications to perform an
N-point DFT using the conventional (DFT) algorithm
and the FFT algorithm.

N DFT FFT
4 16 8
8 64 24
16 256 64
32 1024 160
64 4096 384

Time domain N-point sequence is decimated


into 2 - point sequences - DIT.
DIF:
 N-point sequences---N/2-point sequences---
N/4-point sequences are obtained by
decimation of frequency domain sequences.

21
DIT
DIT--FFT Implementation
 To efficiently implement the FFT
algorithm a few observations are made:
 Each stage has the same number of
butterflies (number of butterflies = N/2, N is
number of points).
 The number of DFT groups per stage is equal
to (N/2stage).
 The number of butterflies in the group is
equal to 2stage
stage--1.

FFT
Chapter 19, Slide 43 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004

FFT Implementation
Example: 8 point FFT

W0 -1

W0 -1

W0 -1 W2 -1

W0 -1
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 44 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

22
FFT Implementation
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1

W0 -1 W2 -1

W0 -1
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 45 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 1
W0 -1 W2 -1

W0 -1
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 46 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

23
FFT Implementation
Stage 1 Stage 2
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 2
W0 -1 W2 -1

W0 -1
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 47 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1

W0 -1
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 48 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

24
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1:
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 49 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1 (1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 1
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 50 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

25
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1 (1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
Block 2
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 2
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 51 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1 (1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
Block 2
W0 -1 W2 -1 (2) Blocks/stage:
Block 3 W0 -1  Stage 1: Nblocks = 3
W0 -1
W1 -1
W0
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 52 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

26
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
Block 1 (1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
Block 2
W0 -1 W2 -1 (2) Blocks/stage:
Block 3 W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0
W0 -1 W2 -1
Block 4
W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 53 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1
Block 1
W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 1
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 54 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

27
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1
Block 1
W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
Block 2 W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 55 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
Block 1
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1

 Decimation in time FFT:


 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 56 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

28
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1:
 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 57 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 58 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

29
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Stage 2: Nbtf = 1
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 59 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Stage 2: Nbtf = 2
 Number of blocks/stage = N/2stage
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 60 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

30
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Stage 2: Nbtf = 2
 Number of blocks/stage = N/2stage
 Stage 3: Nbtf = 1
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 61 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Stage 2: Nbtf = 2
 Number of blocks/stage = N/2stage
 Stage 3: Nbtf = 2
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 62 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

31
FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Stage 2: Nbtf = 2
 Number of blocks/stage = N/2stage
 Stage 3: Nbtf = 3
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 63 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

FFT Implementation
Stage 1 Stage 2 Stage 3
Example: 8 point FFT
(1) Number of stages:
W0 -1

W0 -1
 Nstages = 3
W0 -1 W2 -1 (2) Blocks/stage:
W0 -1  Stage 1: Nblocks = 4
W0 -1
W1 -1
W0  Stage 2: Nblocks = 2
W0 -1 W2 -1

W0 -1 W2 -1 W3 -1
 Stage 3: Nblocks = 1
(3) Bflies/block:
 Decimation in time FFT:
 Stage 1: Nbtf = 1
 Number of stages = log2N
 Stage 2: Nbtf = 2
 Number of blocks/stage = N/2stage
 Stage 3: Nbtf = 4
 Number of butterflies/block = 2stage
stage--1
Chapter 19, Slide 64 Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004
FFT

32
x(0)
x(4) Compute 2-
point DFT
Compute 4-
point DFT X(0)
x(2)
Compute 2- X(1)
x(6) point DFT X(2)
X(3)
Compute 8-
x(1) X(4)
Compute 2- point DFT
X(5)
x(5) point DFT X(6)
Compute 4- X(7)

x(3) point DFT


Compute 2-
x(7) point DFT

Initially, do bit reversal for grouping even &


odd sequences. - j2 k
k
Find Twiddle factor, W = e N N

First stage, (N = 2), k = 0, 1


- j2 ( 0 )
W20 = e 2
=1

Second stage, (N = 4), k = 0, 1, 2, 3


- j2 ( 0 )
W40 = e 4
=1
- j2
1 4
W =e
4 =- j

33
Third stage, (N = 8), k = 0, 1, ..7
- j2 ( 0 ) - j2
W80 = e 8
= 1; W81 = e 8
= 0 .707 j0 . 707
- j4 - j6
W82 = e 8
= - j; W83 = e 8
= 0 .707 j0 .707
x(0) Butterfly diagram
V11(0)

First stage output: X(4)


V11(1)
W20 -1

V11 (0) = x (0) + W20 x (4) V21 (0) = x (1) + W20 x (5)
V11 (1) = x (0) W20 x (4) V21 (1) = x (1) W20 x (5)
V12 (0) = x (2) + W20 x (6) V22 (0) = x (3) + W20 x (7)
V12 (1) = x (2) W20 x (6) V22 (1) = x (3) W20 x (7)

Second stage output:


F1 (0) = V11 (0) + W40 V12 (0) F2 (0) = V21 (0) + W40 V22 (0)
F1 (1) = V11 (1) + W41V12 (1) F2 (1) = V21 (1) + W41V22 (1)
F1 (2) = V11 (0) W40 V12 (0) F2 (2) = V21 (0) W40 V22 (0)
F1 (3) = V11 (1) W41V12 (1) F2 (3) = V21 (1) W41V22 (1)

34
Third stage output:
X ( 0 ) = F1 ( 0 ) + W 80 F2 ( 0 )
X (1) = F1 (1) + W 81 F2 (1)
X ( 2 ) = F1 ( 2 ) + W 82 F2 ( 2 )
X ( 3) = F1 ( 3) + W 83 F2 ( 3)
X ( 4 ) = F1 ( 0 ) W 80 F2 ( 0 )
X ( 5 ) = F1 (1) W 81 F2 (1)
X ( 6 ) = F1 ( 2 ) W 82 F2 ( 2 )
X ( 7 ) = F1 ( 3 ) W 83 F2 ( 3 )

Find 8-point DFT of the sequence


x(n) = {1, 2, 2,1, 1, 2, 2, 1} using DIT-FFT algorithm.
Solution:
Bit reversal: Group odd and even sequences:

Normal Bit reversed


Form Form
x(0) (000) 1 (000) x(0) 1
x(1) (001) 2 (100) x(4) 1
x(2) (010) 2 (010) x(2) 2
x(3) (011) 1 (110) x(6) 2
x(4) (100) 1 (001) x(1) 2
x(5) (101) 2 (101) x(5) 2
x(6) (110) 2 (011) x(3) 1
x(7) (111) 1 (111) x(7) 1

35
Bit reversed
Form
Find Twiddle factor: (000) x(0) 1
- j2 ( 0 ) - j2 ( 0 ) - j2 (100) x(4) 1
W20 = e 2
= 1 W40 = e 4
= 1; W41 = e 4
=- j (010) x(2) 2
- j2 ( 0 ) - j2 (110) x(6) 2
W80 = e 8
= 1; W81 = e 8
= 0 .707 j0 .707 (001) x(1) 2
- j4 - j6 (101) x(5) 2
W82 = e 8
= - j; W83 = e 8
= 0 .707 j0 . 707 (011) x(3) 1
(111) x(7) 1
First stage output:
V11 (0) = x (0) + W20 x (4) = 2 V21 (0) = x (1) + W20 x (5) = 4
V11 (1) = x (0) W20 x (4) = 0 V21 (1) = x (1) W20 x (5) = 0

V12 (0) = x (2) + W20 x (6) = 4 V22 (0) = x (3) + W20 x (7) = 2
V12 (1) = x (2) W20 x (6) = 0 V22 (1) = x (3) W20 x (7) = 0

Bit reversed
Form
2
x(0) (000) x(0) 1
(100) x(4) 1
x(4)
0
1 -1 (010) x(2) 2
W20
x(2)
4 (110) x(6) 2
(001) x(1) 2
0 (101) x(5) 2
x(6) W 0 1 -1
2
4 (011) x(3) 1
x(1)
(111) x(7) 1

x(5) 0
W20 1 -1
x(3)
2

x(7) 0
W20 1 -1

36
Second stage output:
F1 (0) = V11 (0) + W40 V12 (0) = 6 F2 (0) = V21 (0) + W40 V22 (0) = 6
F1 (1) = V11 (1) + W41V12 (1) = 0 F2 (1) = V21 (1) + W41V22 (1) = 0
F1 (2) = V11 (0) W40 V12 (0) = 2 F2 (2) = V21 (0) W40 V22 (0) = 2
F1 (3) = V11 (1) W41V12 (1) = 0 F2 (3) = V21 (1) W41V22 (1) = 0

V11 (0) = x (0) + W20 x (4) = 2 V21 (0) = x (1) + W20 x (5) = 4
V11 (1) = x (0) W20 x ( 4) = 0 V21 (1) = x (1) W20 x (5) = 0

V12 (0) = x (2) + W20 x (6) = 4 V22 (0) = x (3) + W20 x (7) = 2
V12 (1) = x (2) W20 x (6) = 0 V22 (1) = x (3) W20 x (7) = 0

2 6
x(0) 1

0 0
x(4) 1 -1
W20
4 -2
x(2) 1 -1
W40 1

0 0
x(6) W 0 1 -1 -j -1
2 W41
4 6
x(1) 1

x(5) 0 0
W20 1 -1
2 2
x(3) 1 1 -1
0
W 4

x(7) 0 0
W20 1 -1 W41 -j -1

37
Third stage output:
X ( 0 ) = F1 ( 0 ) + W 80 F2 ( 0 ) = 12
X (1) = F1 (1) + W 81 F2 (1) = 0
X ( 2 ) = F1 ( 2 ) + W 82 F2 ( 2 ) = 2 2 j
X ( 3) = F1 ( 3) + W 83 F2 ( 3) = 0 F1 (0) = V11 (0) + W40 V12 (0) = 6

0 F1 (1) = V11 (1) + W41V12 (1) = 0


X ( 4 ) = F1 ( 0 ) W F2 ( 0 ) = 0
8 F1 (2) = V11 (0) W40 V12 (0) = 2
F1 (3) = V11 (1) W41V12 (1) = 0
X ( 5 ) = F1 (1) W 81 F2 (1) = 0
F2 (0) = V21 (0) + W40 V22 (0) = 6
2
X ( 6 ) = F1 ( 2 ) W F2 ( 2 ) = 2 + 2 j
8 F2 (1) = V21 (1) + W41V22 (1) = 0
F2 (2) = V21 (0) W40 V22 (0) = 2
X ( 7 ) = F1 ( 3 ) W 83 F2 ( 3 ) = 0 F2 (3) = V21 (1) W41V22 (1) = 0

2 6 X(0)=12
x(0) 1

0 0 X(1)= 0
x(4) 1 -1
W20
4 -2
x(2) 1 -1 X(2)
1
W40 = - 2j2
0 0
x(6) W 0 1 -1 -j -1 X(3)= 0
2 W41
4 6
x(1) 1 1 -1 X(4)=0
W80

x(5) 0 0
W20 1 -1 W81 0.707 - j 0.707 -1 X(5)= 0
2 2
x(3) 1 1 -1 -j -1 X(6)
W40 W82
= - 2+j2
x(7) 0 0
W20 1 -1 W41 -j -1 W83 - 0.707 - j 0.707 -1 X(7)= 0

X(k) = {12, 0, (-2 - j2), 0, 0, 0, (-2 + j2), 0}

38
Find 8-point DFT of the sequence x(n) = {2, 1, 4, 6, 5, 8, 3, 9}
using DIT-FFT algorithm.
Solution:
Bit reversal: Group odd and even sequences:

Normal Bit reversed


Form Form
x(0) (000) 2 (000) x(0) 2
x(1) (001) 1 (100) x(4) 5
x(2) (010) 4 (010) x(2) 4
x(3) (011) 6 (110) x(6) 3
x(4) (100) 5 (001) x(1) 1
x(5) (101) 8 (101) x(5) 8
x(6) (110) 3 (011) x(3) 6
x(7) (111) 9 (111) x(7) 9

Bit
reversed
Form
Find Twiddle factor: (000) x(0) 2
- j2 ( 0 ) - j2 ( 0 ) - j2
W20 = e 2
= 1 W40 = e 4
= 1; W41 = e 4
=- j
(100) x(4) 5
(010) x(2) 4

- j2 ( 0 ) - j2 (110) x(6) 3
0 8 1 8
W =e
8 = 1; W = e
8 = 0 .707 j0 .707 (001) x(1) 1
- j4 - j6 (101) x(5) 8
W82 = e 8
= - j; W83 = e 8
= 0 .707 j0 . 707 (011) x(3) 6
(111) x(7) 9
First stage output:
V11 (0) = x (0) + W20 x (4) = 7 V21 (0) = x (1) + W20 x (5) = 9
V11 (1) = x (0) W20 x (4) = 3 V21 (1) = x (1) W20 x (5) = 7

V12 (0) = x (2) + W20 x (6) = 7 V22 (0) = x (3) + W20 x (7) = 15
V12 (1) = x (2) W20 x (6) = 1 V22 (1) = x (3) W20 x (7) = 3

39
7 Bit
x(0) 1 reversed
Form
x(4)
-3 (000) x(0) 2
W20 1 -1
x(2)
7 (100) x(4) 5
1
(010) x(2) 4
1 (110) x(6) 3
x(6) W 0 1 -1
2 (001) x(1) 1
9
x(1) 1 (101) x(5) 8
(011) x(3) 6
x(5) -7
W 0 1 -1 (111) x(7) 9
2
x(3)
15
1

x(7) -3
W20 1 -1

Second stage output:


F1 (0) = V11 (0) + W40 V12 (0) = 14 F2 (0) = V21 (0) + W40 V22 (0) = 24
1
F1 (1) = V11 (1) + W41V12 (1) = 3 j F2 (1) = V21 (1) + W4 V22 (1) = 7 + j3
F1 ( 2) = V11 (0) W40 V12 (0) = 0 F2 (2) = V21 (0) W40 V22 (0) = 6
1
F1 (3) = V11 (1) W41V12 (1) = 3 + j F2 (3) = V21 (1) W4 V22 (1) = 7 j3

V11 (0) = x (0) + W20 x (4) = 7 V21 (0) = x (1) + W20 x (5) = 9
V11 (1) = x (0) W20 x (4) = 3 V21 (1) = x (1) W20 x (5) = 7

V12 (0) = x (2) + W20 x (6) = 7 V22 (0) = x (3) + W20 x (7) = 15
V12 (1) = x (2) W20 x (6) = 1 V22 (1) = x (3) W20 x (7) = 3

40
7 14
x(0) 1

-3 -3-j
x(4) 1 -1
W20
7 0
x(2) 1 -1
W40 1

1 -3+j
x(6) W 0 1 -1 -j -1
2 W41
9 24
x(1) 1

x(5) -7 -7+j3
W20 1 -1
15 -6
x(3) 1 1 -1
W40

x(7) -3 -7-j3
W20 1 -1 W41 -j -1

Third stage output:

X(0) = F1 (0) + W80 F2 (0) = 38


X(1) = F1 (1) + W81F2 (1) = 5.828 + j6.07
F1 (0) = V11 (0) + W40 V12 (0) = 14
X(2) = F1 (2) + W82 F2 (2) = j6 F1 (1) = V11 (1) + W41V12 (1) = 3 j
3 F1 (2) = V11 (0) W40 V12 (0) = 0
X(3) = F1 (3) + W F (3) = 0.172 + j0.807
8 2
F1 (3) = V11 (1) W41V12 (1) = 3 + j
X(4) = F1 (0) W80 F2 (0) = 10
X(5) = F1 (1) W81F2 (1) = 0.172 j0.807
X(6) = F1 (2) W82 F2 (2) = j6 F2 (0) = V21(0) + W40V22 (0) = 24
F2 (1) = V21(1) + W41V22 (1) = 7 + j3
X(7) = F1 (3) W83 F2 (3) = 5.828 j6.07
F2 (2) = V21(0) W40V22 (0) = 6
F2 (3) = V21(1) W41V22 (1) = 7 j3

41
2 6
x(0) 1

0 0
x(4) 1 -1
4 -2
x(2) 1 -1
W40 1

0 0
x(6) 1 -1 -j -1
W41
4 6
x(1) 1

x(5) 0 0
1 -1
2 2
x(3) 1 1 -1
W40

x(7) 0 0
1 -1 W41 -j -1

X(k) = {38, -5.828+j6.07, j6, -0.172+j8.07, -10,


-0.172-j8.07, -j6, -5.828-j6.07}

X(0)=38

X(1)=
-5.828+j6.07
X(2) = j6

X(3)
=- 0.172+j8.07
1 -1 X(4)= -10
W80
X(5)=
W81 0.707 - j 0.707 -1 - 0.172-j8.07

W82 -j -1 X(6)= -j6

X(7)=
W83 - 0.707 - j 0.707 -1 -5.828-j6.07

42
7 14 X(0)=38
x(0) 1

-3 -3-j X(1)=
x(4) 1 -1
W 0
2
-5.828+j6.07
7 0
x(2) 1 -1 X(2) = j6
W40 1

1 -3+j X(3)
x(6) W 0 1 -1 1 -j -1 =- 0.172+j8.07
2 W 4
9 24
x(1) 1 1 -1 X(4)= -10
W80

x(5) -7 -7+j3 X(5)=


W 0 1 -1 W81 0.707 - j 0.707 -1 - 0.172-j8.07
2
15 -6
x(3) 1 1 -1 X(6)= -j6
W40 -1 W82 -j

x(7) -3 -7-j3 X(7)=


W20 1 -1 W41 -j -1 W83 - 0.707 - j 0.707 -1 -5.828-j6.07

X(k) = {38, -5.828+j6.07, j6, -0.172+j8.07, -10,


-0.172-j8.07, -j6, -5.828-j6.07}

Difference between DIT and DIF FFT algorithm

In this algorithm, the N-point time domain sequence is


converted to two groups of N/2 point sequences, then
each N/2 point sequence is converted to two groups of
N/4-point sequences.
This process continues until we get N/2 groups of 2-
point sequences. Finally 2-point DFT of each 2-point
sequence is computed.

In DIF, the input is in natural order and the output is


in bit reversed form.
Complex multiplication takes place after addition
/subtraction

43
d11(0) Compute 2- x(0)
g1(0)
Compute d11(1) point x(4)
g1(1) two groups sequence
X(0) g1(2) of 2-point Compute 2-
d12(0) x(2)
X(1) g1(3) DFT point
X(2)
Compute d12(1) x(6)
two groups sequence
X(3)
X(4)
of 4-point Compute 2-
g2(0) d21(0) x(1)
X(5) DFT g2(1) point
d21(1)
g2(2)
Compute sequence x(5)
X(6)
X(7) g2(3)
two groups
of 2-point d22(0) Compute 2- x(3)
DFT point x(7)
d22(1)
sequence

First stage output:


g 1 ( 0) = x ( 0) + x ( 4)
g1 (1) = x (1) + x (5)
g 1 ( 2) = x ( 2) + x ( 6)
g1 (3) = x (3) + x (7)
g 2 (0) = [x (0) x (4)]W80
g 2 (1) = [x (1) x (5)]W81
g 2 (2) = [x (2) x (6)]W82
g 2 (3) = [x (3) x (7)]W83

44
Second stage output:
d11 (0) = g1 (0) + g1 (2) d 21 (0) = g 2 (0) + g 2 (2)
d11 (1) = g1 (1) + g1 (3) d 21 (1) = g 2 (1) + g 2 (3)
d12 (0) = [g1 (0) g1 (2)]W 0
4 d 22 (0) = [g 2 (0) g 2 (2)]W40
d12 (1) = [g1 (1) g1 (3)]W41 d 22 (1) = [g 2 (1) g 2 (3)]W41

Third stage output:


X (0) = d11 (0) + d11 (1) X (2) = d12 (0) + d12 (1)
X (4) = [d11 (0) d11 (1)]W 0
2 X (6) = [d12 (0) d12 (1)]W20
X (1) = d 21 (0) + d 21 (1) X (3) = d 22 (0) + d 22 (1)
X (5) = [d 21 (0) d 21 (1)]W 0
2 X (7) = [d 22 (0) d 22 (1)]W20

Compute 8-point DFT using DIF FFT


algorithm for the following sequence:
x(n)={1, 2, 3, 4, 4, 3, 2, 1}

45
x(n)={1, 2, 3, 4, 4, 3, 2, 1}
x(0) 5 10 20
1

x(1) 5 10 0
1
x(2) 5 0 0
W40 1 1

x(3) 5 0 0
W41 -j 1
x(4) -3 -3-j -5.828
1 1 -j 2.414
W80
-2.828 -j 1.414 -0.172
x(5) -0.707 + j 0.707 +j 0.414
W81 0.707 - j 0.707 1
x(6) -j -3+j -0.172
W82 -j W40 1 1 -j 0.414
2.828 -j 1.414
x(7) -2.121 j2.121 -5.828
W83 - 0.707 - j 0.707 W41 -j 1 +j 2.414

X(k) = {20, -5.828-j2.414, 0, -0.172-j0.414, 0, -0.172+j0.414,


10/5/2012 0, -5.828+j2.414}
S. 91

46

Potrebbero piacerti anche