0% found this document useful (0 votes)
12 views

DSP - Module 2

Uploaded by

anamikanaircs11
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

DSP - Module 2

Uploaded by

anamikanaircs11
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Fast Fourier Transform (FFT)

Lets calculate the DFT of a sequence with N=4 and k=1


3 For a single value of k we have
𝑋 1 = ෍ 𝑥 𝑛 𝑊4𝑛
4 → Multiplication
𝑛=0
3 → Addition
=𝑥 0 𝑊40 +𝑥 1 𝑊41 +𝑥 2 𝑊42 +𝑥 3 𝑊43

For example N=1024

DFT method

Complex multiplication = 𝑁 2 Complex Addition = 𝑁(𝑁 − 1)


= 10242 = 1024(1024 − 1)

= 1048576 = 1047552

www.iammanuprasad.com
Fast Fourier Transform (FFT)
• DFT takes more time and resources
• Not much efficient
• Much complex

• So we come into a new algorithm to make the calculations fast known as fast Fourier Transform (FFT)
• It is a highly efficient procedure for computing the DFT of a sequence for computing the DFT of a finite
sequence and require less number of computation than that of direct evaluation of DFT
• FFT is based on decomposition and breaking the transform into smaller transform and combine them to get
total transform
• FFT make use of the symmetry and periodicity property of twiddle factor

FFT method

For example N=1024

Complex multiplication =
𝑁
log 2 𝑁 Complex Addition= 𝑁 log 2 𝑁
2
= 1024 log 2 1024
1024
= log 2 1024 = 1024
2
= 5120
www.iammanuprasad.com
Fast Fourier Transform (FFT)
Let us recollect the twiddle factor 𝑒 −𝑗𝜃 = cos 𝜃 − 𝑗𝑠𝑖𝑛 𝜃

DFT For N=8 & k=0

𝑁−1 𝑗2𝜋
− 0
𝑋 𝑘 = ෍𝑥 𝑛 𝑊𝑁𝑛𝑘 ,0 ≤ k ≤ N − 1
𝑊80 =𝑒 8 =1 For N=8 & k=3
𝑛=0 𝑗2𝜋 −𝑗3𝜋
𝑗2𝜋 − .3
𝑊𝑁 = 𝑒 −
𝑁 For N=8 & k=1 𝑊83 =𝑒 8 =𝑒 4

−𝑗𝜋
𝑗2𝜋 −
𝑗2𝜋
.1 3𝜋 3𝜋
𝑊𝑁𝑘 =𝑒

𝑁
𝑘 𝑊81 =𝑒 8 =𝑒 4 = cos − 𝑗 sin
4 4
𝜋 𝜋
For N=4 & k=0 = cos − 𝑗 sin
4 4 −1 1
𝑊83 = −𝑗
√2 √2
𝑗2𝜋 1 1
𝑊40 = 𝑒

4
0
=1 𝑊81 = −𝑗 = 0.7071 − 𝑗0.7071 𝑊83 = −0.7071 − 𝑗0.7071
√2 √2

For N=4 & k=1 For N=8 & k=2


𝑗2𝜋 −𝑗𝜋
𝑗2𝜋 − .2
𝑊41 = 𝑒

4
.1 𝑗𝜋 𝜋 𝜋 𝑊82 =𝑒 8 =𝑒 2

=𝑒 −
2 = cos − 𝑗 sin
2 2 𝜋 𝜋
= cos − 𝑗 sin
2 2
𝑊41 = −𝑗
𝑊82 = −𝑗
www.iammanuprasad.com
Fast Fourier Transform (FFT)

Decimation in Time (DIT)


𝑁 𝑁
• Also known as Radix DIT FFT algorithm 2
−1
2
−1

• The number of output points N can be expressed as a power 𝑋(𝑘) = ෍ 𝑥𝑒 (𝑛)𝑊𝑁𝑛𝑘 + 𝑊𝑁𝑘 ෍ 𝑥𝑜 (𝑛)𝑊𝑁𝑛𝑘
of 2 (N=2M) 𝑛=0 2 𝑛=0 2

Let x(n) is an N-point sequence and we are


dividing it into two (even xe(n) & odd xo(n)) parts
𝑋 𝑘 = 𝑋𝑒 𝑘 + 𝑊𝑁𝑘 𝑋𝑜 (𝑘) For k < N/2
𝑥𝑒 𝑛 = 𝑥(2𝑛) 𝑥𝑜 𝑛 = 𝑥(2𝑛 + 1)

We know DFT 𝑘+
𝑁
𝐹𝑟𝑜𝑚 𝑠𝑦𝑚𝑚𝑒𝑡𝑟𝑦 𝑝𝑟𝑜𝑝𝑒𝑟𝑡𝑦 ∶ 𝑊𝑁 2
= −𝑊𝑁𝑘
𝑁−1

𝑋 𝑘 = ෍ 𝑥 𝑛 𝑊𝑁𝑛𝑘
𝑛=0 Then
𝑁 𝑁
−1 −1
2 2
(2𝑛+1)𝑘 𝑁
= ෍ 𝑥 2𝑛 𝑊𝑁2𝑛𝑘 + ෍ 𝑥 2𝑛 + 1 𝑊𝑁 𝑁 𝑘− 𝑁
𝑋 𝑘 = 𝑋𝑒 𝑘− − 𝑊𝑁 2 𝑋𝑜 𝑘 − For k > N/2
𝑛=0 𝑛=0 2 2
𝑁 𝑁
−1 −1
2 2
= ෍ 𝑥 2𝑛 𝑊𝑁2𝑛𝑘 + 𝑊𝑁𝑘 ෍ 𝑥 2𝑛 + 1 𝑊𝑁2𝑛𝑘
𝑛=0 𝑛=0
𝑗2𝜋
𝑗2𝜋 − 𝑁
− 2
𝑊𝑁2 = 𝑒 𝑁 =𝑒 2 = 𝑊𝑁
www.iammanuprasad.com
2
Decimation in Time (DIT)

