Segment-6 Discrete Fourier Transform (DFT) & Fast Fourier Transform (FFT)
Segment-6 Discrete Fourier Transform (DFT) & Fast Fourier Transform (FFT)
Segment-6
Discrete Fourier Transform (DFT) &
Fast Fourier Transform (FFT)
Prepared By
Mohammed Abdul kader
Assistant Professor, Dept. of EEE, IIUC
Contents
Fourier Analysis
Discrete Fourier Transform (DFT)
Difference between DTFT and DFT.
The DFT as linear Transformation.
Problems related to DFT and IDFT
Circular convolution
Fast Fourier Transform
Decimation in Time FFT Algorithm
Reference Book:
Digital Signal Processing (4th Edition), John G. Proakis, Dimitris K Manolakis
Chapter 7 (Discrete Fourier Transform) and
Chapter 8(Efficient Computation of the DFT)
Digital Signal Processing, Barrie Jervis
Chapter-2 (Discrete Transforms)
2
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Fourier Analysis
Fourier analysis convert a time domain signal into frequency domain signal.
Can be divided into 4 types:
a) Aperiodic continuous.
b) Periodic continuous (Fourier Series).
c) Aperiodic Discrete (DTFT).
d) Periodic Discrete (DFT)
3 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
DFT
Discrete Fourier Transform
The discrete Fourier transform of a discrete-time signal x(n) is defined as
𝑁−1
2𝜋𝑛𝑘
−𝑗 𝑁 K=0, 1, ….., N-1
𝑋 𝑘 = 𝑥(𝑛)𝑒
𝑛=0
𝑁−1
1 2𝜋𝑛𝑘
𝑗 𝑁
𝑥 𝑛 = 𝑋(𝑘)𝑒 , 𝑛 = 0,1, … … … 𝑁 − 1
𝑁
𝑛=0
DFT
𝑥(𝑛) 𝑋(𝑘)
Time Domain IDFT Frequency Domain
4
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Difference between DTFT and DFT
+∞
𝑁−1
𝑋 𝜔 = 𝑥(𝑛)𝑒 −𝑗𝜔𝑛 −𝑗
2𝜋𝑛𝑘
𝑋 𝑘 = 𝑥(𝑛)𝑒 𝑁
𝑛=−∞
𝑛=0
5
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The DFT as a Linear Transformation
𝑁−1
2𝜋𝑛𝑘
−𝑗
The N-Point DFT is defined as 𝑋 𝑘 = 𝑥(𝑛)𝑒 𝑁
𝑛=0
𝑁−1
The above expression also written as 𝑋 𝑘 = 𝑥(𝑛)𝑊𝑁𝑛𝑘
𝑛=0
2𝜋𝑛𝑘
−𝑗 𝑁
Where, 𝑊𝑁𝑛𝑘 = 𝑒 Is called the twiddle factor
If N=4 we say it is 4-Point DFT. For N=4, the above expression can be written as
3
𝑋 𝑘 = 𝑥(𝑛)𝑊4𝑛𝑘
𝑛=0
6
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The DFT as a Linear Transformation (cont.)
𝑊43
𝑋0 1 1 1 . . 1 𝑥(0)
𝑋1 1 𝑊𝑁1 𝑊𝑁2 . . 𝑊𝑁𝑁−1 𝑥(1)
𝑋2 2(𝑁−1)
1 𝑊𝑁2 𝑊𝑁4 . . 𝑊𝑁 𝑥(2)
𝑋3 =
. . . . . . .
.
. . . . . . .
. 2(𝑁−1) (𝑁−1)(𝑁−1)
1 𝑊𝑁𝑁−1 𝑊𝑁 . . 𝑊𝑁 𝑥(𝑁 − 1)
𝑋(𝑁 − 1)
The N-point DFT may be expressed in matrix form as:
Where 𝑊𝑁 is the matrix of the linear transformation. If we assume that the inverse of 𝑊𝑁 exists,
we obtain
8
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on DFT
Example 7.1.3: Compute the DFT of the 4-point sequence
x(n)={0,1,2,3}
Solution:
The matrix of the linear transformation for 4-point DFT can be expressed as
Now, Using the matrix expression 𝑋𝑁 = 𝑊𝑁 𝑥𝑁 , we can calculate DFT of the above sequence as
𝑋(0) 1 1 1 1 0 0+1+2+3 6
𝑋(1) 1 −𝑗 −1 𝑗 1 0 − 𝑗 − 2 + 3𝑗 −2 + 2𝑗
= = =
𝑋 2 1 −1 1 −1 2 0−1+2−3 −2
𝑋(3) 1 𝑗 −1 −𝑗 3 0 + 𝑗 − 2 − 3𝑗 −2 − 2𝑗
9 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on IDFT
Problem: The 4-point DFT of a discrete time sequence x(n) is given below. Determine
x(n).
Solution: X(k)={6,-2+2j,-2,-2-2j}
The matrix of the linear transformation for 4-point DFT can be expressed as
If we multiply the two DFTs together, the result is a DFT say 𝑋3 𝑘 , of a sequence 𝑥3 (𝑛) of length N.
Let us determine the relationship between 𝑥3 (𝑛) and the sequences 𝑥1 (𝑛) and 𝑥2 (𝑛).
11
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Multiplication of Two DFTs and Circular Convolution (Cont.)
Putting the value 𝑋1 (𝑘) and 𝑋2 (𝑘)
We can write
Where,
12 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Multiplication of Two DFTs and Circular Convolution (Cont.)
The above expression has the form of a convolution sum. However it is not the ordinary linear
convolution which relates the output sequence y(n) of a linear system to the input sequence x(n) and
impulse response h(n). The above expression involves the index (𝒎 − 𝒏)𝑵 and is called
circular convolution. Multiplication of DFTs of two sequences is equivalent to the
circular convolution of the two sequences in the time domain.
13
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on Circular Convolution
Problem: Compute the circular convolution of following two sequences
Solution:
We can represent the sequences in graph where the samples are placed in counterclockwise direction
in a circle
14 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on Circular Convolution (Cont.)
𝐱 𝟑 𝟎 = 𝟐 + 𝟒 + 𝟔 + 𝟐 = 𝟏𝟒
15 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on Circular Convolution (Cont.)
𝐱 𝟑 𝟏 = 𝟒 + 𝟏 + 𝟖 + 𝟑 = 𝟏𝟔
𝐱 𝟑 𝟐 = 𝟔 + 𝟐 + 𝟐 + 𝟒 = 𝟏𝟒
16
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on Circular Convolution (Cont.)
𝐱 𝟑 𝟑 = 𝟖 + 𝟑 + 𝟒 + 𝟏 = 𝟏𝟔
17 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Alternative method of computing Circular Convolution
Solution:
𝑥3 (0) 2 1 2 1 1 2+2+6+4 14
𝑥3 (1) 1 2 1 2 2 1+4+3+8 16
= = =
𝑥3 (2) 2 1 2 1 3 2+2+6+4 14
𝑥3 (3) 1 2 1 2 4 1+4+3+8 16
18 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Zero padding
Zero padding is a simple concept, it simply refers to adding zeros to end of a time domain signals to
increase its length.
19 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Computation of linear convolution by circular convolution
Compute the linear convolution of the following two sequences by circular
convolution
Solution:
Length of convolution sequence = 4+41=7
Start of sequence= min (min(x(n)) min(h(n))) =-1
After zero padding: 𝑥 (𝑛) = {1,2, 3,1,0,0,0} ℎ (𝑛) = {1,2, 1, −1,0,0,0}
↑ ↑
𝑦 −1 1 0 0 0 1 3 2 1 1
𝑦 0 2 1 0 0 0 1 3 2 4
𝑦 1 3 2 1 0 0 0 1 1 8
𝑦 2 = 1 3 2 1 0 0 0 −1 = 8
𝑦(3) 0 1 3 2 1 0 0 0 3
𝑦(4) 0 0 1 3 2 1 0 0 −2
𝑦(5) 0 0 0 1 3 2 1 0 −1
20 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Fast Fourier Transform (FFT)
A Fast Fourier Transform (FFT) is an efficient algorithm to compute the Discrete Fourier Transform
(DFT) and inverse of DFT. FFT requires a smaller number of arithmetic operations such as
multiplications and addition than DFT (i.e. FFT requires lesser computation time than DFT).
Multiplications: 𝑁 2 𝑁
Multiplications: 2 𝑙𝑜𝑔2 (𝑁)
Additions: N(N-1)
Additions: 𝑁 𝑙𝑜𝑔2 (𝑁)
For, 𝑁 = 106
Total mathematical operations required to find DFT
Direct DFT: 1012 + 106 106 − 1 ≈ 2 × 1012
FFT: (5 × 105 × 𝑙𝑜𝑔2 (106 ) + 106 × 𝑙𝑜𝑔2 (106 ) ≅ 24 × 106
If each mathematical operation needs 1 ns to compute by digital computer,
Direct DFT needs 2 × 1012 𝑛𝑠 = 2 × 103 𝑠 = 2000𝑠
Whether FFT algorithm needs 24 × 106 ns = 24 × 10−3 𝑠 = 0.024 𝑠
21
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Fast Fourier Transform (FFT) Algorithm
Direct computation of the DFT is less efficient because it does not exploit the properties of
symmetry and periodicity of the phase factor 𝑊𝑁𝑛𝑘
FFT algorithms exploit the above properties of phase factor to reduce the number of mathematical
calculations to compute DFT. There are many FFT algorithm which involves a wide range of
mathematics.
On the basis of decimation (decimation means decomposition into decimal parts) process FFT
algorithms are two types.
Decimation-in-Time FFT algorithm: The sequence x(n) will be broken up into odd numbered
and even numbered subsequences. This algorithm was first proposed by Cooley and Tukey in 1965.
Decimation-in-Frequency algorithm: The sequence x(n) will be broken up into two equal
halves. This algorithm was first proposed by Gentlemen and Sande in 1966.
22
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The decimation in time FFT Algorithm
Cooley-Tukey Algorithm
X(k)
𝑁−1
2𝜋𝑛𝑘
−𝑗 𝑁 ,
𝑋 𝑘 = 𝑥𝑛 𝑒 𝑘 = 0,1, … , 𝑁 − 1 Xe(k) Xo(k)
𝑛=0
23
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The decimation in time FFT Algorithm (Cont.)
𝑁
𝑋𝑒 𝑘 = 𝑋𝑒𝑒 𝑘 + 𝑊𝑁𝑘 𝑋𝑒𝑜 𝑘 , 𝑘 = 0 𝑡𝑜 −1
2 2
𝑋𝑒𝑒 0 = 𝑥𝑜 + 𝑥4 𝑋𝑒𝑜 0 = 𝑥2 + 𝑥6 2𝜋
Stage-1
−𝑗 2 .1
𝑊𝑁1 = 𝑊21 = 𝑒
𝑋𝑒𝑒 1 = 𝑥𝑜 − 𝑥4 𝑋𝑒𝑜 1 = 𝑥2 − 𝑥6 4
= −1
𝑁
𝑋𝑜 𝑘 = 𝑋𝑜𝑒 𝑘 + 𝑊𝑁𝑘 𝑋𝑜𝑜 𝑘 , 𝑘 = 0 𝑡𝑜 −1
2
2
𝑋𝑜𝑒 1 = 𝑥1 − 𝑥5 𝑋𝑜𝑜 1 = 𝑥3 − 𝑥7
24 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The decimation in time FFT Algorithm (Cont.)
𝑁
𝑋𝑒 𝑘 = 𝑋𝑒𝑒 𝑘 + 𝑊𝑁𝑘 𝑋𝑒𝑜 𝑘 , 𝑘 = 0 𝑡𝑜 −1
2 2
0 𝑋𝑒𝑒 2 = 𝑥𝑜 + 𝑊𝑁2 𝑥4
𝑋𝑒 0 = 𝑋𝑒𝑒 0 + 𝑊8/2 𝑋𝑒𝑜 0 = 𝑋𝑒𝑒 0 + 𝑊80 𝑋𝑒𝑜 0 4
= 𝑥𝑜 + 𝑊22
𝑥4 = 𝑥𝑜 + 𝑥4
𝑋𝑒 1 = 𝑋𝑒𝑒 1 + 𝑊81 𝑋𝑒𝑜 1 = 𝑋𝑒𝑒 1 + 𝑊82 𝑋𝑒𝑜 1 = 𝑋𝑒𝑒 0
2
𝑋𝑒𝑜 2 = 𝑋𝑒𝑜 0
𝑋𝑒 2 = 𝑋𝑒𝑒 2 + 𝑊82 𝑋𝑒𝑜 2 = 𝑋𝑒𝑒 0 − 𝑊80 𝑋𝑒𝑜 0 2
2𝜋4
−𝑗 8
2 𝑊8 = 𝑒 = −1
2
Stage-2
𝑋 𝑘 = 𝑋𝑒 𝑘 + 𝑊𝑁𝑘 𝑋𝑜 𝑘 ,
26 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The decimation in time FFT Algorithm (Cont.)
8-point decimation in time FFT Algorithm
𝑿𝒆𝒆 (𝟎) 𝑿𝒆 (𝟎)
𝒙𝒐
𝑿𝒆𝒆 (𝟏) 𝑿𝒆 (𝟏)
𝒙𝟒
𝑿𝒆𝒐 (𝟎) 𝑿𝒆 (𝟐)
𝒙𝟐
𝑊80
𝑿𝒆𝒐 (𝟏) 𝑿𝒆 (𝟑)
𝒙𝟔
𝑊82
𝑿𝒐𝒆 (𝟎) 𝑿𝒐 (𝟎)
𝒙𝟏
𝑊80
𝑿𝒐𝒆 (𝟏) 𝑿𝒐 (𝟏)
𝒙𝟓
𝑊81
𝑿𝒐𝒐 (𝟎) 𝑿𝒐 (𝟐)
𝒙𝟑 𝑊80 𝑊82
𝑿𝒐𝒐 (𝟏) 𝑿𝒐 (𝟑)
𝒙𝟕 𝑊82 𝑊83
27
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The decimation in time FFT Algorithm (Cont.)
Reduction of computational complexity
The basic computation performed at every stage
(previous fig: 8-point DIT FFT algorithm) is to take two
complex numbers, say the pair (a,b), multiply b by 𝑊𝑁𝑟 ,
and then add and subtract the product from a to form
Fig: Basic butterfly computation in
two new complex numbers (A,B). This basic
the decimation-in-time FFT
computation is called a butterfly because the flow algorithm
graph resembles a butterfly.
In general, each butterfly involves one complex multiplication and two complex additions. For N
point FFT, there are N/2 butterflies per stage of the computation process and 𝑙𝑜𝑔2 (𝑁) stages.
Therefore,
𝑁
Total number of complex multiplications is 𝑙𝑜𝑔2 (𝑁)
2
28
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The decimation in time FFT Algorithm (Cont.)
Comparison of Computational Complexity for the Direct Computation of the DFT
Versus the FFT Algorithm
29 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on FFT
Problem: For the discrete time sequence x(n)={1,1,1,0,0,0,0,0}, find the 8-point
DFT using DIT-FFT algorithm.
Solution:
Even 𝑥0 𝑥4 𝑥2 𝑥6
Part 1 0 1 0
Odd 𝑥1 𝑥5 𝑥3 𝑥7
Part 1 0 0 0
Stage-1: 𝑋𝑒𝑒 0 = 𝑥𝑜 + 𝑥4 =1
𝑋𝑒𝑒 1 = 𝑥𝑜 − 𝑥4 = 1
𝑋𝑒𝑜 0 = 𝑥2 + 𝑥6 = 1
𝑋𝑒𝑜 1 = 𝑥2 − 𝑥6 = 1
𝑋𝑜𝑒 0 = 𝑥1 + 𝑥5 = 1
𝑋𝑜𝑒 1 = 𝑥1 − 𝑥5 = 1
𝑋𝑜𝑜 0 = 𝑥3 + 𝑥7 = 0
𝑋𝑜𝑜 1 = 𝑥3 − 𝑥7 = 0
30
Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on FFT (Cont.)
𝜋
−𝑗 2
Stage-2 𝑊82 = 𝑒 = −𝑗
31 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Problem on FFT (Cont.)
Stage-3
−𝑗
𝜋 1 1 3𝜋 1 1
𝑊81 = 𝑒 4 = −𝑗 𝑊83 = 𝑒 −𝑗 4
=− −𝑗
√2 √2 √2 √2
𝑋 0 = 𝑋𝑒 0 + 𝑊80 𝑋𝑜 0 =3
1 1
𝑋 1 = 𝑋𝑒 1 + 𝑊81 𝑋𝑜 1 =1−j+( −𝑗 )
2 2
𝑋 2 = 𝑋𝑒 2 + 𝑊82 𝑋𝑜 2 = −𝑗
1 1
𝑋 3 = 𝑋𝑒 3 + 𝑊83 𝑋𝑜 3 = 1 + 𝑗 + (− −𝑗 )
2 2
𝑋 4 = 𝑋𝑒 0 − 𝑊80 𝑋𝑜 0 = 2 − 1 = 1
1
1 1
𝑋 5 = 𝑋𝑒 1 − 𝑊8 𝑋𝑜 1 = 1 − 𝑗 − ( − 𝑗 )
2 2
𝑋 6 = 𝑋𝑒 2 − 𝑊82 𝑋𝑜 2 = 𝑗
1 1
𝑋 7 = 𝑋𝑒 3 − 𝑊83 𝑋𝑜 3 = 1 + 𝑗 − (− −𝑗 )
2 2
32 Lecture materials on "Discrete Fourier Transform" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC