Lect - 4
Lect - 4
Sem. II, 2017 E.C Electrical and Computer Engineering DSP By: Waltengus A.
DFT Algorithm
Conversion of DFT to FFT Algorithm
Decimation in Time (DIT) FFT algorithms
Implementation of the DIT-FFT algorithm
Decimation in frequency (DIF) FFT Algorithms
Comparison of DIT and DFT-FFT Algorithms
DFT and FFT
FFT is an algorithm to convert a time domain signal
to DFT efficiently.
6
Performance of the DFT Algorithm
The DFT requires N2 (N x N) complex multiplications:
Each X(k) requires N complex multiplications.
The DFT also requires (N-1)*N complex additions:
Each X(k) requires N-1 additions.
9
FFT algorithm provides speed increase factors, when compared
with direct computation of the DFT, of approximately 64 and 205
for 256-point and 1024-point transforms respectively.
The number of multiplications and additions required to compute
N-point DFT using radix-2 FFT are N/2 log2N and Nlog2N
respectively.
Example: for n=64
The number of complex multiplications required using direct
computation is
N2=642 =4096
The number of complex multiplications required using FFT is
N/2log2 N=64/2log2 64=192
Speed improvement factor =4096/192= 21.33
10
Fast Fourier Transform Algorithms
11
1. Decimation in Time (DIT) FFT
DIT algorithm is used to calculate the DFT of a N-point
sequence.
The idea is to break the N-point sequence into two
sequences, the DFTs of which can be obtained to give the
DFT of the original N-point sequence.
Initially the N-point sequence is divided into N/2-point
sequences xe(n) and x0(n) ,which have even and odd
numbers of x(n) respectively.
37
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 difference between the upper and lower leg is equal to 2stage-1.
The number of butterflies in the group is equal to 2stage-1.
Number of Operations
Stage 1
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
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
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
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
46
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
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
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
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
50
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
W0 -1 W2 -1 W3 -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
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) B’flies/block:
Decimation in time FFT:
Stage 1:
Number of stages = log2N
Number of blocks/stage = N/2stage
Number of butterflies/block = 2stage-1
54
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) B’flies/block:
Decimation in time FFT:
Stage 1: Nbtf = 1
Number of stages = log2N
Number of blocks/stage = N/2stage
Number of butterflies/block = 2stage-1
55
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) B’flies/block:
Decimation in time FFT:
Stage 1: Nbtf = 1
Number of stages = log2N
Number of blocks/stage = N/2stage Stage 2: Nbtf = 1
Number of butterflies/block = 2stage-1
56
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) B’flies/block:
Decimation in time FFT:
Stage 1: Nbtf = 1
Number of stages = log2N
Number of blocks/stage = N/2stage Stage 2: Nbtf = 2
Number of butterflies/block = 2stage-1
57
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) B’flies/block:
Decimation in time FFT:
Stage 1: Nbtf = 1
Number of stages = log2N
Number of blocks/stage = N/2stage Stage 2: Nbtf = 2
Number of butterflies/block = 2stage-1 Stage 3: Nbtf = 1
58
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) B’flies/block:
Decimation in time FFT:
Stage 1: Nbtf = 1
Number of stages = log2N
Number of blocks/stage = N/2stage Stage 2: Nbtf = 2
Number of butterflies/block = 2stage-1 Stage 3: Nbtf = 2
59
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) B’flies/block:
Decimation in time FFT:
Stage 1: Nbtf = 1
Number of stages = log2N
Number of blocks/stage = N/2stage Stage 2: Nbtf = 2
Number of butterflies/block = 2stage-1 Stage 3: Nbtf = 3
60
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) B’flies/block:
Decimation in time FFT:
Number of stages = log2N
Stage 1: Nbtf = 1
Number of blocks/stage = N/2stage Stage 2: Nbtf = 2
Number of butterflies/block = 2stage-1
Stage 3: Nbtf = 4
61
Stage 1 Stage 2 Stage 3
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
Start Index 0 0 0
Input Index 1 2 4
Twiddle Factor Index
62
Stage 1 Stage 2 Stage 3
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
Start Index 0 0 0
Input Index 1 2 4
Twiddle Factor Index N/2 = 4 4 /2 = 2
63
Stage 1 Stage 2 Stage 3
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
Start Index 0 0 0
Input Index 1 2 4
Twiddle Factor Index N/2 = 4 4 /2 = 2 2 /2 = 1
64
Stage 1 Stage 2 Stage 3
W0 -1
W0 -1
W0 -1 W2 -1
W0 -1
W0 -1 W1 -1
W0
W0 -1 W2 -1
Start Index W0 -1 W2 -1 W3 -1
Input Index
0 0 0
Twiddle Factor Index 1 2 4
Indicies Used N/2 = 4 4 /2 = 2 2 /2 = 1
W0 W0
W2
65
Example: Compute the eight DFT of the sequence below by using DIT
FFT algorithm.
Ans:
2. Decimation-in-Frequency (DIF) FFT
In this the output sequence x(k) is divided into smaller and
smaller subsequences, that is why the name decimation in
frequency,
67
68
69
70
71
72
74
Example: Compute the eight DFT of the sequence X(k) = [8,0,0,0,0,0,0,0,] by
76
using DIF FFT algorithm.
77