𝑋 0 = 𝑥𝑒 0 + 𝑊80 𝑥𝑜 0 𝑋 4 = 𝑥𝑒 0 − 𝑊80 𝑥𝑜 0
𝑋 𝑘 = 𝑋𝑒 𝑘 + 𝑊𝑁𝑘 𝑋𝑜 (𝑘)
𝑁 𝑘−
𝑁
𝑁 𝑋 1 = 𝑥𝑒 1 + 𝑊81 𝑥𝑜 1 𝑋 5 = 𝑥𝑒 1 − 𝑊81 𝑥𝑜 1
𝑋 𝑘 = 𝑋𝑒 𝑘− − 𝑊𝑁 2 𝑋𝑜 𝑘 −
2 2 𝑋 2 = 𝑥𝑒 2 + 𝑊82 𝑥𝑜 2 𝑋 6 = 𝑥𝑒 2 − 𝑊82 𝑥𝑜 2
𝑋 3 = 𝑥𝑒 3 + 𝑊83 𝑥𝑜 3 𝑋 7 = 𝑥𝑒 3 − 𝑊83 𝑥𝑜 3
Example : For N = 8
This operation can be represented by a butterfly diagram
even odd
𝑥𝑒 (0) 𝑥𝑒 0 + 𝑊80 𝑥0 0 = 𝑋(0)
𝑥𝑒 0 = 𝑥(0) 𝑥𝑜 0 = 𝑥(1)
𝑥𝑒 1 = 𝑥(2) 𝑥0 1 = 𝑥(3)

𝑥𝑒 2 = 𝑥(4) 𝑥𝑜 2 = 𝑥(5)
𝑥𝑒 3 = 𝑥(6) 𝑥𝑜 3 = 𝑥(7) 𝑊80
𝑥𝑜 (0) 𝑥𝑒 0 − 𝑊80 𝑥0 0 = 𝑋(4)
𝑋 𝑘 = 𝑥𝑒 𝑘 + 𝑊8𝑘 𝑥𝑜 𝑘 , 𝑓𝑜𝑟 0 ≤ 𝑘 ≤ 3
𝑎 𝑎 + 𝑏𝑊𝑁𝑘

𝑋 𝑘 = 𝑥𝑒 𝑘 − 4 − 𝑊8𝑘−4 𝑥𝑜 𝑘 − 4 , 𝑓𝑜𝑟 4 ≤ 𝑘 ≤ 7

𝑊𝑁𝑘
𝑏
www.iammanuprasad.com 𝑎 − 𝑏𝑊𝑁𝑘
Decimation in Time (DIT)
Steps to follow

Step 1 : Find the number of input samples (N)


Step 2 : Bir reversal Revised
Input Binary Bit-reversed
samples
Step 3 : Calculate the number of stages (𝑀 = log2 𝑁)
Step 4 : Calculate the number of max butterflies in stage (N/2) x(0) 000 000 x(0)
Step 5 : Calculate the twiddle factor x(1) 001 100 x(4)
Step 6 : Evaluate the N point DFT using butterfly diagram x(2) 010 010 x(2)
Step7 : The DFT output is in normal order x(3) 011 110 x(6)
x(4) 100 001 x(1)
2-point x(5) 101 101 x(5)
DFT
4-point
x(6) 110 011 x(3)
DFT x(7) 111 111 x(7)
2-point
DFT
8-point
DFT
2-point
DFT
4-point
DFT
2-point
DFT
www.iammanuprasad.com
Decimation in Time (DIT)
Q) Find the DFT of a sequence x(n) = {0, 1, 2, 3} using DIT algorithm

Solution

Step 1 : Find the number of input samples (N) Step 3 : Calculate the number of stages (𝑀 = log 2 𝑁)

N=4

𝑀 = log 2 𝑁 = log 2 4
Step 2 : Bit reversal
𝑀=2

Bit- Revised Step 4 : Calculate the number of max butterflies in stage


Input Binary
reversed samples

x(0) 00 00 x(0) 𝑁 4
x(1) 01 10 x(2) = =2
2 2
x(2) 10 01 x(1)
x(3) 11 11 x(3)

www.iammanuprasad.com
Decimation in Time (DIT)

Step 5 : Calculate the twiddle factor

𝑁𝑡
𝑘= 𝑡 = 0, 1, 2, … 2𝑀−1 − 1
2𝑀

Stage =1 (𝑀 = 1) Stage =2 (𝑀 = 2)
𝑡 = 0,1
𝑡=0
𝑊40 𝑊41
for t=0
𝑁𝑡 4.0
𝑘= 𝑀 = =0 4.0
2 21 𝑘= =0
22
𝑊40
for t=1
4.1
𝑗2𝜋 𝑘= 2 =1
𝑊40 =𝑒

4
0
=1 2

www.iammanuprasad.com
Decimation in Time (DIT)
Step 6 : Evaluate the N point DFT using butterfly diagram

𝑥 𝑛 = 0, 1, 2, 3 𝑊40 = 1 𝑊41 = −𝑗
Stage 1 Stage 2

0 + 2.1 = 2 2 + 4.1 = 6 𝑋 0
𝑥 0 =0

𝑋 1
𝑊40 0 − 2.1 = −2 −2 + −2. −𝑗 = −2 + 2𝑗
𝑥 2 =2

1 + 3.1 = 4 𝑊40 2 − 4.1 = −2 𝑋(2)


𝑥 1 =1

Step7 : The DFT output


is in normal order

𝑥 3 =3 𝑊40 1 − 3.1 = −2 𝑊41 −2 − −2. −𝑗 = −2 − 2𝑗 𝑋 3

𝑋 𝑘 = 6, −2 + 2𝑗, −2 − 2 − 2𝑗
www.iammanuprasad.com
Decimation in Time (DIT)
Q) Find the DFT of a sequence x(n) = {1, 2, 3, 4, 4, 3, 2, 1 } using DIT algorithm

Solution

Step 1 : Find the number of input samples (N) Step 3 : Calculate the number of stages (𝑀 = log 2 𝑁)

N=8

𝑀 = log 2 𝑁 = log 2 8
Step 2 : Bit reversal
𝑀=3

Step 4 : Calculate the number of max butterflies in stage

𝑁 8
= =4
2 2

www.iammanuprasad.com
Decimation in Time (DIT)

Step 5 : Calculate the twiddle factor


Stage =3 (𝑀 = 3)

𝑁𝑡 𝑡 = 0,1,2,3
𝑘= 𝑀 𝑡 = 0, 1, 2, … 2𝑀−1 − 1
2 for t=0
8.0
Stage =2 (𝑀 = 2) 𝑘= =0 𝑊80 𝑊80 = 1
Stage =1 (𝑀 = 1) 23
𝑡 = 0,1
for t=1
𝑡=0 for t=0 8.1 1 1
𝑘= =1 𝑊81 𝑊81 = −𝑗
𝑁𝑡 8.0 8.0 23 √2 √2
𝑘= 𝑀
2
= 1 =0 𝑘= 2 =0 𝑊80
2 2 for t=2
8.2
𝑊80 for t=1 𝑘= =2 𝑊82 𝑊82 = −𝑗
23
8.1
𝑘= 2 =2 𝑊82
𝑗2𝜋 2 for t=3
− 8 0
𝑊80 =𝑒 =1 8.3 −1 1
𝑊82 = −𝑗 𝑘= 3 =3 𝑊83 𝑊82 =
√2
−𝑗
√2
2

www.iammanuprasad.com
Decimation in Time (DIT)
Step 6 : Evaluate the N point DFT using butterfly diagram
1 1 −1 1
𝑥 𝑛 = 1, 2, 3,4, 4, 3, 2, 1 𝑊80 = 1 𝑊81 = −𝑗 𝑊82 = −𝑗 𝑊83 = −𝑗
√2 √2 √2 √2
Stage 1 Stage 2 Stage 3
𝑥 0 =1 1 + 4.1 = 5 5 + 5.1 = 10 10 + 10.1 = 20 𝑋 0
1 1
−3 − 𝑗 + −1 − 3𝑗 −𝑗
√2 √2
𝑥 4 =4 1 − 4.1 = −3 −3 + 1. −𝑗 = −3 − 𝑗 −5.82 − 𝑗2.414 𝑋 1
𝑊80 = 1

𝑥 2 =3 3 + 2.1 = 5 5 − 5.1 = 0 0 𝑋 2
𝑊80 = 1
−3 − 1. −𝑗 = −3 + 𝑗 −0.172 − 𝑗0.414
𝑥 6 =2 3 − 2.1 = 1 𝑋 3
𝑊80 = 1 𝑊82 = −𝑗

𝑥 1 =2 5 10 0 𝑋 4
𝑊80 = 1

𝑥 5 =3 −1 − 3𝑗 −0.172 − 𝑗0.414 𝑋 5
−1
𝑊80 = 1 1 1
𝑊81 = −𝑗
√2 √2 Step7 : The DFT
𝑥 3 =4 5 0 0 𝑋 6 output is in normal
𝑊80 = 1 𝑊82 = −𝑗 order
𝑥 7 =1 3 −1 + 3𝑗 −5.828 + 𝑗0.414 𝑋 7
𝑊80 = 1 𝑊82 = −𝑗 −1 1
𝑊83 = −𝑗
√2 √2

𝑋 𝑘 = 20, −5.82 − 𝑗2.414, 0, − 0.172 − 𝑗0.414, 0, −0.172 − 𝑗0.414 , 0, −5.828 + 𝑗0.414


www.iammanuprasad.com
𝑁𝑘 −𝑗2𝜋 𝑁𝑘
Fast Fourier Transform (FFT) 𝑊𝑁2 =𝑒 𝑁 2 = 𝑒 −𝑗𝜋𝑘

Decimation in Frequency (DIF)


When k is even 𝑒 −𝑗𝜋𝑘 = 1
• Based on the decomposition of the DFT computation by 𝑁 𝑁 𝑁
−1
−1 −1 2
forming smaller and smaller sub sequences 2 2
𝑋(2𝑘) = ෍ 𝑥1 𝑛 𝑊𝑁𝑛𝑘 + 𝑒 −𝑗𝜋𝑘 ෍ 𝑥2 𝑛 𝑊𝑁𝑛𝑘 = ෍ 𝑥1 𝑛 + 𝑥2 𝑛 𝑊𝑁2𝑛𝑘
• In DIF the output sequence X(k) is divided into smaller and 𝑛=0
𝑛=0 𝑛=0
smaller sub sequences
𝑁
−1 𝑊𝑁2𝑛𝑘 = 𝑊𝑁𝑘
Let x(n) is an N-point sequence and we are 2
2
dividing it into two parts 𝑋(2𝑘) = ෍ 𝑥1 𝑛 + 𝑥2 𝑛 𝑊𝑁𝑛𝑘
𝑁 𝑛=0 2
𝑥1 𝑛 = 𝑥(𝑛) 𝑥2 𝑛 = 𝑥 𝑛 +
2
𝑁 𝑁 In the above equation in the N/2 –point DFT of N/2 sequences is
𝑛 = 0,1,2, … −1 𝑛 = 0,1,2, … −1
2 2 obtained by adding the first half and last half of the input sequences
We know DFT 𝑁−1 When k is odd 𝑒 −𝑗𝜋𝑘 = −1
𝑋 𝑘 = ෍ 𝑥 𝑛 𝑊𝑁𝑛𝑘 𝑁
2
−1
𝑛=0 2𝑘+1 𝑛
𝑋(2𝑘 + 1) = ෍ 𝑥1 𝑛 − 𝑥2 𝑛 𝑊𝑁
𝑁 𝑁
−1 −1 𝑛=0
2 2 𝑁
𝑛+ 𝑘
2
= ෍ 𝑥1 𝑛 𝑊𝑁𝑛𝑘 + ෍ 𝑥2 𝑛 𝑊𝑁 𝑁
−1
𝑛=0 𝑛=0 2
𝑋 2𝑘 + 1 = ෍ 𝑥1 𝑛 − 𝑥2 𝑛 𝑊𝑁𝑛𝑘 𝑊𝑁𝑛
𝑁 𝑁 2
−1 −1 𝑛=0
2 𝑁𝐾 2
= ෍ 𝑥1 𝑛 𝑊𝑁𝑛𝑘 + 𝑊𝑁 2 ෍ 𝑥2 𝑛 𝑊𝑁𝑛𝑘
𝑛=0 𝑛=0 In the above equation in the N/2 –point DFT of N/2 sequences is
obtained by subtracting the second half of the input from the first half and then
www.iammanuprasad.com
multiplying the result with WNk
Decimation in Frequency (DIF)
𝑁
−1
2
𝑋(2𝑘) = ෍ 𝑥1 𝑛 + 𝑥2 𝑛 𝑊𝑁𝑛𝑘 𝑋 0 = 𝑥1 0 + 𝑥2 0 𝑋 4 = [𝑥1 0 − 𝑥2 0 ]𝑊80
𝑛=0 2
𝑁 𝑋 1 = 𝑥1 1 + 𝑥2 1 𝑋 5 = [𝑥1 1 − 𝑥2 1 ]𝑊81
−1
2
𝑋 2𝑘 + 1 = ෍ 𝑥1 𝑛 − 𝑥2 𝑛 𝑊𝑁𝑛𝑘 𝑊𝑁𝑛 𝑋 2 = 𝑥1 2 + 𝑥2 2 𝑋 6 = [𝑥1 2 − 𝑥2 2 ]𝑊82
𝑛=0 2
𝑋 3 = 𝑥1 3 + 𝑥2 3 𝑋 7 = [𝑥1 3 − 𝑥2 3 ]𝑊83

This operation can be represented by a butterfly diagram


Example : For N = 8
𝑥1 (𝑛) 𝑥1 𝑛 + 𝑥2 𝑛
x1(n) x2(n)
𝑥1 0 = 𝑥(0) 𝑊𝑁𝑛
𝑥2 0 = 𝑥(4)
𝑥1 1 = 𝑥(1) 𝑥2 1 = 𝑥(5)

𝑥1 2 = 𝑥(2) 𝑥2 2 = 𝑥(6)
𝑥2 (𝑛) [𝑥1 𝑛 − 𝑥2 𝑛 ]𝑊𝑁𝑛
𝑥1 3 = 𝑥(3) 𝑥2 3 = 𝑥(7)

𝑎 𝑎+𝑏

𝑋 2𝑘 = 𝑥1 𝑘 + 𝑥2 𝑘 , 𝑓𝑜𝑟 0 ≤ 𝑘 ≤ 3 𝑊𝑁𝑛

𝑋 2𝑘 + 1 = 𝑥1 𝑘 − 𝑥2 𝑘 𝑊8𝑘 , 𝑓𝑜𝑟 4 ≤ 𝑘 ≤ 7
𝑏
www.iammanuprasad.com [𝑎 − 𝑏]𝑊𝑁𝑛
Decimation in Frequency (DIF)
Steps to follow

Step 1 : Find the number of input samples (N)


Step 2 : input sequence in normal order Revised
Input Binary Bit-reversed
samples
Step 3 : Calculate the number of stages (𝑀 = log2 𝑁)
Step 4 : Calculate the number of max butterflies in stage (N/2) x(0) 000 000 x(0)
Step 5 : Calculate the twiddle factor x(1) 001 100 x(4)
Step 6 : Evaluate the N point DFT using butterfly diagram x(2) 010 010 x(2)
Step7 : The DFT output is in bit-reversed order x(3) 011 110 x(6)
x(4) 100 001 x(1)
2-point
x(5) 101 101 x(5)
DFT
4-point x(6) 110 011 x(3)
DFT
x(7) 111 111 x(7)
2-point
DFT
8-point
DFT
2-point
DFT
4-point
DFT
2-point
DFT
www.iammanuprasad.com
Decimation in Frequency (DIF)
Q) Find the DFT of a sequence x(n) = {0, 1, 2, 3} using DIF algorithm

Solution
Step 3 : Calculate the number of stages (𝑀 = log 2 𝑁)
Step 1 : Find the number of input samples (N)

N=4 𝑀 = log 2 𝑁 = log 2 4

Step 2 : input sequence in normal order 𝑀=2

Step 4 : Calculate the number of max butterflies in stage

𝑁 4
= =2
2 2

www.iammanuprasad.com
Decimation in Frequency (DIF)

Step 5 : Calculate the twiddle factor

𝑁𝑡
𝑘= 𝑡 = 0, 1, 2, … 2𝑀−𝑚 − 1
2𝑀−𝑚+1

Stage =1 Stage =2 (𝑀 = 2, 𝑚 = 2)
(𝑀 = 2, 𝑚 = 1)
𝑡 = 0,1 𝑡=0
for t=0
𝑊40 𝑊41 𝑁𝑡 4.0
𝑘= = =0
𝑁𝑡 4.0 2𝑀−𝑚+1 21
𝑘= = 2 =0
2𝑀−𝑚+1 2
𝑊40
for t=1

4.1
𝑘= =1
22

www.iammanuprasad.com
Decimation in Frequency (DIF)
Step 6 : Evaluate the N point DFT using butterfly diagram

𝑥 𝑛 = 0, 1, 2, 3 𝑊40 = 1 𝑊41 = −𝑗

Stage 1 Stage 2

0+2=2 2+4=6 𝑋 0
𝑥 0 =0

𝑊40 𝑊40

𝑋 2
1+3=4 2 − 4 1 = −2
𝑥 1 =1

0 − 2 1 = −2 −2 + 2𝑗 𝑋(1)
𝑥 2 =2
𝑊41
𝑊40 Step7 : The DFT output is
in bit-reversed order

𝑥 3 =3 −2 − 2𝑗 1 = −2 − 2𝑗 𝑋 3
1 − 3 − 𝑗 = 2𝑗

𝑋 𝑘 = 6, −2 + 2𝑗, −2, −2 − 2𝑗
www.iammanuprasad.com
Decimation in Frequency (DIF)
Q) Find the DFT of a sequence x(n) = {1, 2, 3, 4, 4, 3, 2, 1 } using DIF algorithm

Solution

Step 1 : Find the number of input samples (N) Step 3 : Calculate the number of stages (𝑀 = log 2 𝑁)

N=8

𝑀 = log 2 𝑁 = log 2 8
Step 2 : input sequence in normal order
𝑀=3

Step 4 : Calculate the number of max butterflies in stage

𝑁 8
= =4
2 2

www.iammanuprasad.com
Decimation in Frequency (DIF)
Step 5 : Calculate the twiddle factor
𝑁𝑡
𝑘 = 𝑀−𝑚+1 𝑡 = 0, 1, 2, … 2𝑀−𝑚 − 1 Stage =2 (𝑀 = 3, 𝑚 = 2)
2
Stage =1 (𝑀 = 3, 𝑚 = 1) 𝑡 = 0,1

𝑡 = 0,1,2,3 for t=0


for t=0 8.0 𝑊80 𝑊80 = 1
𝑘= =0
8.0 22
𝑘= =0 𝑊80 𝑊80 = 1
23 for t=1
for t=1 8.1
1 1 𝑘= =2 𝑊82 𝑊82 = −𝑗
8.1 𝑊81 𝑊81 = −𝑗 22
𝑘= 3 =1 √2 √2
2
Stage =3 (𝑀 = 3, 𝑚 = 3)
for t=2
8.2 𝑡=0
𝑘= =2 𝑊82 𝑊82 = −𝑗
23
for t=0
for t=3 8.0 𝑊80 𝑊80 = 1
𝑘= =0
8.3 −1 1
21
𝑘= =3 𝑊83 𝑊82 = −𝑗
23 √2 √2

www.iammanuprasad.com
Decimation in Frequency (DIF)
Step 6 : Evaluate the N point DFT using butterfly diagram

1 1 −1 1
𝑥 𝑛 = 1, 2, 3,4, 4, 3, 2, 1 𝑊80 = 1 𝑊81 = −𝑗 𝑊82 = −𝑗 𝑊83 = −𝑗
√2 √2 √2 √2
Stage 1 Stage 2 Stage 3
𝑥 0 =1 1+4=5 5 + 5 = 10 10 + 10 = 20 𝑋 0

𝑊80 𝑊80
𝑊80 5 + 5 = 10 𝑋 4
𝑥 1 =2 2+3=5 10 − 10 1 = 0

𝑊81
𝑊82
𝑥 2 =3 3+2=5 5−5 1=0 0 𝑋 2

𝑊82 𝑊80
5−5 −𝑗 =0
𝑥 3 =4 4+1=5 0 𝑋 6

𝑊83
1 − 4 . 1 = −3 −3 − 𝑗 −5.82 − 𝑗2.414 𝑋 1
𝑥 4 =4
1 1
2−3 −𝑗 𝑊80
√2 2 𝑊80
𝑥 5 =3 −0.707 + 𝑗0.707 −2.828 − 𝑗1.414 −0.172 − 𝑗0.414 𝑋 5
𝑊82
3 − 2 − 𝑗 = −𝑗 −3 + 𝑗 𝑋 3
𝑥 6 =2 −0.172 − 𝑗0.414
−1 1 Step7 : The DFT output
4−1 −𝑗 𝑊80
√2 √2 is in bit reversed order
𝑥 7 =1 −2.121 − 𝑗2.121 2.828 − 𝑗1.414 −5.828 + 𝑗0.414 𝑋 7

𝑋 𝑘 = 20, −5.82 − 𝑗2.414, 0, − 0.172 − 𝑗0.414, 0, −0.172 − 𝑗0.414 , 0, −5.828 + 𝑗0.414


www.iammanuprasad.com
IDFT Computation using Radix -2 FFT algorithm

The inverse DFT of an N-point sequence X(k), for k=0,1,2,…, N-1


𝑁−1
1
𝑥(𝑛) = ෍ 𝑋 ∗ 𝑘 𝑊𝑁𝑛𝑘
𝑁
𝑘=0

Q) Find the IDFT of the sequence X(k) = {10, -2+2j, -2, -2-2j} using DIT algorithm

Solution Step 3 : Calculate the number of stages (𝑀 = log2 𝑁)


Step 1 : Find the number of input samples (N)
N=4
𝑀 = log 2 𝑁 = log2 4
Step 2 : Bir reversal
𝑀=2
Bit- Revised
Input Binary
reversed samples Step 4 : Calculate the number of max butterflies in stage

x(0) 00 00 x(0)
𝑁 4
x(1) 01 10 x(2) = =2
2 2
x(2) 10 01 x(1)
x(3) 11 11 x(3)
www.iammanuprasad.com
IDFT Computation using Radix -2 FFT algorithm

Step 5 : Calculate the twiddle factor

𝑁𝑡
𝑘= 𝑡 = 0, 1, 2, … 2𝑀−1 − 1 Step 6 : Find the conjugates of X(k)
2𝑀 Stage =2 (𝑀 = 2)
Stage =1 (𝑀 = 1) 𝑡 = 0,1 X(k) = {10, -2+2j, -2, -2-2j}
𝑡=0 for t=0
𝑁𝑡 4.0 X*(k) = {10, -2-2j, -2, -2+2j}
𝑘= 𝑀 = 1 4.0
2 2
=0 𝑘= =0 𝑊40
22

𝑊40 for t=1


4.1
𝑗2𝜋
− 4 0
𝑘=
22
=1 𝑊41
𝑊40 = 𝑒 =1

www.iammanuprasad.com
IDFT Computation using Radix -2 FFT algorithm
Step 7 : Evaluate the IDFT using butterfly diagram

𝑋 ∗ 𝑘 = 10, −2−2j, −2, −2+2j 𝑊40 = 1 𝑊41 = −𝑗


Stage 1 Stage 2

10 + (−2 ∗ 1) = 8 8 + −4 ∗ 1 = 4 𝑥∗ 0
𝑥 0 = 10

𝑥∗ 1
𝑊40 10 − −2 ∗ 1 = 12 12 + −4𝑗 ∗ −𝑗 = 8
𝑥 2 = −2

−2 − 2𝑗 + −2 + 2𝑗 . 1 = −4 𝑊40 8 − −4 ∗ 1 = 12 𝑥 ∗ (2)
𝑥 1 = −2 − 2𝑗

Step8 : The output is in


normal order and divide
𝑥∗ 3
it with N
𝑥 3 = −2 + 2𝑗 𝑊4
0 𝑊41 12 − −4𝑗 ∗ −𝑗 = 16
−2 − 2𝑗 − −2 + 2𝑗 . 1 = −4𝑗

1
𝑥 ∗ (𝑛) = 4, 8, 12, 16 𝑥 𝑛 = {1, 2, 3, 4}
4
www.iammanuprasad.com
IDFT Computation using Radix -2 FFT algorithm

Q) Find the IDFT of the sequence X(k) = {7, 2, 3, 1+j} using DIF algorithm

Solution

Step 1 : Find the number of input samples (N)

Step 3 : Calculate the number of stages (𝑀 = log2 𝑁)


N=4

Step 2 : Bit reversal


𝑀 = log 2 𝑁 = log2 4

Bit- Revised 𝑀=2


Input Binary
reversed samples

x(0) 00 00 x(0)
Step 4 : Calculate the number of max butterflies in stage
x(1) 01 10 x(2)
x(2) 10 01 x(1) 𝑁 4
= =2
x(3) 11 11 x(3) 2 2

www.iammanuprasad.com
IDFT Computation using Radix -2 FFT algorithm

Step 5 : Calculate the twiddle factor

𝑁𝑡
𝑘= 𝑡 = 0, 1, 2, … 2𝑀−𝑚 − 1
2𝑀−𝑚+1
Step 6 : Find the conjugates of X(k)
Stage =2 (𝑀 = 2, 𝑚 = 2)
Stage =1 (𝑀 = 2, 𝑚 = 1)
𝑡 = 0,1 𝑡=0 X(k) = {7, 2, 3, 1+j}
for t=0 𝑁𝑡 4.0
𝑘= = =0
4.0 2𝑀 21
𝑊40 X*(k) = {7, 2, 3, 1-j}
𝑘= 2 =0
2
for t=1 𝑊40
4.1
𝑘= =1 𝑊41 𝑗2𝜋
− 4 0
22 𝑊40 =𝑒 =1
𝑗2𝜋
− 0
𝑊40 =𝑒 4 =1

www.iammanuprasad.com
Decimation in Frequency (DIF)
Step 7 : Evaluate the N point DFT using butterfly diagram

𝑋 ∗ 𝑘 = 7, 2, 3, 1−j 𝑊40 = 1 𝑊41 = −𝑗

Stage 1 Stage 2

7 + 3 = 10 10 + 3 − 𝑗 = 13 − 𝑗 𝑋 0
𝑥 0 =7

𝑊40 𝑊40

𝑋 2
2+1−𝑗 =3−𝑗 10 − 3 − 𝑗 1 = 7 + 𝑗
𝑥 1 =2

7 − 3 .1 = 4 4 + 1 − 𝑗 .1 = 5 − 𝑗 𝑋(1)
𝑥 2 =3
𝑊41
𝑊40 Step8 : The output is in
normal order and divide it
with N
𝑥 3 =1−𝑗 4 − 1 − 𝑗 .1 = 3 + 𝑗 𝑋 3

2− 1−𝑗 −𝑗 =1−𝑗
1
𝑥 ∗ (𝑛) = 13 − 𝑗, 5 − 𝑗, 7 + 𝑗, 3 + 𝑗
4
www.iammanuprasad.com
Application of FFT

Efficient computation of DFT of two real sequences

Let x1(n) and x2(n) are two real sequences of length N and let x(n) be a complex values sequence defined as x(n) =x1(n)+jx2(n)

Now find the DFT of the sequence x(n) which is linear

𝑋 𝑘 = 𝑋1 𝑘 + 𝑗𝑋2 (𝑘)

The sequences x1(n) and x2(n) can be expressed in terms of x(n) as

𝑥 𝑛 + 𝑥 ∗ (𝑛) 𝑥 𝑛 − 𝑥 ∗ (𝑛)
𝑥1 𝑛 = 𝑥2 𝑛 =
2 2𝑗

Then the DFT of x1(n) and x2(n) are

1 1
𝑋1 𝑘 = 𝐷𝐹𝑇 𝑥(𝑛) + 𝐷𝐹𝑇 𝑥 ∗ (𝑛) 𝑋2 𝑘 = 𝐷𝐹𝑇 𝑥(𝑛) − 𝐷𝐹𝑇 𝑥 ∗ (𝑛)
2 2𝑗

From conjugation property of twiddle factor

𝐷𝐹𝑇 1 1
𝑥∗ 𝑛 𝑋∗ 𝑁 − 𝑘 𝑋1 𝑘 = 𝑋 𝑘 + 𝑋∗ 𝑁 − 𝑘 𝑋2 𝑘 = 𝑋 𝑘 − 𝑋∗ 𝑁 − 𝑘
2 2𝑗
www.iammanuprasad.com
Efficient computation of DFT of two real sequences

Q) Find the DFT of two sequence x1(n) = {1,3,1,2} and x2(n) = {2,5,1,3}

Solution
𝑥 𝑛 = 𝑥1 𝑛 + 𝑗𝑥2 𝑛 For n = 0,1,2,3 𝑥 𝑛 = 1 + 2𝑗, 3 + 5𝑗, 1 + 𝑗, 2 + 3𝑗

Now find the DFT of the sequence x(n) using DIT or DIF method

𝑥 𝑛 = 1 + 2𝑗, 3 + 5𝑗, 1 + 𝑗, 2 + 3𝑗 𝑊40 = 1 𝑊41 = −𝑗

Stage 1 2 + 3𝑗 Stage 2 7 + 11𝑗 𝑋 0


𝑥 0 = 1 + 2𝑗

𝑊40 𝑊40

𝑋 2
5 + 8𝑗 −3 − 5𝑗
𝑥 1 =, 3 + 5𝑗

2 𝑋(1)
𝑥 2 = 1+𝑗 𝑗

𝑊41
𝑊40
𝑋(𝑘) = 7 + 11𝑗, 2, −3 − 5𝑗, −2 + 2𝑗

−2 + 2𝑗 𝑋 3
𝑥 3 = 2 + 3𝑗

2−𝑗
www.iammanuprasad.com
𝑋(𝑘) = 7 + 11𝑗, 2, −3 − 5𝑗, −2 + 2𝑗

Now we have to calculate X1(k) and X2(k)


For k=0
For k=0
1
1 𝑋2 (0) = 𝑋 0 − 𝑋∗ 4 − 0
𝑋1 (0) = 𝑋 0 + 𝑋 ∗ 4 − 0 2𝑗
2
1
1 = 7 + 11𝑗 − 7 − 11𝑗 = 11
= 7 + 11𝑗 + 7 − 11𝑗 =7 2𝑗
2
For k=1
For k=1
1
1 𝑋2 (1) = 𝑋 1 − 𝑋∗ 4 − 1
𝑋1 (1) = 𝑋 1 + 𝑋 ∗ 4 − 1 2𝑗
2
1
1 = 2 − (−2 − 2𝑗) = −2𝑗 + 1 𝑋1 𝑘 = 7, −𝑗, −3, 𝑗
= 2 + (−2 − 2𝑗) = −𝑗 2𝑗
2 For k=2
For k=2
1 𝑋2 𝑘 = 11,1 − 2𝑗, −5,1 + 2𝑗
1 𝑋2 (2) = 𝑋 2 − 𝑋∗ 4 − 2
𝑋1 (2) = 𝑋 2 + 𝑋∗ 4 − 2 2𝑗
2
1
1 = −3 − 5𝑗 − (−3 + 5𝑗) = −5
= −3 − 5𝑗 + (−3 + 5𝑗) = −3 2𝑗
2 For k=3
For k=3
1
1 𝑋2 (3) = 𝑋 3 − 𝑋∗ 4 − 3
𝑋1 (3) = 𝑋 3 + 𝑋 ∗ 4 − 3 2𝑗
2
1
1 =−2 + 2𝑗 − (2) = 2𝑗 + 1
= −2 + 2𝑗 + (2) =𝑗 2
www.iammanuprasad.com
2
Application of FFT
𝑗2𝜋
𝑗2𝜋 − 𝑁
− 2
Efficient computation of DFT of a 2N-point real sequence 𝑊𝑁2 = 𝑒 𝑁 =𝑒 2 = 𝑊𝑁
2
Let g(n) is a real valued sequences of 2N points.
𝑗2𝜋
2 − 2 = 𝑊𝑁
𝑊2𝑁 =𝑒 2𝑁
To find the 2N point DFT from N point DFT , we divide the
sequence to two

𝑥1 𝑛 = 𝑔 2𝑛 𝑥2 𝑛 = 𝑔 2𝑛 + 1
𝑁−1 𝑁−1

Now follow same as the DFT computation of two real sequence 𝐺(𝑘) = ෍ 𝑥1 𝑛 𝑊𝑁𝑛𝑘 + 𝑊2𝑁
𝑘
෍ 𝑥2 𝑛 𝑊𝑁𝑛𝑘
𝑛=0 𝑛=0
1 1
𝑋1 𝑘 = 𝑋 𝑘 + 𝑋 ∗ 𝑁 − 𝑘 𝑋2 𝑘 = 𝑋 𝑘 − 𝑋∗ 𝑁 − 𝑘
2 2𝑗

Finally we must express the 2N point DT in terms of two N point 𝑘


𝐺 𝑘 = 𝑋1 𝑘 + 𝑊2𝑁 𝑋2 𝑘
DFTs
𝑘
𝑁−1 𝑁−1 𝐺 𝑘 + 𝑁 = 𝑋1 𝑘 − 𝑊2𝑁 𝑋2 𝑘
2𝑛𝑘 (2𝑛+1)𝑘
𝐺 𝑘 = ෍ 𝑔 2𝑛 𝑊2𝑁 + ෍ 𝑔 2𝑛 + 1 𝑊2𝑁
𝑛=0 𝑛=0

𝑁−1 𝑁−1 𝑊ℎ𝑒𝑟𝑒 𝑘 = 0,1,2, … , 𝑁 − 1


2𝑛𝑘 𝑘 2𝑛𝑘
= ෍ 𝑥1 𝑛 𝑊2𝑁 + 𝑊2𝑁 ෍ 𝑥2 𝑛 𝑊2𝑁
𝑛=0 𝑛=0

www.iammanuprasad.com
Efficient computation of DFT of a 2N-point real sequence
Q) Find the DFT of the sequence x(n) = {1,3,7,2,1,2,1,3} using 4-point DFT

Solution 𝑥1 𝑛 = 1,7,1,1, 𝑥2 𝑛 = 3,2,2,3


𝑥 𝑛 = 𝑥1 𝑛 + 𝑗𝑥2 𝑛 𝑥 𝑛 = 1 + 3𝑗, 7 + 2𝑗, 1 + 2𝑗, 1 + 3𝑗

Now find the DFT of the sequence x(n) using DIT or DIF method

𝑥 𝑛 = 1 + 3𝑗, 7 + 2𝑗, 1 + 2𝑗, 1 + 3𝑗 𝑊40 = 1 𝑊41 = −𝑗

Stage 1 2 + 5𝑗 Stage 2 10 + 10𝑗 𝑋 0


𝑥 0 = 1 + 3𝑗

𝑊40 𝑊40

𝑋 2
8 + 5𝑗 −6
𝑥 1 = 7 + 2𝑗

−1 − 5𝑗 𝑋(1)
𝑥 2 = 1 + 2𝑗 𝑗

𝑊41
𝑊40
𝑋(𝑘) = 10 + 10𝑗, −1 − 5𝑗, −6,1 + 7𝑗

1 + 7𝑗 𝑋 3
𝑥 3 = 1 + 3𝑗

−1 − 6𝑗
www.iammanuprasad.com
𝑋(𝑘) = 10 + 10𝑗, −1 − 5𝑗, −6,1 + 7𝑗

Now we have to calculate X1(k) and X2(k)


For k=0
For k=0
1
1 𝑋2 (0) = 𝑋 0 − 𝑋∗ 4 − 0
𝑋1 (0) = 𝑋 0 + 𝑋 ∗ 4 − 0 2𝑗
2
1
1 = 10+10𝑗−(10−10𝑗) = 10
= 10 + 10𝑗 + 10 − 10𝑗 = 10 2𝑗
2
For k=1
For k=1
1
1 𝑋2 (1) = 𝑋 1 + 𝑋∗ 4 − 1
𝑋1 (1) = 𝑋 1 + 𝑋 ∗ 4 − 1 2𝑗
2
1
1 = −1 − 5𝑗 − (1 − 7𝑗) =1+𝑗 𝑋1 𝑘 = 10, −6𝑗, −6,6𝑗
= −1 − 5𝑗 + 1 − 7𝑗 = −6𝑗 2𝑗
2 For k=2
For k=2
1 𝑋2 𝑘 = 10, 1 + 𝑗, 0, 1 − 𝑗
1 𝑋2 (2) = 𝑋 2 + 𝑋∗ 4 − 2
𝑋1 (2) = 𝑋 2 + 𝑋∗ 4 − 2 2𝑗
2
1
1 = −6 − (−6) =0
= −6 + (−6) = −6 2𝑗
2 For k=3
For k=3
1
1 𝑋2 (3) = 𝑋 3 − 𝑋∗ 4 − 3
𝑋1 (3) = 𝑋 3 + 𝑋 ∗ 4 − 3 2𝑗
2
1
1 = 1 + 7𝑗 − −1 + 5𝑗 =1−𝑗
= 1 + 7𝑗 + −1 + 5𝑗 = 6𝑗 2
www.iammanuprasad.com
2
𝑋1 𝑘 = 10, −6𝑗, −6,6𝑗 For k=3
𝑋 3 = 𝑋1 3 + 𝑊83 𝑋2 3
𝑋2 𝑘 = 10, 1 + 𝑗, 0, 1 − 𝑗
−1 1
= 6𝑗 + 1 − 𝑗 −𝑗 = − 2 + 6𝑗
Here 2N =8 so, √2 √2
1 1 −1 1 For k=0
𝑊80 = 1 𝑊81 = −𝑗 𝑊82 = −𝑗 𝑊83 = −𝑗
√2 √2 √2 √2 𝑋 0 + 4 = 𝑋1 0 − 𝑊80 𝑋2 0

For k=0 = 10 − 1. 10 =0
𝑋 0 = 𝑋1 0 + 𝑊80 𝑋2 0 For k=1
𝑋 1 + 4 = 𝑋1 1 − 𝑊81 𝑋2 1
= 10 + 1. 10 = 20
1 1
= −6𝑗 − 1 + 𝑗 −𝑗 = − 2 − 6𝑗
For k=1 √2 √2
For k=2
𝑋 1 = 𝑋1 1 + 𝑊81 𝑋2 1
𝑋 2 + 4 = 𝑋1 2 − 𝑊82 𝑋2 2
1 1
= −6𝑗 + 1 + 𝑗 −𝑗 = 2 − 6𝑗 = −6 − 0 −𝑗 = −6
√2 √2
For k=3
For k=2 𝑋 3 + 4 = 𝑋1 3 − 𝑊83 𝑋2 3
𝑋 2 = 𝑋1 2 + 𝑊82 𝑋2 2 −1 1
= 6𝑗 − 1 − 𝑗 −𝑗 = 2 + 6𝑗
= −6 + 0 −𝑗 = −6 √2 √2

𝑋 𝑘 = 20, 2 − 6𝑗, −6, − 2 + 6𝑗, 0, − 2 − 6𝑗, −6, 2 + 6𝑗


www.iammanuprasad.com

You might also like