KEMBAR78
DSP Notes | PDF | Discrete Fourier Transform | Digital Signal Processing
0% found this document useful (0 votes)
7 views203 pages

DSP Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views203 pages

DSP Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 203

INTRODUCTION TO DIGITAL SIGNAL PROCESSING

Analog Digital

• Analysis, synthesis and modify


• Analog signal processing
• Digital signal processing

www.iammanuprasad.com
BASIC BLOCKS OF DIGITAL SIGNAL PROCESSING

Digital
Analog AD DA Analog
Pre filter Signal Post filter
input Converter Converter output
Processor

www.iammanuprasad.com
Discrete Fourier Transform (DFT)

• DFT is a powerful computation tool which allows us to evaluate the Fourier transform on a digital computer or
specifically designed hardware
• We notate like this

𝑋 𝑘 = 𝐷𝐹𝑇[𝑥 𝑛 ] 𝑥 𝑛 = 𝐼𝐷𝐹𝑇[𝑋 𝑘 ]

DFT IDFT 𝑁−1


𝑁−1 1 𝑗2𝜋𝑘𝑛
𝑗2𝜋𝑘𝑛 𝑥(𝑛) = ෍ 𝑋 𝑘 𝑒 𝑁 , 0 ≤ n ≤ N − 1

𝑋 𝑘 = ෍𝑥 𝑛 𝑒 𝑁 ,0 ≤ k ≤ N − 1 𝑁
𝑘=0
𝑛=0

𝑗2𝜋
Let us define a term 𝑊𝑁 = 𝑒 − 𝑁 which is known as twiddle factor and substitute in above equations

𝑁−1 𝑁−1
1
𝑋 𝑘 = ෍𝑥 𝑛 𝑊𝑁𝑛𝑘 ,0 ≤ k ≤ N−1 𝑥(𝑛) = ෍ 𝑋 𝑘 𝑤𝑁−𝑛𝑘 , 0 ≤ n ≤ N − 1
𝑁
𝑛=0 𝑘=0

www.iammanuprasad.com
𝑁−1
Let us take an example 𝑗2𝜋𝑘𝑛

𝑋 𝑘 = ෍𝑥 𝑛 𝑒 𝑁 ,0 ≤ k ≤ N − 1
Q) Find the DFT of the sequence 𝑥 𝑛 = {1,1,0,0}
𝑛=0

𝑁=4 𝑘=2 3
𝑗𝜋2𝑛
3 −
𝑗2𝜋𝑘𝑛 𝑋 2 = ෍𝑥 𝑛 𝑒 2

𝑋 𝑘 = ෍𝑥 𝑛 𝑒 4 ,0 ≤ k ≤ N − 1 𝑛=0
𝑛=0 = 𝑥 0 + 𝑥 1 𝑒 −𝑗𝜋 + 𝑥 2 𝑒 −𝑗2𝜋 + 𝑥 3 𝑒 −𝑗3𝜋

𝑘=0 = 1 + 1 cos 𝜋 − 𝑗 sin 𝜋 + 0 + 0 = 1−1=0


3
𝑗2𝜋0𝑛 𝑘=3 3

𝑋 0 = ෍𝑥 𝑛 𝑒 4 −
𝑗𝜋3𝑛
𝑋 3 = ෍𝑥 𝑛 𝑒 2
𝑛=0
𝑛=0
𝑗3𝜋 𝑗9𝜋
=𝑥 0 +𝑥 1 +𝑥 2 +𝑥 3 = 𝑥 0 + 𝑥 1 𝑒− 2 + 𝑥 2 𝑒 −𝑗3𝜋 + 𝑥 3 𝑒 − 2

=1+1+0+0 =2 3𝜋 3𝜋
= 1 + 1 cos − 𝑗 sin +0+0 =1+𝑗
2 2
𝑘=1 3
𝑗𝜋𝑛
𝑋 1 = ෍ 𝑥 𝑛 𝑒− 2
𝑛=0
𝑗𝜋 𝑗3𝜋
𝑋 𝑘 = 2, 1 − 𝑗, 0,1 + 𝑗
− −
=𝑥 0 +𝑥 1 𝑒 + 𝑥 2 𝑒 −𝑗𝜋 + 𝑥 3 𝑒
2 2

𝜋 𝜋
= 1 + 1 cos − 𝑗 sin + 0 + 0 = 1 − 𝑗 www.iammanuprasad.com
2 2
DFT as linear transformation (Matrix method)
DFT We can also represent the equation in matrix format

𝑁−1 1 1 1 1 … 1
𝑊𝑁𝑛𝑘 𝑋(0) 𝑁−1 𝑥(0)
𝑋 𝑘 = ෍𝑥 𝑛 𝑒 ,0 ≤ k ≤ N − 1 1 𝑊𝑁1 𝑊𝑁2 𝑊𝑁3 … 𝑊𝑁
𝑗2𝜋
𝑋(1) 𝑥(1)
𝑛=0 1 𝑊𝑁2 𝑊𝑁4 𝑊𝑁6 … 2(𝑁−1)
𝑊𝑁 = 𝑒 − 𝑁 𝑋(2)
= 1
𝑊𝑁 𝑥(2)

𝑋(3) 𝑊𝑁3 𝑊𝑁6 𝑊𝑁9 3(𝑁−1)
𝑊𝑁 𝑥(3)
⋮ …
⋮ ⋮ ⋮ ⋮ ⋮ ⋮
Lets put n = 0,1,2, … N-1 𝑋(𝑁 − 1) 2(𝑁−1) 3(𝑁−1) 𝑥(𝑁 − 1)
𝑁−1 𝑁−1 𝑁−1
1 𝑊𝑁 𝑊𝑁 𝑊𝑁 … 𝑊𝑁
(𝑁−1)𝑘
𝑋 𝑘 = 𝑥 0 . 1 + 𝑥 1 . 𝑊𝑁1𝑘 + 𝑥 2 . 𝑊𝑁2𝑘 + ⋯ + 𝑥 𝑁 − 1 𝑊𝑁 1 1 … 1
𝑋𝑁 = 𝑊𝑁 𝑥𝑁 1 𝑊𝑁−1 −(𝑁−1)
𝑘=0 𝑊𝑁−1 = ⋮ ⋱ 𝑊𝑁

𝑋 0 = 𝑥 0 + 𝑥 1 + 𝑥 2 + ⋯+ 𝑥 𝑁 − 1 𝑥𝑁 = 𝑊𝑁−1 𝑋𝑁 1 𝑊𝑁
− 𝑁−1
… 𝑊𝑁
−(𝑁−1)(𝑁−1)

𝑘=1
(𝑁−1)
𝑋 1 = 𝑥 0 + 𝑥 1 . 𝑊𝑁1 + 𝑥 2 . 𝑊𝑁2 + ⋯ + 𝑥 𝑁 − 1 𝑊𝑁 IDFT
𝑁−1
1
⋮ 𝑥(𝑛) = ෍ 𝑋 𝑘 𝑤𝑁−𝑛𝑘 , 0 ≤ n ≤ N − 1
𝑁
𝑘=0
𝑘 =𝑁−1
𝑁−1
1 ∗ Comparing we get
𝑋 𝑁 − 1 = 𝑥 0 + 𝑥 1 . 𝑊𝑁
(𝑁−1) 2(𝑁−1)
+ 𝑥 2 . 𝑊𝑁
(𝑁−1)(𝑁−1)
+ ⋯ + 𝑥 𝑁 − 1 𝑊𝑁 𝑥(𝑛) = ෍ 𝑋 𝑘 𝑤𝑁𝑛𝑘
𝑁
𝑘=0
1 ∗
𝑊𝑁−1 = 𝑊
Symbolically we can 1 𝑁 𝑁
𝑥(𝑛) = 𝑋 𝑊∗
write as
www.iammanuprasad.com 𝑁 𝑁 𝑁
Twiddle factor matrix

𝑗2𝜋 Lies on the unit circle in the complex plane from 0 to 2π angle and it gets
𝑊𝑁 = 𝑒− 𝑁 repeated for every cycle
𝑒 𝑗𝜃 = cos 𝜃 + 𝑗𝑠𝑖𝑛 𝜃

Imaginary
𝑊20 𝑊20 1 1 axis
𝑊2 = =
𝑊20 𝑊21 1 −1 𝑊 3, 𝑊 7 , 𝑊 11
𝑗 Phase change ( 00 - 3600) -
anticlockwise

𝑊40 𝑊40 𝑊40 𝑊40 1 1 1 1 𝑊 2 , 𝑊 6 , 𝑊 10 𝑊0 , 𝑊4, 𝑊8


𝑊40 𝑊41 𝑊42 𝑊43 1 −𝑗 −1 𝑗 𝑊1 −1 1 Real axis
𝑊4 = =
𝑊40 𝑊42 𝑊44 𝑊46 1 −1 1 −1
1 𝑗 −1 −𝑗 Since e-jθ – clockwise
𝑊40 𝑊43 𝑊46 𝑊49
−𝑗
𝑊1 , 𝑊 5, 𝑊 9

www.iammanuprasad.com
Relationship of the DFT to Fourier Transform

Fourier-Transform DFT

𝑁−1 𝑁−1
𝑗2𝜋𝑘𝑛
𝑗𝜔 −𝑗𝜔𝑛 −
𝑋 𝑒 = ෍𝑥 𝑛 𝑒 𝑋 𝑘 = ෍𝑥 𝑛 𝑒 𝑁
𝑛=0 𝑛=0

Comparing the above equations we get to find that DFT of x(n)


is a sampled version of the FT of the sequence

𝑋 𝑘 = 𝑋(𝑒 𝑗𝜔 )ቚ 2𝜋𝑘 , 𝑘 = 0,1,2, … 𝑁 − 1


𝜔= 𝑁

Relationship between DFT & Fourie Transform

www.iammanuprasad.com
Relationship of the DFT to Z-Transform
𝑗2𝜋𝑘 𝑁
Z-Transform IDFT 𝑁−1 −1
1 1− 𝑒 𝑁 𝑧
𝑋(𝑧) = ෍ 𝑋(𝑘) 𝑗2𝜋𝑘
𝑁
𝑁−1 𝑁−1 𝑘=0 1 − 𝑒 𝑁 𝑧 −1
−𝑛 1 𝑗2𝜋𝑘𝑛
𝑋 𝑍 = ෍𝑥 𝑛 𝑧 𝑥(𝑛) = ෍ 𝑋 𝑘 𝑒 𝑁
𝑁 𝑁−1
𝑛=0 𝑘=0 1 1 − 𝑒 𝑗2𝜋𝑘 𝑧 −𝑁
= ෍ 𝑋(𝑘) 𝑗2𝜋𝑘
𝑁
𝑘=0 1 − 𝑒 𝑁 𝑧 −1
Substitute the value of x(n)

In the above condition 𝑒 𝑗2𝜋𝑘 = 1 for all the values of k


𝑁−1 𝑁−1
1 𝑗2𝜋𝑘𝑛
𝑋 𝑍 =෍ ෍ 𝑋 𝑘 𝑒 𝑁 𝑧 −𝑛 𝑁−1
𝑁 1 1 − 𝑧 −𝑁
𝑛=0 𝑘=0 = ෍ 𝑋(𝑘) 𝑗2𝜋𝑘
𝑁
𝑘=0 1− 𝑒 𝑁 𝑧 −1

𝑁−1 𝑁−1
1 𝑗2𝜋𝑘𝑛
= ෍ 𝑋(𝑘) ෍ 𝑒 𝑁 𝑧 −𝑛 𝑁−1
𝑁 1 − 𝑧 −𝑁 𝑋(𝑘)
𝑘=0 𝑛=0 𝑋 𝑧 = ෍ 𝑗2𝜋𝑘
𝑁−1 𝑁
N 𝑘=0 1−𝑒 𝑁 𝑧 −1
1−a
෍ 𝑎𝑛 =
𝑁−1 𝑁−1 𝑛 1−a
1 𝑗2𝜋𝑘 𝑘=0
= ෍ 𝑋(𝑘) ෍ 𝑒 𝑁 𝑧 −1 Relationship between DFT & Z- Transform
𝑁
𝑘=0 𝑛=0

www.iammanuprasad.com
Properties of Discrete Fourier Transform

Periodicity
Circular time shift
If X(k) is N-point DFT of a finite duration sequences x(n) then If X(k) is N-point DFT of a finite duration sequences x(n) then

𝑗2𝜋𝑘𝑚
𝑥 𝑛 + 𝑁 = 𝑥 𝑛 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑛 𝐷𝐹𝑇 𝑥 𝑛 − 𝑚 𝑁
= 𝑋 𝑘 𝑒− 𝑁

X 𝑘 + 𝑁 = 𝑋 𝑘 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑘
Proof
IDFT
𝑁−1
Linearity 1 𝑗2𝜋𝑘𝑛
𝑥(𝑛) = ෍ 𝑋 𝑘 𝑒 𝑁 , 0 ≤ n ≤ N − 1
𝑁
𝑘=0
If two finite sequences x1(n) and x2(n) are linearly combined as Put n=n-m
𝑁−1
𝑥3 𝑛 = 𝑎𝑥1 𝑛 + 𝑏𝑥2 (𝑛) 1 𝑗2𝜋𝑘(𝑛−𝑚)
𝑥(𝑛 − 𝑚) = ෍ 𝑋 𝑘 𝑒 𝑁
𝑁 Take DFT on both sides
𝑘=0
Then DFT of the sequence 𝑁−1
1 𝑗2𝜋𝑘𝑛 −𝑗2𝜋𝑘𝑚
= ෍𝑋 𝑘 𝑒 𝑁 𝑒 𝑁
𝑋3 𝑘 = 𝑎𝑋1 𝑘 + 𝑏𝑋2 (𝑘) 𝑁 −𝑗2𝜋𝑘𝑚
𝑘=0 𝐷𝐹𝑇{𝑥(𝑛 − 𝑚)} = 𝑋(𝑘)𝑒 𝑁

−𝑗2𝜋𝑘𝑚
𝐷𝐹𝑇 𝑥(𝑛 − 𝑚) = 𝑥(𝑛)𝑒 𝑁
𝑎𝑥1 𝑛 + 𝑏𝑥2 (𝑛) 𝑎𝑋1 𝑘 + 𝑏𝑋2 (𝑘)

www.iammanuprasad.com
Q) Consider a finite length sequences x(n) shown in figure. The five point DF of x(n) is denoted by
X(k). Plot the sequences whose DFT is
𝑗2𝜋𝑘𝑚
−4𝜋𝑘 𝑥(𝑛) 𝐷𝐹𝑇 𝑥 𝑛 − 𝑚 = 𝑋 𝑘 𝑒− 𝑁
𝑌 𝑘 = 𝑒 5 𝑋(𝑘) 2 2 𝑁

1 1

-1 0 1 2 3
Solution

𝑗2𝜋𝑘2
𝐷𝐹𝑇 𝑥 𝑛 − 2 5
= 𝑋 𝑘 𝑒− 5 ,𝑛 = 0,1, … , 4

For n=0 ➔ 𝑦 0 = 𝑥 0−2 5


=𝑥 5+0−2 =𝑥 3 =1

For n=1 ➔ 𝑦 1 = 𝑥 1−2 5


= 𝑥 5+1−2 = 𝑥 4 = 0

For n=2 ➔ 𝑦 2 = 𝑥 2−2 5 =𝑥 5+2−2 =𝑥 5 =𝑥 5−5 =𝑥 0 =1 Exceeding the limit 0 ≤ 𝑛 ≤ 4

For n=3 ➔ 𝑦 3 = 𝑥 3−2 5


=𝑥 5+3−2 =𝑥 6 =𝑥 6−5 =𝑥 1 =2 𝑦(𝑛)
2 2
For n=4 ➔ 𝑦 4 = 𝑥 4−2 5
=𝑥 5+4−2 =𝑥 7 =𝑥 7−5 =𝑥 2 =2
1 1

𝑦 𝑛 = 1,0,1,2,2
-1 0 1 2 3 4
www.iammanuprasad.com
Properties of Discrete Fourier Transform

Circular frequency shift


If X(k) is N-point DFT of a finite duration sequences x(n) then

Time reversal of the sequence


𝑗2𝜋𝑙𝑛
𝐷𝐹𝑇 𝑥 𝑛 𝑒 𝑁 =𝑋 𝑘−𝑙 𝑁
The time reversal of N-point sequence x(n) is attained by
wrapping the sequence x(n) around the circle in clockwise direction.
Proof
DFT 𝑁−1
𝑗2𝜋𝑘𝑛
𝑋 𝑘 = ෍ 𝑥 𝑛 𝑒− 𝑁 ,0 ≤ k ≤ N − 1
𝑛=0
𝑥 −𝑛 𝑁
= 𝐷𝐹𝑇 𝑥 𝑁 − 𝑛 =𝑋 𝑁−𝑘
Put k=k-l
𝑁−1
𝑗2𝜋(𝑘−𝑙)𝑛

𝑋 𝑘−𝑙 = ෍𝑥 𝑛 𝑒 𝑁
Take DFT on both sides
𝑛=0
𝑁−1
𝑗2𝜋𝑘𝑛 𝑗2𝜋𝑙𝑛
= ෍ 𝑥 𝑛 𝑛𝑒 − 𝑁 𝑒 𝑁
𝑗2𝜋𝑙𝑛
𝑛=0 𝑋 𝑘−𝑙 𝑁
= 𝐷𝐹𝑇 𝑥(𝑛)𝑒 𝑁

𝑗2𝜋𝑙𝑛
𝑥(𝑘 − 𝑙) = 𝑋 𝑘 𝑒 𝑁

www.iammanuprasad.com
Properties of Discrete Fourier Transform

Complex conjugate property


∗ 𝑗2𝜋𝑛𝑁
𝑁−1
If X(k) is N-point DFT of a finite duration sequences x(n) then
𝑗2𝜋𝑘𝑛 𝑒− 𝑁 = 𝑒 −𝑗2𝜋𝑛 = 1
𝐷𝐹𝑇 𝑥 𝑛 = ෍𝑥 𝑛 𝑒 𝑁
𝑛=0


∗ ∗ ∗ 𝑁−1
𝐷𝐹𝑇 𝑥 𝑛 =𝑋 𝑁−𝑘 =𝑋 −𝑘 𝑁
𝑗2𝜋𝑘𝑛

𝑗2𝜋𝑛𝑁
= ෍𝑥 𝑛 𝑒 𝑁 𝑒 𝑁
𝑛=0


𝑁−1
Proof 𝑗2𝜋𝑛 𝑁−𝑘
= ෍ 𝑥 𝑛 𝑒− 𝑁

𝑁−1 𝑛=0
𝑗2𝜋𝑘𝑛
𝐷𝐹𝑇 𝑥 𝑛 = ෍𝑥 𝑛 𝑒− 𝑁
𝑛=0

𝐷𝐹𝑇 𝑥 𝑛 = 𝑋 𝑁−𝑘
𝑁−1
𝑗2𝜋𝑘𝑛
∗ ∗ −
𝐷𝐹𝑇 𝑥 𝑛 = ෍𝑥 𝑛 𝑒 𝑁
𝑛=0

www.iammanuprasad.com
Q) Let X(k) be a 14 point DFT of a length 14 real sequence x(n). The first 8 samples of X(k) are given by,
X(0) = 12,
X(1) = -1+3j ,
X(2) = 3+4j,
X(3) = 1-5j,
X(4) = -2+2j,

𝐷𝐹𝑇 𝑥 𝑛 = 𝑋 𝑁−𝑘
X(5) = 6+3j,
X(6) = -2-3j,
X(7) = 10. Determine the remining samples

Solution
Given N=14
For n=8 ➔ 𝑋 8 = 𝑋 ∗ 𝑁 − 𝑘 = 𝑋 ∗ 14 − 8 = 𝑋 ∗ 6 = −2 + 3𝑗

For n=9 ➔ 𝑋 9 = 𝑋 ∗ 𝑁 − 𝑘 = 𝑋 ∗ 14 − 9 = 𝑋 ∗ 5 = 6 − 3𝑗

For n=10 ➔ 𝑋 10 = 𝑋 ∗ 𝑁 − 𝑘 = 𝑋 ∗ 14 − 10 = 𝑋 ∗ 4 = −2 − 2𝑗

For n=11 ➔ 𝑋 11 = 𝑋 ∗ 𝑁 − 𝑘 = 𝑋 ∗ 14 − 11 = 𝑋 ∗ 3 = 1 + 5𝑗

For n=12 ➔ 𝑋 12 = 𝑋 ∗ 𝑁 − 𝑘 = 𝑋 ∗ 14 − 12 = 𝑋 ∗ 2 = 3 − 4𝑗

For n=13 ➔ 𝑋 13 = 𝑋 ∗ 𝑁 − 𝑘 = 𝑋 ∗ 14 − 13 = 𝑋 ∗ 1 = −1 − 3𝑗
www.iammanuprasad.com
Linear Convolution
Consider a discrete sequence x(n) of length L and impulse sequence h(n) of length M,
the equation for linear convolution is
3
x(k) 2

𝑦 𝑛 = ෍ 𝑥 𝑘 ℎ 𝑛−𝑘 1 1
𝑘=−∞

-3 -2 -1 0 1 2 3
Where length of y(n) is L+M-1
h(k) 1 1 1
Let’s discuss it with an example

Q) Find the convolution of x(n) = {1,2,3,1}, h(n)={1,1,1,} -3 -2 -1 0 1 2 3


h(-k) 1 1 1
Solution
L = 4, M = 3 -3 -2 -1 0 1 2 3

𝑦 𝑛 = ෍ 𝑥 𝑘 ℎ 𝑛−𝑘 Of length → 4+3-1 = 6


𝑘=−∞

For n=0 ➔ 𝑦 0 = ෍ 𝑥 𝑘 ℎ −𝑘 = 1.0 + 1.0 + 1.1 + 0.2 + 0.3 + 0.1 =1


𝑘=−∞

www.iammanuprasad.com
∞ ∞ 3
For n=1 ➔ 𝑦 1 = ෍ 𝑥 𝑘 ℎ 1 − 𝑘 = ෍ 𝑥 𝑘 ℎ −𝑘 + 1 x(k) 2
𝑘=−∞ 𝑘=−∞ 1
1

= 1.0 + 1.1 + 1.2 + 0.3 + 0.1 = 3


∞ ∞ 3 2 -1 0 1 2 3
h(k) 1 1 1
For n=2 ➔ 𝑦 2 = ෍ 𝑥 𝑘 ℎ 2 − 𝑘 = ෍ 𝑥 𝑘 ℎ −𝑘 + 2
𝑘=−∞ 𝑘=−∞
3 2 -1 0 1 2 3
= 1.1 + 1.2 + 1.3 + 0.1 = 6 h(-k) 1 1 1
∞ ∞

For n=3 ➔ 𝑦 3 = ෍ 𝑥 𝑘 ℎ 3 − 𝑘 = ෍ 𝑥 𝑘 ℎ −𝑘 + 3 3 2 -1 0 1 2 3
𝑘=−∞ 𝑘=−∞ h(-k+1) 1 1 1

= 0.1 + 1.2 + 1.3 + 1.1 = 6


∞ ∞
3 2 -1 0 1 2 3
h(-k+2) 1 1 1
For n=4 ➔ 𝑦 4 = ෍ 𝑥 𝑘 ℎ 4 − 𝑘 = ෍ 𝑥 𝑘 ℎ −𝑘 + 4
𝑘=−∞ 𝑘=−∞
3 2 -1 0 1 2 3
= 0.1 + 0.2 + 1.3 + 1.1 = 4 h(-k+3) 1 1 1

∞ ∞

For n=5 ➔ 𝑦 5 = ෍ 𝑥 𝑘 ℎ 5 − 𝑘 = ෍ 𝑥 𝑘 ℎ −𝑘 + 5 3 2 -1 0 1 2 3
𝑘=−∞ 𝑘=−∞ h(-k+4) 1 1 1

= 0.1 + 0.2 + 0.3 + 1.1 = 1


3 2 -1 0 1 21 3 1 1
h(-k+5)
𝑦 𝑛 = 1,3,6,6,4,1 www.iammanuprasad.com
3 2 -1 0 1 2 3
Q) Find the convolution of x(n) = {1,2,3,1}, h(n)={1,1,1,}

Solution

1 1 1
1 1 1 1
+ +
2 2 2 2
+ + 𝑦 𝑛 = 1,3,6,6,4,1
3 3 3 3
+
+
1 1 1 1

www.iammanuprasad.com
Circular Convolution
Consider two discrete sequence x1(n) & x2(n) of length N with DFTs X1(k), X2(k)

Also
𝑁−1

𝑥3 𝑛 = ෍ 𝑥1 𝑚 𝑥2 𝑛 − 𝑚 𝑁 𝑥3 𝑛 = 𝑥1 𝑛 ⊙ 𝑥2 𝑛 𝐷𝐹𝑇 𝑥1 𝑛 ⊙ 𝑥2 𝑛 = 𝑋1 𝑘 . 𝑋2 𝑘
𝑚=0

Matrix method

Let’s discuss it with an example

Q) Find the circular convolution of x(n) = {1,2,3,4}, h(n)={1,-1,1,}

Solution
1 3 2 1 (1.1)+(4.-1)+(3.1)+(2.0) = 0
L = 4, M = 3
2 4 3 -1 (2.1)+(1.-1)+(4.1)+(3.0) = 5
Since lengths are not same we do zero-padding =
3 1 4 1 (3.1)+(2.-1)+(1.1)+(4.0) = 2
ℎ 𝑛 = 1, −1,1,0
4 2 1 0 (4.1)+(3.-1)+(2.1)+(2.0) = 3

𝑦 𝑛 = 0,5,2,3
www.iammanuprasad.com
Circular Convolution

Concentric Circle method / Stockholm's Method


Let’s discuss it with an example

Q) Find the circular convolution of x(n) = {1,2,3,4}, h(n)={1,-1,1,} 1

Solution
L = 4, M = 3 1

Since lengths are not same we do zero-padding

ℎ 𝑛 = 1, −1,1,0
2 −1 4
0
For n=0 ➔ 𝑦 0 = 1.1 + 2.0 + 3.1 + (4. −1) =0

For n=1 ➔ 𝑦 1 = 1. −1 + 2.1 + 3.0 + (4.1) =5

For n=2 ➔ 𝑦 2 = 1.1 + 2. −1 + 3.1 + (4.0) =2 1

For n=3 ➔ 𝑦 3 = 1.0 + 2.1 + 3. −1 + (4.1) =3


3

𝑦 𝑛 = 0,5,2,3
www.iammanuprasad.com
Linear convolution using circular convolution
Let there are two sequence x(n) with L and h(n) with length M. in linear convolution the length of output in L+M-1. In circular
convolution the length of the both input is L=M

Let’s discuss with an example

Q) Find the convolution of the sequences x(n) = {1,2,3,1}, h(n)={1,1,1,}

First we have to make the length of the x(n) and h(n) by adding zeros

𝑥 𝑛 = 1,2,3,1,0,0 (M-1 zeros)

ℎ 𝑛 = 1,1,1,0,0,0 (L-1 zeros)

1 0 1 3 2 1 (1.1)+(0.1)+(0.1)+(1.0) +(3.0) +(2.0) = 1


2 0 0 1 3 1 (2.1)+(1.1)+(0.1)+(0.0) +(1.0) +(3.0) = 3
3 1 0 0 1 1 (3.1)+(2.1)+(1.1)+(0.0) +(0.0) +(1.0) = 6
=
1 2 1 0 0 0 (1.1)+(3.1)+(2.1)+(1.0) +(0.0) +(0.0) = 6
0 3 2 1 0 0 (0.1)+(1.1)+(3.1)+(2.0) +(1.0) +(0.0) = 4
0 1 3 2 1 0 (0.1)+(0.1)+(1.1)+(3.0) +(2.0) +(1.0) = 1

𝑦 𝑛 = 1,3,6,6,4,1
www.iammanuprasad.com
Filtering of long duration sequences
1) Overlap – save method

Let’s consider an input sequence x(n) of length Ls and response h(n)of length M, the steps to
follow overlap – save method is

Step 1 : input x(n) is divided into length L (L≥M)


Step 2 : Calculate the length N=L+M-1
Step 3 : Add M-1 zeros to the start to first segment, each segment (length = L) has its first M-1 points coming from
previous segment, making each of length N
Step 4 : Make impulse response to length N by adding zeros
Step 5 ; Find the circular convolution of each new segments with new h(n)
Step 6 : Linearly combine each results and take sequence of length Ls+M-1 from that by discarding/removing first
M-1 points

www.iammanuprasad.com
1) Overlap – save method
Q) Find the convolution of the sequences x(n) = {3,-1,0,1,3,2,0,1,2,1} and h(n) ={1,1,1}

Solution

Given , Ls = 10 & M=3 Lets guess the value of L =3 (𝐿 ≥ 𝑀)

Step 1 : input x(n) is divided into length L

𝑥1 𝑛 = 3, −1,0

𝑥2 𝑛 = 1,3,2
𝑥3 𝑛 = 0,1,2
𝑥4 𝑛 = 1,0,0

Step 2 : Calculate the length N=L+M-1


𝑁 =𝐿+𝑀−1 =3+3−1=5

www.iammanuprasad.com
1) Overlap – save method

Step 3 : Add M-1 zeros to the start to first segment, each segment (length = L) has its first M-1 points coming from
previous segment, making each of length N

𝑥1 𝑛 = 0,0,3, −1,0
M-1 = 3-1 = 2
𝑥1 𝑛 = 3, −1,0
𝑥2 𝑛 = −1,0, 1,3,2 𝑥2 𝑛 = 1,3,2
𝑥3 𝑛 = 0,1,2
𝑥4 𝑛 = 1,0,0
𝑥3 𝑛 = 3,2,0,1,2

𝑥4 𝑛 = 1,2,1,0,0

Step 4 : Make impulse response to length N by adding zeros

ℎ 𝑛 = 1,1,1,0,0

www.iammanuprasad.com
1) Overlap – save method

Step 5 ; Find the circular convolution of each new segments with new h(n)

𝑦1 𝑛 = 𝑥1 𝑛 ⊙ ℎ(𝑛) = 0,0,3, −1,0 ⊙ 1,1,1,0,0 = −1,0,3,2,2 0 0 −1 3 0 1


0 0 0 −1 3 1
𝑦2 (𝑛) = 𝑥2 𝑛 ⊙ ℎ(𝑛) = −1,0, 1,3,2 ⊙ 1,1,1,0,0 = 4, 1, 0, 4, 6 3 0 0 0 −1 1
−1 3 0 0 0 0
𝑦3 (𝑛) = 𝑥3 𝑛 ⊙ ℎ(𝑛) = 3,2,0,1,2 ⊙ 1,1,1,0,0 = 6, 7, 5, 3, 3 0 −1 3 0 0 0
𝑦4 (𝑛) = 𝑥4 𝑛 ⊙ ℎ(𝑛) = 1,2,1,0,0 ⊙ 1,1,1,0,0 = 1, 3, 4, 3, 1

Step 6 : Linearly combine each results and take sequence of length Ls+M-1 from that by discarding/removing first M-1
points
M-1 = 3-1 = 2
Check whether length of y(n) is Ls+M-1 , if yes
discard the higher sequences
𝑦 𝑛 = {3, 2, 2, 0, 4, 6, 5, 3, 3, 4, 3, 1}
Ls+M-1 = 10+3-1 = 12

www.iammanuprasad.com
1) Overlap – save method
Q) Find the convolution of the sequences x(n) = {1,2,-1,2,3,-2,-3,-1,1,1,2,-1} and h(n) ={1,2} using overlap-save method

Solution

Given , Ls = 12 & M=2 Lets guess the value of L =3 (𝐿 ≥ 𝑀)

Step 1 : input x(n) is divided into length L

𝑥1 𝑛 = 1, 2, −1

𝑥2 𝑛 = 2,3, −2
𝑥3 𝑛 = −3, −1,1
𝑥4 𝑛 = 1,2, −1

Step 2 : Calculate the length N=L+M-1


𝑁 =𝐿+𝑀−1 =3+2−1=4

www.iammanuprasad.com
1) Overlap – save method

Step 3 : Add M-1 zeros to the start to first segment, each segment (length = L) has its first M-1 points coming from
previous segment, making each of length N

𝑥1 𝑛 = 0,1,2, −1
M-1 = 2-1 = 1
𝑥1 𝑛 = 1, 2, −1

𝑥2 𝑛 = −1,2,3, −2 𝑥2 𝑛 = 2,3, −2
𝑥3 𝑛 = −3, −1,1
𝑥4 𝑛 = 1,2, −1
𝑥3 𝑛 = −2, −3, −1,1

𝑥4 𝑛 = 1, 1, 2, −1

𝑥5 𝑛 = −1, 0,0,0

Step 4 : Make impulse response to length N by adding zeros

ℎ 𝑛 = 1, 2 , 0 , 0
www.iammanuprasad.com
1) Overlap – save method

Step 5 ; Find the circular convolution of each new segments with new h(n)

𝑦1 𝑛 = 𝑥1 𝑛 ⊙ ℎ(𝑛) = 0,1,2, −1 ⊙ 1,2, 0,0 = −2, 1, 4, 3 0 −1 2 1 1


1 0 −1 2 2
𝑦2 (𝑛) = 𝑥2 𝑛 ⊙ ℎ(𝑛) = −1,2,3, −2 ⊙ 1,2,0,0 = −5, 0, 7, 4 2 1 0 −1 0
−1 2 1 0 0
𝑦3 (𝑛) = 𝑥3 𝑛 ⊙ ℎ(𝑛) = −2, −3, −1,1 ⊙ 1,2, 0,0 = 0, −7, −7, −1
𝑦4 (𝑛) = 𝑥4 𝑛 ⊙ ℎ(𝑛) = 1, 1, 2, −1 ⊙ 1,2,0,0 = −1, 3, 4, 3
𝑦5 (𝑛) = 𝑥5 𝑛 ⊙ ℎ(𝑛) = −1, 0,0,0 ⊙ 1,2,0,0 = −1, −2, 0, 0

Step 6 : Linearly combine each results and take sequence of length Ls+M-1 from that by discarding/removing first M-1
points
Check whether length of y(n) is Ls+M-1 , if yes
𝑦 𝑛 = {1,4,3,0,7,4, −7, −7, −1,3,4,3, −2,0,0} discard the higher sequences

Ls+M-1 = 12+2-1 = 13
𝑦 𝑛 = {1,4,3,0,7,4, −7, −7, −1,3,4,3, −2}
www.iammanuprasad.com
Filtering of long duration sequences
2) Overlap – add method

Let’s consider an input sequence x(n) of length L1 and response h(n) of length M, the steps to
follow overlap – save method is

Step 1 : input x(n) is divided into length L (L≥M)


Step 2 : Calculate the length N=L+M-1
Step 3 : Add M-1 zeros on each segment (length = L) of x(n)
Step 4 : Make impulse response to length N by adding zeros
Step 5 ; Find the circular convolution of each new segments with new h(n)
Step 6 : Add last and first M-1 points of each segments, discard/remove excess point than L1+M-1

www.iammanuprasad.com
1) Overlap – add method
Q) Find the convolution of the sequences x(n) = {3,-1,0,1,3,2,0,1,2,1} and h(n) ={1,1,1}

Solution

Given , L1 = 10 & M=3 Lets guess the value of L =3 (𝐿 ≤ 𝑀)

Step 1: input x(n) is divided into length L (L≥M)

𝑥1 𝑛 = 3, −1,0

𝑥2 𝑛 = 1,3,2
𝑥3 𝑛 = 0,1,2
𝑥4 𝑛 = 1,0,0

Step 2 : Calculate the length N=L+M-1


𝑁 =𝐿+𝑀−1 =3+3−1=5

www.iammanuprasad.com
1) Overlap – add method

Step 3 : Add M-1 zeros on each segment (length = L) of x(n)

𝑥1 𝑛 = 3, −1, 0, 0, 0 M-1 = 3-1 = 2


𝑥1 𝑛 = 3, −1,0
𝑥2 𝑛 = 1, 3, 2, 0, 0
𝑥2 𝑛 = 1,3,2
𝑥3 𝑛 = 0, 1, 2, 0, 0 𝑥3 𝑛 = 0,1,2
𝑥4 𝑛 = 1,0,0
𝑥4 𝑛 = 1, 0, 0, 0, 0

Step 4 : Make impulse response to length N by adding zeros

ℎ 𝑛 = 1,1,1,0,0

www.iammanuprasad.com
1) Overlap – add method

Step 5 ; Find the circular convolution of each new segments with new h(n)

𝑦1 𝑛 = 𝑥1 𝑛 ⊙ ℎ(𝑛) = 3, −1, 0, 0, 0, ⊙ 1,1,1,0,0 = 3,2,2, −1,0 3 0 0 0 −1 1


−1 3 0 0 0 1
𝑦2 (𝑛) = 𝑥2 𝑛 ⊙ ℎ(𝑛) = 1, 3, 2, 0, 0 ⊙ 1,1,1,0,0 = 1,4,6,5,2 0 −1 3 0 0 1
0 0 −1 3 0 0
𝑦3 (𝑛) = 𝑥3 𝑛 ⊙ ℎ(𝑛) = 0, 1, 2, 0, 0 ⊙ 1,1,1,0,0 = 0,1,3,3,2 0 0 0 −1 3 0
𝑦4 (𝑛) = 𝑥4 𝑛 ⊙ ℎ(𝑛) = 1, 0, 0, 0, 0 ⊙ 1,1,1,0,0 = 1,1,1,0,0

Step 6 : Add last and first M-1 points of each segments, discard/remove excess point than L1+M-1

3, 2, 2, −1, 0
Check whether length of y(n) is L1+M-1 , if yes
1, 4, 6, 5, 2 discard the higher sequences

0,1, 3, 3, 2 L1+M-1 = 10+3-1 = 12

1, 1, 1, 0, 0
𝑦 𝑛 = {3, 2, 2, 0, 4, 6, 5, 3, 3, 4, 3, 1}
{3, 2, 2, 0, 4, 6, 5, 3, 3, 4, 3, 1, 0,0}
www.iammanuprasad.com
1) Overlap – add method
Q) Find the convolution of the sequences x(n) = {1,2,-1,2,3,-2,-3,-1,1,1,2,-1} and h(n) ={1,2} using overlap-add method

Solution

Given , Ls = 12 & M=2 Lets guess the value of L =3 (𝐿 ≥ 𝑀)

Step 1 : input x(n) is divided into length L

𝑥1 𝑛 = 1, 2, −1

𝑥2 𝑛 = 2,3, −2
𝑥3 𝑛 = −3, −1,1
𝑥4 𝑛 = 1,2, −1

Step 2 : Calculate the length N=L+M-1


𝑁 =𝐿+𝑀−1 =3+2−1=4

www.iammanuprasad.com
1) Overlap – save method

Step 3 : Add M-1 zeros on each segment (length = L) of x(n)

𝑥1 𝑛 = 1, 2, −1, 0 M-1 = 2-1 = 1


𝑥2 𝑛 = 2,3, −2,0 𝑥1 𝑛 = 1, 2, −1

𝑥3 𝑛 = −3, −1,1,0 𝑥2 𝑛 = 2,3, −2

𝑥4 𝑛 = 1, 2, −1,0 𝑥3 𝑛 = −3, −1,1


𝑥4 𝑛 = 1,2, −1

Step 4 : Make impulse response to length N by adding zeros

ℎ 𝑛 = 1, 2 , 0 , 0

www.iammanuprasad.com
1) Overlap – save method

Step 5 ; Find the circular convolution of each new segments with new h(n)

𝑦1 𝑛 = 𝑥1 𝑛 ⊙ ℎ(𝑛) = 1,2, −1,0 ⊙ 1,2, 0,0 = 1, 4, 3,2 1 0 −1 2 1


2 1 0 −1 2
𝑦2 (𝑛) = 𝑥2 𝑛 ⊙ ℎ(𝑛) = 2,3, −2,0 ⊙ 1,2,0,0 = 2,7, 4, −4 −1 2 1 0 0
0 −1 2 1 0
𝑦3 (𝑛) = 𝑥3 𝑛 ⊙ ℎ(𝑛) = −3, −1,1,0 ⊙ 1,2, 0,0 = −3, −7, −1,2
𝑦4 (𝑛) = 𝑥4 𝑛 ⊙ ℎ(𝑛) = 1, 2, −1,0 ⊙ 1,2,0,0 = 1, 4 , 3, −2

Step 6 : Add last and first M-1 points of each segments, discard/remove excess point than L1+M-1
1, 4, 3, 2
Check whether length of y(n) is Ls+M-1 , if yes
−2, 7, 4, −4 discard the higher sequences
−3, −7, −1, 2 Ls+M-1 = 12+2-1 = 13
1, 4, 3, −2
𝑦 𝑛 = {1,4,3,0,7,4, −7, −7, −1,3,4,3, −2}
{1, 4, 3, 0, 7, 4, −7, −7, −1, 3, 4, 3, −2, }

www.iammanuprasad.com
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
YouTube - IMPLearn
Finite Impulse Response (FIR) Filters

• What is a Filter?
• Any medium through which the signal passes, whatever its form, can be regarded as a filter.
• However, we do not usually think of something as a filter unless it can modify the signal in some way. For example,
speaker wire is not considered a filter, but the speaker is

• A digital filter is just a filter that operates on digital signals, such as sound represented inside a
computer.
• It is a computation which takes one sequence of numbers (the input signal) and produces a new
sequence of numbers (the filtered output signal).

Types of Filter

www.iammanuprasad.com
YouTube - IMPLearn
Finite Impulse Response (FIR) Filters

• It is one of two main types of digital filters used in DSP applications.


• FIR filter gets its name because the same number (finite) input values you get going into the filter, you get coming out of
the output
• The design methods of FIR filter based on approximation of ideal filter
• Properties of FIR filter
• Require no feedback: This means that any rounding errors are not compounded by summed iterations. The same
relative error occurs in each calculation. This also makes implementation simpler.
• Inherent stability: This is due to the fact that, because there is no required feedback, all the poles are located at the
origin and thus are located within the unit circle (the required condition for stability in a Z transformed system).
• Phase Issue: can easily be designed to be linear phase by making the coefficient sequence symmetric; linear phase,
or phase change proportional to frequency, corresponds to equal delay at all frequencies. This property is
sometimes desired for phase-sensitive applications, for example data communications, crossover filters, and
mastering.
• The main disadvantage of FIR filters is that considerably more computation power

www.iammanuprasad.com
YouTube - IMPLearn
Finite Impulse Response (FIR) Filters

• A discrete-time FIR filter of order N. The top part is an N-stage delay line with N +
1 taps. Each unit delay is a z−1 operator in the Z-transform notation.
• The output y of a linear time invariant system is determined by convolving its input
signal x with its impulse response b.
• For a discrete-time FIR filter, the output is a weighted sum of the current and a
finite number of previous values of the input.
• The operation is described by the following equation, which defines the output
sequence y[n] in terms of its input sequence x[n]:

𝑦 𝑛 = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 1 + 𝑏2 𝑥 𝑛 − 2 + … + 𝑏𝑁 𝑥 𝑛 − 𝑁

𝑁−1

𝑦 𝑛 = ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘
𝑘=0

• x(n) : is the input sequence


• y(n) : is the output sequence
• bk : filter coefficients that make up the impulse response
• N: is the filter order
www.iammanuprasad.com
YouTube - IMPLearn
FIR Impulse response

𝑁−1 𝑁−1

𝑦 𝑛 = ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘 ℎ(𝑛) = ෍ 𝑏𝑘 𝛿 𝑛 − 𝑘
𝑘=0 𝑘=0

The Z-transform of the impulse response yields the transfer function of the FIR filter

H(𝑧) = 𝑍 ℎ 𝑛

= ෍ ℎ 𝑛 𝑧 −𝑛
𝑛=−∞

𝑁−1

𝐻 𝑧 = ෍ 𝑏𝑛 𝑧 −𝑛
𝑛=0

www.iammanuprasad.com
YouTube - IMPLearn
Linear phase FIR filter – Symmetric Impulse response
Let h(n) be an impulse response of a system then its Fourier transform can
be expressed as (4) / (3)
𝑁−1
𝑗𝜔 −𝑗𝜔𝑛
σ𝑁−1
𝑛=0 ℎ 𝑛 sin 𝜔𝑛 sin 𝛼𝜔
𝐻 𝑒 = ෍ℎ 𝑛 𝑒 ----------------- (1) =
𝑛=0
σ𝑁−1
𝑛=0 ℎ 𝑛 cos 𝜔𝑛 cos 𝛼𝜔
Since H(ejωn) is a complex value for linear phase FIR filter , then we can 𝑁−1 𝑁−1
represent it in terms of magnitude and phase ෍ ℎ 𝑛 sin 𝜔𝑛 cos 𝛼𝜔 = ෍ ℎ 𝑛 cos 𝜔𝑛 sin 𝛼𝜔
𝑛=0 𝑛=0
𝐻 𝑒 𝑗𝜔 = ± 𝐻 𝑒 𝑗𝜔 𝑒 −𝑗𝛼𝜔 ----------------- (2)
𝑁−1
Equating (1) & (2) 0 = ෍ ℎ 𝑛 cos 𝜔𝑛 sin 𝛼𝜔 − sin 𝜔𝑛 cos 𝛼𝜔
𝑁−1
𝑛=0
−𝑗𝜔𝑛 𝑗𝜔 −𝑗𝛼𝜔 sin 𝐴 − 𝐵 = sin 𝐴 cos 𝐵 − cos 𝐴 sin 𝐵
෍ℎ 𝑛 𝑒 =±𝐻 𝑒 𝑒
𝑛=0
𝑒 −𝑗𝜃 = cos 𝜃 − 𝑗 sin 𝜃 𝑁−1
𝑁−1 ෍ ℎ 𝑛 sin 𝛼 − 𝑛 𝜔 = 0
𝑗𝜔
෍ ℎ 𝑛 cos 𝜔𝑛 − 𝑗 sin 𝜔𝑛 = ± 𝐻 𝑒 cos 𝛼𝜔 − 𝑗 sin 𝛼𝜔 𝑛=0
𝑛=0

Equating sin and cos terms The above equation will be zero when
𝑁−1

෍ ℎ 𝑛 cos 𝜔𝑛 = ± 𝐻 𝑒 𝑗𝜔 cos 𝛼𝜔 ----------------- (3) ℎ 𝑛 =ℎ 𝑁−1−𝑛


𝑛=0
𝑁−1
𝑁−1 𝛼=
2
෍ ℎ 𝑛 sin 𝜔𝑛 = ± 𝐻 𝑒 𝑗𝜔 sin 𝛼𝜔 ----------------- (4)
𝑛=0 www.iammanuprasad.com
YouTube - IMPLearn
Linear phase FIR filter – Symmetric Impulse response
The expression for Phase delay and group delay are ℎ 𝑛 =ℎ 𝑁−1−𝑛
−𝜃 𝜔 −𝑑𝜃 𝜔 𝑁−1
τ𝑝 = τ𝑔 = 𝛼=
𝜔 𝑑𝜔 2
For FIR filter

𝜃 𝜔 = −𝛼𝜔 , −𝜋 ≤ 𝜔 ≤ 𝜋 From the equations and the conditions we can conclude that FIR filter will have
𝑁−1
constant phase and group delays when the impulse response is symmetrical about 𝛼 =
2

For N is even
For N is odd

3 3 3
2 2 2 2
2 2
1 1
1 1

0 1 2 3 4 5
0 1 2 3 4 5 6
𝑁−1 6−1
𝑁−1 7−1 𝛼= = = 2.5
𝛼= = =3 2 2
2 2
ℎ 𝑛 =ℎ 𝑁−1−𝑛
ℎ 𝑛 =ℎ 𝑁−1−𝑛
ℎ 5 =ℎ 6−1−5
ℎ 5 =ℎ 7−1−5
=ℎ 0 www.iammanuprasad.com
=ℎ 1
YouTube - IMPLearn
Linear phase FIR filter – Antisymmetric Impulse response
𝜃 𝜔 = 𝛽 − 𝛼𝜔
Let h(n) be an impulse response of a system then its Fourier transform can
be expressed as (4) / (3)
𝑁−1
𝑗𝜔 −𝑗𝜔𝑛
σ𝑁−1
𝑛=0 ℎ 𝑛 sin 𝜔𝑛 sin(𝛽 − 𝛼𝜔)
𝐻 𝑒 = ෍ℎ 𝑛 𝑒 ----------------- (1) =
𝑛=0
σ𝑁−1
𝑛=0 ℎ 𝑛 cos 𝜔𝑛 cos(𝛽 − 𝛼𝜔)
𝑁−1 𝑁−1
Since H(ejωn) is a complex value for linear phase FIR filter , then we can
represent it in terms of magnitude and phase. If only constant group delay ෍ ℎ 𝑛 sin 𝜔𝑛 cos(𝛽 − 𝛼𝜔) = ෍ ℎ 𝑛 cos 𝜔𝑛 sin(𝛽 − 𝛼𝜔)
is required 𝑛=0 𝑛=0
𝐻 𝑒 𝑗𝜔 = ± 𝐻 𝑒 𝑗𝜔 𝑒 −𝑗(𝛽−𝛼𝜔) ----------------- (2) 𝑁−1

Equating (1) & (2) 0 = ෍ ℎ 𝑛 cos 𝜔𝑛 sin(𝛽 − 𝛼𝜔) − sin 𝜔𝑛 cos(𝛽 − 𝛼𝜔)
𝑁−1 𝑛=0

෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 = ± 𝐻 𝑒 𝑗𝜔 𝑒 −𝑗(𝛽−𝛼𝜔) sin 𝐴 − 𝐵 = sin 𝐴 cos 𝐵 − cos 𝐴 sin 𝐵


𝑁−1
𝑛=0
𝑒 −𝑗𝜃 = cos 𝜃 − 𝑗 sin 𝜃 ෍ ℎ 𝑛 sin 𝛽 − (𝛼 − 𝑛)𝜔 =0
𝑁−1
𝑛=0
෍ ℎ 𝑛 cos 𝜔𝑛 − 𝑗 sin 𝜔𝑛 = ± 𝐻 𝑒 𝑗𝜔 cos(𝛽 − 𝛼𝜔) − 𝑗 sin(𝛽 − 𝛼𝜔)
𝑛=0 𝜋
𝛽= The equation will be zero when
2
Equating sin and cos terms
𝑁−1
𝑁−1
෍ ℎ 𝑛 cos 𝛼 − 𝑛 𝜔 = 0 ℎ 𝑛 = −ℎ 𝑁 − 1 − 𝑛
෍ ℎ 𝑛 cos 𝜔𝑛 = ± 𝐻 𝑒 𝑗𝜔 cos(𝛽 − 𝛼𝜔) ----------------- (3)
𝑛=0
𝑛=0
𝑁−1
𝑁−1
𝛼=
2
෍ ℎ 𝑛 sin 𝜔𝑛 = ± 𝐻 𝑒 𝑗𝜔 sin(𝛽 − 𝛼𝜔) ----------------- (4)
𝑛=0 www.iammanuprasad.com
YouTube - IMPLearn
Linear phase FIR filter – Asymmetric Impulse response
The expression for Phase delay and group delay are ℎ 𝑛 = −ℎ 𝑁 − 1 − 𝑛
−𝜃 𝜔 −𝑑𝜃 𝜔 𝑁−1
τ𝑝 = τ𝑔 = 𝛼=
𝜔 𝑑𝜔 2
For FIR filter

𝜃 𝜔 = 𝛽 − 𝛼𝜔 , −𝜋 ≤ 𝜔 ≤ 𝜋 From the equations and the conditions we can conclude that FIR filter will have
constant group delay and not constant phase delay

For N is odd For N is even

𝑁−1 7−1 𝑁−1 6−1


2 𝛼= = =3 2 𝛼= = = 2.5
2 2 2 2
1 ℎ 𝑛 = −ℎ 𝑁 − 1 − 𝑛 1 ℎ 𝑛 = −ℎ 𝑁 − 1 − 𝑛
ℎ 5 = −ℎ 7 − 1 − 5 ℎ 5 = −ℎ 6 − 1 − 5
0 1 2 3 4 5 6 0 1 2 3 4 5
= −ℎ 1 1 =ℎ 0
-1
-2 -2

www.iammanuprasad.com
YouTube - IMPLearn

Frequency response of Linear phase FIR filters

Depending on the value of N and the type of symmetry of filter impulse response sequence
there are mainly 4 types of linear phase FIR filter

Symmetrical impulse Symmetrical impulse Antisymmetric impulse Antisymmetric impulse


response , N=odd response , N=even response , N=odd response , N=even

www.iammanuprasad.com
YouTube - IMPLearn
Case1 : Symmetrical impulse response and N - odd
ℎ 𝑛 3 To arrange the limit we assume
2 2 𝑁=7
When 𝑛 =
𝑁+1 When 𝑛 = 𝑁 − 1
2
1 1 𝑚 =𝑁−1−𝑛 𝑁+1
𝑁−1 =𝑁−1−𝑚 𝑁−1=𝑁−1−𝑚
𝛼= =3 2
2 𝑛 =𝑁−1−𝑚
0 1 2 3 4 5 6 𝑁−3
𝑚= 𝑚=0
2
Substitute in (1)
Given h(n) and find the Fourier transform H(ejω)
𝑁−3 𝑁−3
2 2
𝑁−1
𝑗𝜔 −𝑗𝜔𝑛
𝑁 − 1 −𝑗𝜔 𝑁−1
𝑗𝜔 −𝑗𝜔𝑛 𝐻 𝑒 = ෍ℎ 𝑛 𝑒 +ℎ 𝑒 2 + ෍ ℎ 𝑁 − 1 − 𝑚 𝑒 −𝑗𝜔 𝑁−1−𝑚
𝐻 𝑒 = ෍ℎ 𝑛 𝑒 2
𝑛=0 𝑚=0
𝑛=0
Put m=n
𝑁−1 𝑁−3 𝑁−3
Since N is odd the centre of symmetry will be at n = 2 2
2
𝑗𝜔 −𝑗𝜔𝑛
𝑁 − 1 −𝑗𝜔 𝑁−1
𝐻 𝑒 = ෍ℎ 𝑛 𝑒 +ℎ 𝑒 2 + ෍ ℎ 𝑁 − 1 − 𝑛 𝑒 −𝑗𝜔 𝑁−1−𝑛
2
Now lets split the equation into three parts 𝑛=0 𝑛=0

𝑁−3 For symmetric impulse response ℎ 𝑛 = ℎ 𝑁 − 1 − 𝑛


2 𝑁−1
𝑗𝜔 −𝑗𝜔𝑛
𝑁 − 1 −𝑗𝜔 𝑁−1
𝐻 𝑒 = ෍ℎ 𝑛 𝑒 +ℎ 𝑒 2 + ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 𝑁−3 𝑁−3
2 2
𝑁 − 1 −𝑗𝜔 𝑁−1 2
𝑛=0 𝑁+1
𝑛=
2 𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 + ℎ 𝑒 2 + ෍ ℎ 𝑛 𝑒 −𝑗𝜔 𝑁−1−𝑛
2
----------------- (1) 𝑛=0 𝑛=0

www.iammanuprasad.com
YouTube - IMPLearn
Case1 : Symmetrical impulse response and N - odd
𝑁−3 𝑁−3
2 2
𝑁 − 1 −𝑗𝜔 𝑁−1
𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 + ℎ 𝑒 2 + ෍ ℎ 𝑛 𝑒 −𝑗𝜔 𝑁−1−𝑛
2 Let When 𝑛 =
𝑁−3
𝑛=0 𝑛=0 When 𝑛 = 0 2
𝑁−1
𝑁−1 𝑘= −𝑛 𝑁−1 𝑁−3 𝑁−1
Taking 𝑒
−𝑗𝜔
2 outside 2 0= −𝑘 = −𝑘
𝑁−1 2 2 2
𝑛= −𝑘
𝑁−3 2 𝑁−1
2 𝑘= 𝑘=1
−𝑗𝜔
𝑁−1 𝑁−1 𝑗𝜔
𝑁−1
𝑗𝜔
𝑁−1 2
𝐻 𝑒 𝑗𝜔 = 𝑒 2 ℎ + ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 . 𝑒 2 + 𝑒 −𝑗𝜔 𝑁−1−𝑛 . 𝑒 2 𝑁−1
2 2
𝑛=0
−𝑗𝜔
𝑁−1 𝑁−1 𝑁−1
𝐻 𝑒 𝑗𝜔 = 𝑒 2 ℎ + ෍ 2ℎ − 𝑘 cos 𝜔𝑘
2 2
𝑁−3 𝑘=1
2 𝑁−1
−𝑗𝜔
𝑁−1 𝑁−1 𝑗𝜔
𝑁−1
−𝑛 −𝑗𝜔 𝑁−1−𝑛−
2 Put k = n
=𝑒 2 ℎ +෍ℎ 𝑛 𝑒 2 +𝑒 𝑁−1
2 2
𝑛=0 𝑁−1 𝑁−1 𝑁−1
𝑗𝜔 −𝑗𝜔
𝐻 𝑒 =𝑒 2 ℎ + ෍ 2ℎ − 𝑛 cos 𝜔𝑛
𝑁−3
2 2
𝑛=1
2
−𝑗𝜔
𝑁−1 𝑁−1 𝑗𝜔
𝑁−1
−𝑛 −𝑗𝜔
𝑁−1
−𝑛
=𝑒 2 ℎ +෍ℎ 𝑛 𝑒 2 +𝑒 2
𝑁−1
2 2
𝑛=0 𝑁−1
−𝑗𝜔
𝐻 𝑒 𝑗𝜔 = 𝑒 2 ෍ 𝑎 𝑛 cos 𝜔𝑛
2 cos 𝜃 = 𝑒 𝑗𝜃 + 𝑒 −𝑗𝜃 𝑛=1
𝑁−3 Where
2
−𝑗𝜔
𝑁−1 𝑁−1 𝑁−1 𝑁−1 𝑁−1
=𝑒 2 ℎ + ෍ ℎ 𝑛 2 cos 𝜔 −𝑛 𝑎 0 =ℎ 𝑎 𝑛 = 2ℎ −𝑛
2 2 2 2
𝑛=0
www.iammanuprasad.com
YouTube - IMPLearn
Case1 : Symmetrical impulse response and N - odd

𝑁−1
𝑁−1 2
𝑗𝜔 −𝑗𝜔
𝐻 𝑒 =𝑒 2 ෍ 𝑎 𝑛 cos 𝜔𝑛
𝑛=1

Where
𝑁−1 𝑁−1
𝑎 0 =ℎ 𝑎 𝑛 = 2ℎ −𝑛
2 2

From this we can express the amplitude and phase function

Amplitude Phase

𝑁−1
2
𝑗𝜔
𝑁−1
𝐻 𝑒 𝑗𝜔
= ෍ 𝑎 𝑛 cos 𝜔𝑛 ∠𝐻 𝑒 = −𝜔 = −𝛼𝜔
2
𝑛=1

www.iammanuprasad.com
YouTube - IMPLearn
Case2 : Symmetrical impulse response and N - even
ℎ 𝑛 To arrange the limit we assume
2 2 𝑁=6 𝑁 When 𝑛 = 𝑁 − 1
When 𝑛 =
2
1 1 𝑚 =𝑁−1−𝑛 𝑁
𝑁−1 =𝑁−1−𝑚
𝛼= = 2.5 2 𝑁−1=𝑁−1−𝑚
𝑛 =𝑁−1−𝑚
2
0 1 2 3 4 5 𝑁
𝑚= −1 𝑚=0
2
Substitute in (1)
Given h(n) and find the Fourier transform H(ejω)
𝑁−2 𝑁−2
2 2
𝑁−1 𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 + ෍ ℎ 𝑁 − 1 − 𝑚 𝑒 −𝑗𝜔 𝑁−1−𝑚
𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 𝑛=0 𝑚=0
𝑛=0 Put m=n
𝑁−1
Since N is even the centre of symmetry will be at n =
2 𝑁−3 𝑁−2
2 2
For symmetric impulse response with even number of samples and 𝑗𝜔 −𝑗𝜔𝑛
𝑁 − 1 −𝑗𝜔 𝑁−1
𝑁−2 𝑁 𝐻 𝑒 = ෍ℎ 𝑛 𝑒 +ℎ 𝑒 2 + ෍ ℎ 𝑁 − 1 − 𝑛 𝑒 −𝑗𝜔 𝑁−1−𝑛
centre of symmetry lies between 𝑛 = and 2
2 2 𝑛=0 𝑛=0

Then we can split the equation into two parts


For symmetric impulse response ℎ 𝑛 = ℎ 𝑁 − 1 − 𝑚
𝑁−2 𝑁−2 𝑁−1
2 𝑁−1
2 2
𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 + ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 ----------------- (1) 𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 + ෍ ℎ 𝑛 𝑒 −𝑗𝜔 𝑁−1−𝑛
𝑛=0 𝑁
𝑛= 𝑛=0 𝑛=0
2
www.iammanuprasad.com
YouTube - IMPLearn
Case2 : Symmetrical impulse response and N - even
𝑁−2 𝑁−2
2 2
𝐻 𝑒 𝑗𝜔 = ෍ ℎ 𝑛 𝑒 −𝑗𝜔𝑛 + ෍ ℎ 𝑛 𝑒 −𝑗𝜔 𝑁−1−𝑛 Let 𝑁−2
𝑁 When 𝑛 = 0 When 𝑛 =
2
𝑛=0 𝑛=0 𝑘 = −𝑛
2 𝑁 𝑁−2 𝑁
𝑁−1
−𝑗𝜔 0= −𝑘 = −𝑘
Taking 𝑒 2 outside 𝑁 2 2 2
𝑁−2 𝑛= −𝑘
2 2 𝑁
−𝑗𝜔
𝑁−1
𝑗𝜔
𝑁−1
𝑗𝜔
𝑁−1 𝑘= 𝑘=1
𝐻 𝑒 𝑗𝜔 = 𝑒 2 ෍ℎ 𝑛 𝑒 −𝑗𝜔𝑛 . 𝑒 2 + 𝑒 −𝑗𝜔 𝑁−1−𝑛 . 𝑒 2 2
𝑛=0
𝑁
𝑁−2 2
2 𝑁−1 −𝑗𝜔
𝑁−1 𝑁 1
−𝑗𝜔
𝑁−1
𝑗𝜔
𝑁−1
−𝑛 −𝑗𝜔 𝑁−1−𝑛−
2
𝐻 𝑒 𝑗𝜔 = 𝑒 2 ෍ 2ℎ − 𝑘 cos 𝜔 𝑘 −
= 𝑒 2 ෍ℎ 𝑛 𝑒 2 +𝑒 2 2
𝑘=1
𝑛=0
𝑁−2 Put k = n
𝑁
𝑁−1 2 𝑁−1 𝑁−1 2
= 𝑒
−𝑗𝜔
2 ෍ℎ 𝑛 𝑒
𝑗𝜔
2
−𝑛
+ 𝑒
−𝑗𝜔
2
−𝑛
𝑗𝜔 −𝑗𝜔
𝑁−1 𝑁 1
𝐻 𝑒 =𝑒 2 ෍ 2ℎ − 𝑛 cos 𝜔 𝑛 −
𝑛=0 2 2
𝑛=1

2 cos 𝜃 = 𝑒 𝑗𝜃 + 𝑒 −𝑗𝜃
𝑁
2
𝑁−2 −𝑗𝜔
𝑁−1 1
2 𝐻 𝑒 𝑗𝜔 = 𝑒 2 ෍ 𝑏 𝑛 cos 𝜔 𝑛 −
−𝑗𝜔
𝑁−1 𝑁−1 2
=𝑒 2 ෍ ℎ 𝑛 2 cos 𝜔 −𝑛 𝑛=1
2
𝑛=0 Where
𝑁
𝑏 𝑛 = 2ℎ −𝑛
𝑁−1 𝑁 1 2
−𝑛 = −𝑛−
2 2 2 www.iammanuprasad.com
YouTube - IMPLearn
Case2 : Symmetrical impulse response and N - even

𝑁
2
𝑗𝜔 −𝑗𝜔
𝑁−1 1
𝐻 𝑒 =𝑒 2 ෍ 𝑏 𝑛 cos 𝜔 𝑛 −
2
𝑛=1

Where
𝑁
𝑏 𝑛 = 2ℎ −𝑛
2

From this we can express the amplitude and phase function

Amplitude Phase

𝑁
2
1 𝑁−1
𝐻 𝑒 𝑗𝜔 = ෍ 𝑏 𝑛 cos 𝜔 𝑛 − ∠𝐻 𝑒 𝑗𝜔
= −𝜔 = −𝛼𝜔
2 2
𝑛=1

www.iammanuprasad.com
YouTube - IMPLearn
Case 3 : Antisymmetrical impulse response and N - odd

In the similar way of symmetric, we get for antisymmetric as

𝑁−1
𝑁−1 2
𝑗𝜋
−𝑗𝜔
𝐻 𝑒 𝑗𝜔 = 𝑒 2 𝑒2 ෍ 𝑐 𝑛 sin 𝜔 𝑛
𝑛=1

Where
𝑁−1
𝑐 𝑛 = 2ℎ −𝑛
2

From this we can express the amplitude and phase function

Amplitude Phase

𝑁−1
2
𝜋 𝑁−1 𝜋
𝐻 𝑒 𝑗𝜔
= ෍ 𝑐 𝑛 cos 𝜔 𝑛 ∠𝐻 𝑒 𝑗𝜔 = − 𝜔 = − 𝛼𝜔
2 2 2
𝑛=1

www.iammanuprasad.com
YouTube - IMPLearn
Case 4 : Ant symmetrical impulse response and N - even

In the similar way of symmetric, we get for antisymmetric as

𝑁
2
𝑗𝜔 −𝑗𝜔
𝑁−1 𝑗𝜋 1
𝐻 𝑒 =𝑒 2 𝑒2 ෍ 𝑑 𝑛 sin 𝜔 𝑛 −
2
𝑛=1

Where
𝑁
𝑑 𝑛 = 2ℎ −𝑛
2

From this we can express the amplitude and phase function

Amplitude Phase
𝑁
2
1 𝜋 𝑁−1 𝜋
𝐻 𝑒 𝑗𝜔
= ෍ 𝑑 𝑛 sin 𝜔 𝑛 − ∠𝐻 𝑒 𝑗𝜔 = − 𝜔 = − 𝛼𝜔
2 2 2 2
𝑛=1

www.iammanuprasad.com
YouTube - IMPLearn
SUMMARY

Case1 : Symmetrical impulse response and N - odd Case2 : Symmetrical impulse response and N – even

𝑁−1 𝑁
2 2
−𝑗𝜔
𝑁−1
𝑗𝜔 −𝑗𝜔
𝑁−1 1
𝐻 𝑒 𝑗𝜔
=𝑒 2 ෍ 𝑎 𝑛 cos 𝜔𝑛 𝐻 𝑒 =𝑒 2 ෍ 𝑏 𝑛 cos 𝜔 𝑛 −
2
𝑛=1 𝑛=1

Where Where
𝑁
𝑁−1 𝑁−1 𝑏 𝑛 = 2ℎ −𝑛
𝑎 0 =ℎ 𝑎 𝑛 = 2ℎ −𝑛 2
2 2

Case 3 : Ant symmetrical impulse response and N - odd Case 4 : Ant symmetrical impulse response and N - even

𝑁−1 𝑁
𝑁−1 2 2
𝑗𝜋 𝑁−1 𝑗𝜋 1
𝑗𝜔 −𝑗𝜔 𝑗𝜔 −𝑗𝜔
𝐻 𝑒 =𝑒 2 𝑒2 ෍ 𝑐 𝑛 sin 𝜔 𝑛 𝐻 𝑒 =𝑒 2 𝑒2 ෍ 𝑑 𝑛 sin 𝜔 𝑛 −
2
𝑛=1 𝑛=1

Where Where
𝑁−1 𝑁
𝑐 𝑛 = 2ℎ −𝑛 𝑑 𝑛 = 2ℎ −𝑛
2 2
www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter

Why do we need a filter?

A notch / band
A to D
Sensor stop filter (50-
converter
Hz)

Frequency response of a practical lowpass filter

www.iammanuprasad.com
YouTube - IMPLearn

Digital filter design

1. Determining specification : we need to know how strong the noise component is relative to the
desired signal and how much we need to suppress the noise. This information is necessary to find
the filter with minimum order for this application.
2. Finding a transfer function : we need to find a transfer function H(z) which will provide the
required filtering.
3. Choosing a realization structure : there are many systems which can give the obtained transfer
function and we must choose the appropriate one.
4. Implementing the filter : You have a couple of options for this step: a software implementation
(such as a MATLAB or C code) or a hardware implementation (such as a DSP, a microcontroller,
or an ASIC).

www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter : window method

Suppose that we want to design a lowpass filter with a cut off


frequency of ωc ,given frequency response

1 , 𝜔 < 𝜔𝑐
𝐻𝑑 𝜔 = ቊ
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

To find the equivalent time-domain representation, we calculate


the inverse discrete-time Fourier transform

𝜋
1
ℎ𝑑 𝑛 = න 𝐻𝑑 𝜔 𝑒 𝑗𝜔𝑛 𝑑𝜔
2𝜋
−𝜋

𝜔𝑐
1
= න 𝑒 𝑗𝜔𝑛 𝑑𝜔
2𝜋
−𝜔𝑐

needs an infinite number of input samples to


sin 𝑛𝜔𝑐 perform filtering and that the system is not a causal system. The
= solution will be to truncate the impulse response and use,
𝑛𝜋
www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter : window method

hd(n) Non causal system causal system & linear


𝑁−1
but the system is delayed by 𝑛 =
2

There for considering an applied shift to hd(n) and then multiplying with
window function W(n)

𝑁−1
ℎ 𝑛 = ℎ𝑑 𝑛 − ∗ 𝑊(𝑛)
2
www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter : window method

Frequency response of the filter designed by a rectangular window

www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter : window methods

Rectangular window Hanning window Hamming window

− 𝑁−1 𝑁−1 2𝜋𝑛 − 𝑁−1 𝑁−1 2𝜋𝑛 − 𝑁−1 𝑁−1


0.5 − 0.5 cos , ≤𝑛≤ 0.54 − 0.46 cos , ≤𝑛≤
𝑊𝑅 𝑛 = ቐ1 2
≤𝑛≤
2 𝑊𝐻𝑛 𝑛 =൞ 𝑁−1 2 2 𝑊𝐻𝑚 𝑛 = ൞ 𝑁−1 2 2
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

or or or

2𝜋𝑛 2𝜋𝑛
1 0≤𝑛≤𝑁 0.5 − 0.5 cos , 0≤𝑛≤𝑁 0.54 − 0.46 cos , 0≤𝑛≤𝑁
𝑊𝑅 𝑛 = ቊ 𝑊𝑅 𝑛 = ൞ 𝑁 𝑊𝑅 𝑛 = ൞ 𝑁
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter : window method

Design procedure

1. Choose desired frequency response of the filter 𝐻𝑑 𝑒 𝑗𝜔


2. Take the invert Fourier transform of 𝐻𝑑 𝑒 𝑗𝜔 to obtain ℎ𝑑 𝑛
3. Choose a window sequence 𝑊 𝑛 and multiply it with ℎ𝑑 𝑛 to convert
infinite duration impulse response to finite duration impulse response
ℎ 𝑛 = ℎ𝑑 𝑛 ∗ 𝑊 𝑛
4. The transfer function of the filter is obtained by taking Z-transform of h(n)

www.iammanuprasad.com
YouTube - IMPLearn 𝜋 𝜋 𝐻𝑑 𝑒 𝑗𝜔
1 𝑓𝑜𝑟 − ≤𝜔≤
Q) Design an ideal lowpass filter with frequency response 𝐻𝑑 𝑒 𝑗𝜔 =ቐ 2 2
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 1
find the value of h(n) for N=11 find H(z).

Solution 𝜋 𝜋

We can determine the desired impulse response ℎ𝑑 𝑛 by taking inverse 2 2
Fourier Transform From the figure we know 𝛼 = 0
𝜋 Since for n=0 the equation becomes infinity so lets
2
1 apply limit
ℎ𝑑 𝑛 = න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔
2𝜋 for n=0 𝑒 𝑗𝜃 − 𝑒 −𝑗𝜃

𝜋 sin 𝜃 =
2 𝜋𝑛 𝜋𝑛 2𝑗
sin sin 1
1 𝑗𝑛𝜋 −𝑗𝑛𝜋
ℎ 0 = lim 2 = lim 𝑛𝜋 2
= 𝑒 2 −𝑒 2 =
𝑛→0 𝑛𝜋 𝑛→0 2 2
2𝜋𝑗𝑛 2 sin 𝑛
lim =1
for n=1 𝜋 𝑛→0 𝑛
1 𝜋𝑛 𝜋𝑛 sin 1
= 2𝑗 sin sin ℎ 1 = 2 = = 0.318 = ℎ −1
= 2 𝜋
2𝜋𝑗𝑛 2 𝜋
𝑛𝜋
for n=2
sin 𝜋
ℎ 2 = =0 = ℎ −2
Truncating ℎ𝑑 𝑛 to 11 samples 2𝜋
for n=3 3𝜋 −1
sin = −0.106 = ℎ −3
ℎ 3 = 2 =
𝜋𝑛 3𝜋 3𝜋
sin 2
𝑓𝑜𝑟 = −5 ≤ 𝑛 ≤ 5
for n=4 4𝜋
ℎ𝑑 𝑛 = 𝑛𝜋 sin
ℎ 4 = 2 =0 = ℎ −4
4𝜋
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
for n=5 5𝜋 1
sin = 0.0636 = ℎ −5
ℎ 5 = 2 = www.iammanuprasad.com
5𝜋 5𝜋
YouTube - IMPLearn
Now lets find the transfer function of the filter by taking Z Transform

𝑁−1
2 5

𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑁−1 𝑛=−5
𝑛=−
2

= ℎ −5 𝑍 5 + ℎ −4 𝑍 4 + ℎ −3 𝑍 3 + ℎ −2 𝑍 2 + ℎ −1 𝑍1 + ℎ 0 + ℎ 1 𝑍 −1 + ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 + ℎ 4 𝑍 −4 + ℎ 5 𝑍 −5
5

= ℎ 0 + ෍ ℎ 𝑛 𝑍 𝑛 + 𝑍 −𝑛
𝑛=1

= 0.5 + 0.318 𝑍1 + 𝑍 −1 + 0 − 0.106 𝑍 3 + 𝑍 −3 + 0 + 0.0636 𝑍 5 + 𝑍 −5


ℎ 0 = ℎ 10 = 0.0636
The transfer function of the realizable filter is
ℎ 1 =ℎ 9 =0
𝑁−1

𝐻′ 𝑍 = 𝑍 2 𝐻 𝑍
ℎ 2 = ℎ 8 = −0.106

= 𝑍 −5 0.5 + 0.318 𝑍1 + 𝑍 −1 − 0.106 𝑍 3 + 𝑍 −3 + 0.0636 𝑍 5 + 𝑍 −5 ℎ 3 =ℎ 7 =0

ℎ 4 = ℎ 6 = 0.318
−2 −4 −5 −6 −8 −10
𝐻′ 𝑍 = 0.0636 − 0.106𝑍 + 0.318𝑍 + 0.5𝑍 + 0.318𝑍 − 0.106𝑍 + 0.0636𝑍
ℎ 5 =0

www.iammanuprasad.com
YouTube - IMPLearn
Design of linear phase FIR filter : window method

Design Steps

1. Plot the desired frequency response 𝐻𝑑 𝑒 𝑗𝜔


2. Determine the desired impulse response ℎ𝑑 𝑛 by taking
the inverse Fourier transform of 𝐻𝑑 𝑒 𝑗𝜔
𝝅
𝟐
𝟏
𝒉𝒅 𝒏 = න 𝟏. 𝒆𝒋𝝎𝒏 𝒅𝝎
𝟐𝝅
𝝅

𝟐

3. Find the value of ℎ𝑑 𝑛 for all ‘n’


4. Choose a window sequence 𝑊 𝑛 and multiply it with
ℎ𝑑 𝑛 to get impulse response h(n)

ℎ 𝑛 = ℎ𝑑 𝑛 ∗ 𝑊 𝑛

5. Take the Z – Transform of h(n)to get transfer function of the


filter which is given and find coefficients
𝑁−1

𝐻′ 𝑍 = 𝑍 2 𝐻 𝑍
www.iammanuprasad.com
YouTube - IMPLearn FIR FILTER DESIGN USING RECTANGULAR WINDOW 𝐻𝑑 𝑒 𝑗𝜔

Q) Design a linear phase FIR low pass filter using rectangular window by taking 7 samples of 1
window sequence and with a cut off frequency 𝜔𝑐 = 0.2𝜋 𝑟𝑎𝑑/𝑠𝑒𝑐
or
Q) Design a linear phase FIR filter low pass filter with frequency response −0.2𝜋 0.2𝜋
1 𝑓𝑜𝑟 − 𝜔𝑐 ≤ 𝜔 ≤ 𝜔
𝐻𝑑 𝑒 𝑗𝜔 = ቊ where 𝜔𝑐 = 0.2𝜋 and N=7
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Solution Since for n=0 the equation becomes infinity so lets
apply limit
We can determine the desired impulse response
ℎ𝑑 𝑛 by taking inverse Fourier Transform for n=0 𝑒 𝑗𝜃 − 𝑒 −𝑗𝜃
sin 𝜃 =
0.2𝜋 sin 0.2𝜋𝑛 sin 0.2𝜋𝑛 2𝑗
1 ℎ 0 = lim = lim = 0.2
𝑗𝜔𝑛
𝑑
𝑛→0 𝑛𝜋 𝑛→0 𝑛𝜋 0.2
ℎ𝑑 𝑛 = න 1. 𝑒 𝑑𝜔 0.2
2𝜋 sin 𝑛
−0.2𝜋 lim =1
𝑛→0 𝑛
1 for n=1
= 𝑒 𝑗0.2𝜋𝑛 − 𝑒 −𝑗0.2𝜋𝑛 sin 0.2𝜋
2𝜋𝑗𝑛 ℎ𝑑 1 = = 0.187 = ℎ𝑑 −1
𝜋
1 sin 0.2𝜋𝑛
= 2𝑗 sin 0.2𝜋𝑛 =
2𝜋𝑗𝑛 𝑛𝜋 for n=2
sin 0.2𝜋2
Truncating ℎ𝑑 𝑛 to 7 samples ℎ𝑑 2 = = 0.151 = ℎ𝑑 −2
2𝜋

sin 0.2𝜋𝑛
𝑛𝜋 𝑓𝑜𝑟 = −3 ≤ 𝑛 ≤ 3 for n=3
ℎ𝑑 𝑛 =
sin 0.2𝜋3
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 ℎ𝑑 3 = = 0.1009 = ℎ𝑑 −3
3𝜋
www.iammanuprasad.com
YouTube - IMPLearn FIR FILTER DESIGN USING RECTANGULAR WINDOW

Now using rectangular window sequence W(n) and multiply ℎ𝑑 𝑛 with it to get the impulse Rectangular window
response h(n)

− 𝑁−1 𝑁−1
1 0≤𝑛≤3 Since 𝛼 = 0 we get a non causal filter coefficient symmetrical about n=0 𝑊𝑅 𝑛 = ቐ1 2
≤𝑛≤
2
𝑊𝑅 𝑛 = ቊ so h(n) = h(-n)
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

3
for n=0 ℎ 0 = ℎ𝑑 0 . 𝑊𝑅 (0) = 0.2
𝐻 𝑍 = ℎ 0 + ෍ ℎ 𝑛 𝑍 𝑛 + 𝑍 −𝑛
𝑛=1
for n=1 ℎ 1 = ℎ𝑑 1 . 𝑊𝑅 (1) = 0.187 = ℎ −1
= 0.2 + 0.187 𝑍1 + 𝑍 −1 + 0.151 𝑍 2 + 𝑍 −2 + 0.1009 𝑍 3 + 𝑍 −3
for n=2 ℎ 2 = ℎ𝑑 2 . 𝑊𝑅 (2) = 0.1514 = ℎ −2
The transfer function of the realizable filter is
𝑁−1
for n=3 ℎ 3 = ℎ𝑑 3 . 𝑊𝑅 (3) = 0.1009 = ℎ −3 𝐻′ 𝑍 = 𝑍

2 𝐻 𝑍

= 𝑍 −3 0.2 + 0.187 𝑍1 + 𝑍 −1 + 0.151 𝑍 2 + 𝑍 −2 + 0.1009 𝑍 3 + 𝑍 −3


ℎ 𝑛 = 0.1009, 0.1514, 0.187, 0.2, 0.187,0.1514,0.1009
= 0.1009 + 0.151𝑍 −1 + 0.187𝑍 −2 + 0.2𝑍 −3 + 0.187𝑍 −4 + 0.151𝑍 −5
Now lets find the transfer function of the filter by taking Z Transform + 0.1009𝑍 −6
𝑁−1
2 3

𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛 = ෍ ℎ 𝑛 𝑍 −𝑛 ℎ 1 = ℎ 5 = 0.151
ℎ 0 = ℎ 6 = 0.1009
𝑁−1 𝑛=−3
𝑛=−
2
ℎ 2 = ℎ 4 = 0.187 ℎ 3 = 0.2
= ℎ −3 𝑍 3 + ℎ −2 𝑍 2 + ℎ −1 𝑍1 + ℎ 0 + ℎ 1 𝑍 −1
+ ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 www.iammanuprasad.com
YouTube - IMPLearn FIR FILTER DESIGN USING RECTANGULAR WINDOW
𝐻𝑑 𝑒 𝑗𝜔

Q) Design a linear phase FIR high pass filter with frequency response
1 1
𝜋
1 𝑓𝑜𝑟 ≤ |𝜔| ≤ 𝜋
4
𝐻𝑑 𝑒 𝑗𝜔 = ቐ 𝜋 Find the value of h(n) for N=11 and find H(z). Use rectangular window
0 𝑓𝑜𝑟 𝜔 <
4 𝜋
−𝜋 𝜋 0 𝜋
Truncating ℎ𝑑 𝑛 to 11 samples −
4
4
Solution
Since for n=0 the equation becomes infinity so lets apply
limit From the figure we know 𝛼 = 0
We can determine the desired impulse response
also symmetric
ℎ𝑑 𝑛 by taking inverse Fourier Transform
for n=0
𝜋 𝜋𝑛 𝑒 𝑗𝜃 − 𝑒 −𝑗𝜃
1 sin 𝜋𝑛 sin 1 3 sin 𝜃 =
ℎ𝑑 𝑛 = න 𝐻𝑑 𝑒 𝑗𝜔 . 𝑒 𝑗𝜔𝑛 𝑑𝜔 ℎ𝑑 0 = lim − lim 𝑛𝜋 4 =1− = 2𝑗
2𝜋 𝑛→0 𝑛𝜋 𝑛→0 4 4 4
−𝜋 4
for n=1

𝜋 𝜋 sin 𝑛
4 𝜋 sin 𝜋 − sin lim =1
1 ℎ𝑑 1 = 4 = −0.225 = ℎ𝑑 −1 𝑛→0 𝑛
= න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔 + න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔 𝜋
2𝜋
−𝜋 𝜋 for n=2
𝜋 4 2𝜋
𝑗𝜔𝑛 − 4 𝑗𝜔𝑛 𝜋 sin 2𝜋 − sin
1 𝑒 1 𝑒 ℎ𝑑 2 = 4 = −0.1591 = ℎ𝑑 −2
= + 2𝜋
2𝜋 𝑗𝑛 −𝜋
2𝜋 𝑗𝑛 𝜋
4 for n=3
3𝜋
−1 𝑗𝑛𝜋 −𝑗𝑛𝜋 sin 3𝜋 − sin
= 𝑒 4 − 𝑒 4 − 𝑒 𝑗𝜋𝑛 − 𝑒 −𝑗𝜋𝑛 ℎ𝑑 3 = 4 = −0.075 = ℎ𝑑 −3
2𝜋𝑗𝑛 3𝜋
for n=4
−1 𝑛𝜋 4𝜋
= 2𝑗 sin − 2𝑗 sin 𝑛𝜋 sin 4𝜋 − sin
2𝜋𝑗𝑛 4 ℎ𝑑 4 = 4 =0 = ℎ𝑑 −4
4𝜋
𝑛𝜋 for n=5
sin 𝑛𝜋 − sin 5𝜋
4 sin 5𝜋 − sin
ℎ𝑑 𝑛 = 4 = 0.045 = ℎ𝑑 −5
𝜋𝑛 ℎ𝑑 5 = www.iammanuprasad.com
5𝜋
YouTube - IMPLearn FIR FILTER DESIGN USING RECTANGULAR WINDOW
Now using rectangular window sequence WR(n) and multiply ℎ𝑑 𝑛 with it to get the impulse
response h(n) Rectangular window

𝑊𝑅 𝑛 = ቊ
1 0≤𝑛≤5 Since 𝛼 = 0 we get a non causal filter coefficient symmetrical about n=0
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 − 𝑁−1 𝑁−1
so h(n) = h(-n) 𝑊𝑅 𝑛 = ቐ1 ≤𝑛≤
2 2
3 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
for n=0 ℎ 0 = ℎ𝑑 0 . 𝑊𝑅 (0) = 0.75
𝐻 𝑍 = ℎ 0 + ෍ ℎ 𝑛 𝑍 𝑛 + 𝑍 −𝑛
for n=1 ℎ 1 = ℎ𝑑 1 . 𝑊𝑅 (1) = −0.225 = ℎ −1 𝑛=1

for n=2 ℎ 2 = ℎ𝑑 2 . 𝑊𝑅 (2) = −0.1591 = ℎ −2 = 0.75 − 0.225 𝑍1 + 𝑍 −1 − 0.159 𝑍 2 + 𝑍 −2 − 0.075 𝑍 3 + 𝑍 −3


+ 0.045 𝑍 5 + 𝑍 −5
for n=3 ℎ 3 = ℎ𝑑 3 . 𝑊𝑅 (3) = −0.075 = ℎ −3

for n=4 ℎ 4 = ℎ𝑑 4 . 𝑊𝑅 (4) = 0 = ℎ −4 The transfer function of the realizable filter is


𝑁−1

for n=5 ℎ 5 = ℎ𝑑 5 . 𝑊𝑅 (5) = 0.0450 = ℎ −5 𝐻′ 𝑍 = 𝑍 2 𝐻 𝑍

ℎ 𝑛 = 𝑍 −5 ሾ0.75 − 0.225 𝑍1 + 𝑍 −1 − 0.159 𝑍 2 + 𝑍 −2 − 0.075 𝑍 3 + 𝑍 −3


= ሾ0.0450,0, −0.075, −0.1591, −0.225,0.75, −0.225 − 0.1591 + 0.045 𝑍 5 + 𝑍 −5 ሿ
− 0.0750,0.0450ሿ
Now lets find the transfer function of the filter by taking Z Transform = 0.045 − 0.075𝑍 −2 − 0.159𝑍 −3 − 0.225𝑍 −4 + 0.75𝑍 −5 − 0.225𝑍 −6
− 0.1591𝑍 −7 − 0.075𝑍 −8 + 0.045𝑍 −10
𝑁−1
2 5
𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑁−1
ℎ 0 = ℎ 10 = 0.045 ℎ 3 = ℎ 7 = −0.159
𝑛=− 𝑛=−5
2
ℎ 1 =ℎ 9 =0 ℎ 4 = ℎ 6 = −0.225
= ℎ −5 𝑍 5 + ℎ −4 𝑍 4 + ℎ −3 𝑍 3 + ℎ −2 𝑍 2 + ℎ −1 𝑍1
ℎ 2 = ℎ 8 = −0.075 ℎ 5 = 0.75
+ ℎ 0 + ℎ 1 𝑍 −1 + ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 + ℎ 4 𝑍 −4
www.iammanuprasad.com
+ ℎ 5 𝑍 −5
YouTube - IMPLearn FIR FILTER DESIGN USING HANNING WINDOW
𝐻𝑑 𝑒 𝑗𝜔

Q) Design a linear phase FIR filter high pass filter with frequency response
1 1
𝜋
1 𝑓𝑜𝑟 ≤ |𝜔| ≤ 𝜋
4
𝐻𝑑 𝑒 𝑗𝜔 = ቐ 𝜋 Find the value of h(n) for N=11 and find H(z). Using Hanning window
0 𝑓𝑜𝑟 𝜔 <
4 𝜋
−𝜋 𝜋 0 𝜋

Truncating ℎ𝑑 𝑛 to 11 samples 4 4
Solution
From the figure we know 𝛼 = 0
We can determine the desired impulse response Since for n=0 the equation becomes infinity so lets apply limit
also symmetric
ℎ𝑑 𝑛 by taking inverse Fourier Transform
for n=0
𝜋 𝜋𝑛 𝑒 𝑗𝜃 − 𝑒 −𝑗𝜃
1 sin 𝜋𝑛 sin 1 3 sin 𝜃 =
ℎ𝑑 𝑛 = න 𝐻𝑑 𝑒 𝑗𝜔 . 𝑒 𝑗𝜔𝑛 𝑑𝜔 ℎ𝑑 0 = lim − lim 𝑛𝜋 4 =1− = 2𝑗
2𝜋 𝑛→0 𝑛𝜋 𝑛→0 4 4 4
−𝜋 4
for n=1

𝜋 𝜋 sin 𝑛
4 𝜋 sin 𝜋 − sin lim =1
1 ℎ𝑑 1 = 4 = −0.225 = ℎ𝑑 −1 𝑛→0 𝑛
= න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔 + න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔 𝜋
2𝜋
−𝜋 𝜋 for n=2
𝜋 4 2𝜋
𝑗𝜔𝑛 − 4 𝑗𝜔𝑛 𝜋 sin 2𝜋 − sin
1 𝑒 1 𝑒 ℎ𝑑 2 = 4 = −0.1591 = ℎ𝑑 −2
= + 2𝜋
2𝜋 𝑗𝑛 −𝜋
2𝜋 𝑗𝑛 𝜋
4 for n=3
3𝜋
−1 𝑗𝑛𝜋 −𝑗𝑛𝜋 sin 3𝜋 − sin
= 𝑒 4 − 𝑒 4 − 𝑒 𝑗𝜋𝑛 − 𝑒 −𝑗𝜋𝑛 ℎ𝑑 3 = 4 = −0.075 = ℎ𝑑 −3
2𝜋𝑗𝑛 3𝜋
for n=4
−1 𝑛𝜋 4𝜋
= 2𝑗 sin − 2𝑗 sin 𝑛𝜋 sin 4𝜋 − sin
2𝜋𝑗𝑛 4 ℎ𝑑 4 = 4 =0 = ℎ𝑑 −4
4𝜋
𝑛𝜋 for n=5
sin 𝑛𝜋 − sin 5𝜋
4 sin 5𝜋 − sin
ℎ𝑑 𝑛 = 4 = 0.045 = ℎ𝑑 −5
𝜋𝑛 ℎ𝑑 5 = www.iammanuprasad.com
5𝜋
YouTube - IMPLearn

Hanning window

2𝜋𝑛 − 𝑁−1 𝑁−1


0.5 − 0.5 cos , ≤𝑛≤
𝑊𝐻𝑛 𝑛 =൞ 𝑁−1 2 2 𝑊𝐻𝑛 0 = 0.5 + 0.5 = 1
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝜋
𝑊𝐻𝑛 1 = 0.5 + 0.5 cos = 09045 = 𝑊𝐻𝑛 −1
5

2𝜋
Since 𝛼 = 0 we get a non causal filter coefficient symmetrical 𝑊𝐻𝑛 2 = 0.5 + 0.5 cos = 0.655 = 𝑊𝐻𝑛 −2
about n=0 so h(n) = h(-n) 5

3𝜋
𝑊𝐻𝑛 3 = 0.5 + 0.5 cos = 0.345 = 𝑊𝐻𝑛 −3
5
2𝑛𝜋
𝑊𝐻𝑛 𝑛 =ቐ0.5 + 0.5 cos 0≤𝑛≤5
10
4𝜋
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝑊𝐻𝑛 4 = 0.5 + 0.5 cos = 0.0945 = 𝑊𝐻𝑛 −4
5

5𝜋
𝑊𝐻𝑛 5 = 0.5 + 0.5 cos = 0 = 𝑊𝐻𝑛 −5
5

www.iammanuprasad.com
YouTube - IMPLearn FIR FILTER DESIGN USING HANNING WINDOW

Now using Hanning window sequence WHn(n) and multiply ℎ𝑑 𝑛 with it to get the impulse
response h(n)
5
ℎ 𝑛 = ℎ𝑑 𝑛 . 𝑊𝐻𝑛 𝑛 𝑓𝑜𝑟 − 5 ≤ 𝑛 ≤ 5
𝐻 𝑍 = ℎ 0 + ෍ ℎ 𝑛 𝑍 𝑛 + 𝑍 −𝑛
𝑛=1
for n=0 ℎ 0 = ℎ𝑑 0 . 𝑊𝐻𝑛 (0) = 0.75(1) = 0.75
for n=1 ℎ 1 = ℎ𝑑 1 . 𝑊𝐻𝑛 (1) = −0.225 0.905 = −0.204 = ℎ −1 = 0.75 − 0.204 𝑍1 + 𝑍 −1 − 0.104 𝑍 2 + 𝑍 −2 − 0.026 𝑍 3 + 𝑍 −3

for n=2 ℎ 2 = ℎ𝑑 2 . 𝑊𝐻𝑛 (2) = −0.159 0.655 = −0.104 = ℎ −2


The transfer function of the realizable filter is
for n=3 ℎ 3 = ℎ𝑑 3 . 𝑊𝐻𝑛 (3) = −0.075 0.345 = −0.026 = ℎ −3
𝑁−1

for n=4 ℎ 4 = ℎ𝑑 4 . 𝑊𝐻𝑛 (4) = 0 = ℎ −4 𝐻′ 𝑍 = 𝑍 2 𝐻 𝑍

for n=5 ℎ 5 = ℎ𝑑 5 . 𝑊𝐻𝑛 (5) = 0 = ℎ −5


= 𝑍 −5 0.75 − 0.204 𝑍1 + 𝑍 −1 − 0.104 𝑍 2 + 𝑍 −2 − 0.026 𝑍 3 + 𝑍 −3

ℎ 𝑛 = −0.026, −0.104, −0.204,0.75, −0.204, −0.104, −0.026


= −0.026𝑍 −2 − 0.104𝑍 −3 − 0.204𝑍 −4 + 0.75𝑍 −5 − 0.204𝑍 −6
Now lets find the transfer function of the filter by taking Z Transform − 0.104𝑍 −7 − 0.026𝑍 −8

𝑁−1
2 5
𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛 = ෍ ℎ 𝑛 𝑍 −𝑛 ℎ 0 = ℎ 1 = ℎ 9 = ℎ 10 = 0
𝑁−1 𝑛=−5
𝑛=−
2
ℎ 2 = ℎ 8 = −0.026 ℎ 4 = ℎ 6 = −0.204
5 4 3 2 1
= ℎ −5 𝑍 + ℎ −4 𝑍 + ℎ −3 𝑍 + ℎ −2 𝑍 + ℎ −1 𝑍
ℎ 3 = ℎ 7 = −0.104 ℎ 5 = 0.75
+ ℎ 0 + ℎ 1 𝑍 −1 + ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 + ℎ 4 𝑍 −4
www.iammanuprasad.com
+ ℎ 5 𝑍 −5
YouTube - IMPLearn FIR FILTER DESIGN USING HAMMING WINDOW
𝐻𝑑 𝑒 𝑗𝜔

Q) Design a linear phase FIR filter high pass filter with frequency response
1 1
𝜋
1 𝑓𝑜𝑟 ≤ |𝜔| ≤ 𝜋
4
𝐻𝑑 𝑒 𝑗𝜔 = ቐ 𝜋 Find the value of h(n) for N=11 and find H(z). Using Hamming window
0 𝑓𝑜𝑟 𝜔 <
4 𝜋
−𝜋 𝜋 0 𝜋
Truncating ℎ𝑑 𝑛 to 11 samples −
Solution 4 4

Since for n=0 the equation becomes infinity so lets apply limit From the figure we know 𝛼 = 0
We can determine the desired impulse response
also symmetric
ℎ𝑑 𝑛 by taking inverse Fourier Transform
for n=0
𝜋 𝜋𝑛 𝑒 𝑗𝜃 − 𝑒 −𝑗𝜃
1 sin 𝜋𝑛 sin 1 3 sin 𝜃 =
ℎ𝑑 𝑛 = න 𝐻𝑑 𝑒 𝑗𝜔 . 𝑒 𝑗𝜔𝑛 𝑑𝜔 ℎ𝑑 0 = lim − lim 𝑛𝜋 4 =1− = 2𝑗
2𝜋 𝑛→0 𝑛𝜋 𝑛→0 4 4 4
−𝜋 4
for n=1

𝜋 𝜋 sin 𝑛
4 𝜋 sin 𝜋 − sin lim =1
1 ℎ𝑑 1 = 4 = −0.225 = ℎ𝑑 −1 𝑛→0 𝑛
= න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔 + න 1. 𝑒 𝑗𝜔𝑛 𝑑𝜔 𝜋
2𝜋
−𝜋 𝜋 for n=2
𝜋 4 2𝜋
𝑗𝜔𝑛 − 4 𝑗𝜔𝑛 𝜋 sin 2𝜋 − sin
1 𝑒 1 𝑒 ℎ𝑑 2 = 4 = −0.1591 = ℎ𝑑 −2
= + 2𝜋
2𝜋 𝑗𝑛 −𝜋
2𝜋 𝑗𝑛 𝜋
4 for n=3
3𝜋
−1 𝑗𝑛𝜋 −𝑗𝑛𝜋 sin 3𝜋 − sin
= 𝑒 4 − 𝑒 4 − 𝑒 𝑗𝜋𝑛 − 𝑒 −𝑗𝜋𝑛 ℎ𝑑 3 = 4 = −0.075 = ℎ𝑑 −3
2𝜋𝑗𝑛 3𝜋
for n=4
−1 𝑛𝜋 4𝜋
= 2𝑗 sin − 2𝑗 sin 𝑛𝜋 sin 4𝜋 − sin
2𝜋𝑗𝑛 4 ℎ𝑑 4 = 4 =0 = ℎ𝑑 −4
4𝜋
𝑛𝜋 for n=5
sin 𝑛𝜋 − sin 5𝜋
4 sin 5𝜋 − sin
ℎ𝑑 𝑛 = 4 = 0.045 = ℎ𝑑 −5
𝜋𝑛 ℎ𝑑 5 = www.iammanuprasad.com
5𝜋
YouTube - IMPLearn FIR FILTER DESIGN USING HAMMING WINDOW

Hamming window

𝑊𝐻 0 = 0.54 + 0.46 = 1
2𝜋𝑛 − 𝑁−1 𝑁−1
0.54 − 0.46 cos , ≤𝑛≤
𝑊𝐻 𝑛 = ൞ 𝑁−1 2 2
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝜋
𝑊𝐻 1 = 0.54 + 0.46 cos = 0.912 = 𝑊𝐻 −1
5

2𝜋
𝑊𝐻 2 = 0.54 + 0.46 cos = 0.682 = 𝑊𝐻 −2
5
Since 𝛼 = 0 we get anon causal filter coefficient symmetrical about
n=0 so h(n) = h(-n)
3𝜋
𝑊𝐻 3 = 0.54 + 0.46 cos = 0.398 = 𝑊𝐻 −3
5

2𝑛𝜋 4𝜋
𝑊𝐻 𝑛 = ቐ0.54 + 0.46 cos 10 0≤𝑛≤5 𝑊𝐻 4 = 0.54 + 0.46 cos
5
= 0.1678 = 𝑊𝐻 −4
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
5𝜋
𝑊𝐻 5 = 0.54 + 0.46 cos = 0.08 = 𝑊𝐻 −5
5

www.iammanuprasad.com
YouTube - IMPLearn FIR FILTER DESIGN USING HAMMING WINDOW

Now using Hamming window sequence WH(n) and multiply ℎ𝑑 𝑛 with it to get the impulse
response h(n)

ℎ 𝑛 = ℎ𝑑 𝑛 . 𝑊𝐻 𝑛 𝑓𝑜𝑟 − 5 ≤ 𝑛 ≤ 5 5

𝐻 𝑍 = ℎ 0 + ෍ ℎ 𝑛 𝑍 𝑛 + 𝑍 −𝑛
for n=0 ℎ 0 = ℎ𝑑 0 . 𝑊𝐻 (0) = 0.75(1) = 0.75 𝑛=1

for n=1 ℎ 1 = ℎ𝑑 1 . 𝑊𝐻 (1) = −0.225 0.912 = −0.2056 = ℎ −1


= 0.75 − 0.2056 𝑍1 + 𝑍 −1 − 0.1084 𝑍 2 + 𝑍 −2 − 0.03 𝑍 3 + 𝑍 −3
for n=2 ℎ 2 = ℎ𝑑 2 . 𝑊𝐻 (2) = −0.159 0.682 = −0.1084 = ℎ −2 + 0.0036 𝑍 5 + 𝑍 −5

for n=3 ℎ 3 = ℎ𝑑 3 . 𝑊𝐻 (3) = −0.075 0.398 = −0.03 = ℎ −3 The transfer function of the realizable filter is

for n=4 ℎ 4 = ℎ𝑑 4 . 𝑊𝐻 (4) = 0 = ℎ −4 −


𝑁−1
𝐻′ 𝑍 = 𝑍 2 𝐻 𝑍
for n=5 ℎ 5 = ℎ𝑑 5 . 𝑊𝐻 (5) = −0.045 0.08 = 0.0036 = ℎ −5
= 𝑍 −5 ሾ0.75 − 0.2056 𝑍1 + 𝑍 −1 − 0.1084 𝑍 2 + 𝑍 −2 − 0.03 𝑍 3 + 𝑍 −3
ℎ 𝑛 + 0.0036 𝑍 5 + 𝑍 −5 ሿ
= 0.0036, −0.03, −0.1084, −0.2056,0.75, −0.2056, −0.1084, −0.03,0.0036

Now lets find the transfer function of the filter by taking Z Transform = 0.0036 − 0.03𝑍 −2 − 0.1084𝑍 −3 − 0.2052𝑍 −4 + 0.75𝑍 −5
− 0.2052𝑍 −6 − 0.1084𝑍 −7 − 0.03𝑍 −8 + 00036𝑍 −10
𝑁−1
2 5
𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑁−1
ℎ 0 = ℎ 10 = 0.0036 ℎ 3 = ℎ 7 = −0.1084
𝑛=− 𝑛=−5
2
ℎ 1 =ℎ 9 =0 ℎ 4 = ℎ 6 = −0.2052
5 4 3 2 1
= ℎ −5 𝑍 + ℎ −4 𝑍 + ℎ −3 𝑍 + ℎ −2 𝑍 + ℎ −1 𝑍 ℎ 2 = ℎ 8 = −0.03 ℎ 5 = 0.75
+ ℎ 0 + ℎ 1 𝑍 −1 + ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 + ℎ 4 𝑍 −4
www.iammanuprasad.com
+ ℎ 5 𝑍 −5
YouTube - IMPLearn
Design of linear phase FIR filter by frequency sampling technique

In this method the ideal frequency response is sampled at sufficient number of points these samples are the DFT
coefficients of impulse response of filter. Hence impulse response of filter is determined by taking inverse DFT

Steps
1. Choose a desired frequency response 𝐻𝑑 𝑒 𝑗𝜔
2𝜋𝑘
2. Sample 𝐻𝑑 𝑒 𝑗𝜔 at N point by taking 𝜔 = 𝜔𝑘 = where k=0,1,2,3 … N-1
𝑁
3. Compute the N samples of impulse response h(n) using the equation
𝑁−1
2
1 𝑗2𝜋𝑛𝑘
ℎ 𝑛 = 𝐻 0 + 2 ෍ 𝑅𝑒 𝐻 𝑘 𝑒 𝑁 , 𝑓𝑜𝑟 𝑁 = 𝑜𝑑𝑑
𝑁
𝑘=1
𝑁
−1
2
1 𝑗2𝜋𝑛𝑘
ℎ 𝑛 = 𝐻 0 + 2 ෍ 𝑅𝑒 𝐻 𝑘 𝑒 𝑁 , 𝑓𝑜𝑟 𝑁 = 𝑒𝑣𝑒𝑛
𝑁
𝑘=1

4. Take Z-Transform of impulse response h(n) to get filter transfer function H(z)
𝑁−1

𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑛=0

www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique 𝐻𝑑 𝑒 𝑗𝜔

Q) Design a linear phase FIR low pass filter with cut off frequency of 0.5π rad/sample by taking 11 1
samples of ideal frequency response

Solution
Step2: Sample 𝐻𝑑 𝑒 𝑗𝜔 at N point by taking
2𝜋𝑘 0.5𝜋
𝜔 = 𝜔𝑘 = −0.5𝜋
Step1 : Find the desired frequency response 𝑁

2𝜋𝑘
For digital sampling we are taking the limit as 0 to 2π Sampling frequency 𝜔𝑘 = for k= 0 to 10
11

𝐻𝑑 𝑒 𝑗𝜔 2𝜋 ∗ 0
for k=0 𝜔0 = =0
11
2𝜋 ∗ 1 2𝜋 ∗ 6
= 0.18𝜋 for k=6 𝜔0 = = 1.09𝜋
for k=1 𝜔0 = 11
11
2𝜋 ∗ 2 2𝜋 ∗ 7
= 0.36𝜋 for k=7 𝜔0 = = 1.27𝜋
0 0.5𝜋 𝜋 1.5𝜋 2𝜋 for k=2 𝜔0 = 11
11
2𝜋 ∗ 3 2𝜋 ∗ 8
𝜔0 = = 0.55𝜋 for k=8 𝜔0 = = 1.45𝜋
Due to symmetricity at (N-1)/2 then there will be an α for k=3 11
11 2𝜋 ∗ 9
exponential term in the expression 2𝜋 ∗ 4
= 0.73𝜋 for k=9 𝜔0 = = 1.64𝜋
for k=4 𝜔0 = 11
11 2𝜋 ∗ 10
2𝜋 ∗ 5 for k=10 𝜔0 = = 1.82𝜋
1. 𝑒 −𝑗𝛼𝜔 , 0 ≤ 𝜔 ≤ 0.5𝜋 for k=5 𝜔0 = = 0.91𝜋 11
𝐻𝑑 𝑒 𝑗𝜔 =൞ 0 , 0.5𝜋 ≤ 𝜔 ≤ 1.5𝜋 11
1. 𝑒 −𝑗𝛼𝜔 ,1.5𝜋 ≤ 𝜔 ≤ 2𝜋 𝐻 𝑘
2𝜋𝑘
𝑒 −𝑗5 11 , 𝑓𝑜𝑟 𝑘 = 0,1,2
𝑁 − 1 11 − 1 𝐻 𝑘 = 0 , 𝑓𝑜𝑟 𝑘 = 3 𝑡𝑜 8
𝑤ℎ𝑒𝑟𝑒, 𝛼 = = =5 2𝜋𝑘
2 2
𝑒 −𝑗5 11 , 𝑓𝑜𝑟 𝑘 = 9,10
0 1 2 3 4 5 6 7 8 9 10 𝑘 www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique

Step 3: Compute the N samples of impulse response h(n)


𝑁−1 𝑁−1
2
2 1 𝑗2𝜋𝑛𝑘
1 𝑗2𝜋𝑛𝑘 ℎ 𝑛 =
𝑁
𝐻 0 + 2 ෍ 𝑅𝑒 𝐻 𝑘 𝑒 𝑁 , 𝑓𝑜𝑟 𝑁 = 𝑜𝑑𝑑
ℎ 𝑛 = 𝐻 0 + 2 ෍ 𝑅𝑒 𝐻 𝑘 𝑒 𝑁 𝑘=1
𝑁
𝑘=1

5 2
1 −𝑗5
2𝜋𝑘 𝑗2𝜋𝑛𝑘 1 −𝑗5
2𝜋𝑘 𝑗2𝜋𝑛𝑘
= 1 + 2 ෍ 𝑅𝑒 𝑒 11 𝑒 11 = 1 + 2 ෍ 𝑅𝑒 𝑒 11 𝑒 11
11 11
𝑘=1 𝑘=1

2
1 𝑗
2𝜋𝑘
𝑛−5
= 1 + 2 ෍ 𝑅𝑒 𝑒 11
11
𝑘=1

1 𝑗
2𝜋
𝑛−5 𝑗
4𝜋
𝑛−5
= 1 + 2𝑅𝑒 𝑒 11 + 2𝑅𝑒 𝑒 11
11
2𝜋𝑘
1 2𝜋 4𝜋 𝑒 −𝑗5
11 , 𝑓𝑜𝑟 𝑘 = 0,1,2
ℎ 𝑛 = 1 + 2 cos 𝑛−5 + 2 cos 𝑛−5 𝐻 𝑘 = 0 , 𝑓𝑜𝑟 𝑘 = 3 𝑡𝑜 8
11 11 11
2𝜋𝑘
𝑒 −𝑗5 11 , 𝑓𝑜𝑟 𝑘 = 9,10
www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique

Now let’s calculate h(n) for n = 0 to 10, using symmetric condition ( h(n)=h(N-1-m) )

for n=0
1 2𝜋 4𝜋 for n=6
ℎ 0 = 1 + 2 cos 0−5 + 2 cos 0−5 = 0.0694
11 11 11
for n=1 ℎ 6 = ℎ 11 − 1 − 6 = ℎ 4 = 0.3194
1 2𝜋 4𝜋
ℎ 1 = 1 + 2 cos 1−5 + 2 cos 1−5 = −0.054 for n=7
11 11 11
for n=2 ℎ 7 = ℎ 11 − 1 − 7 = ℎ 3 = 0.0473
1 2𝜋 4𝜋
ℎ 2 = 1 + 2 cos 2−5 + 2 cos 2−5 = −0.1094 for n=8
11 11 11
for n=3
1 2𝜋 4𝜋 ℎ 8 = ℎ 11 − 1 − 8 = ℎ 2 = −0.1094
ℎ 3 = 1 + 2 cos 3−5 + 2 cos 3−5 = 0.0473
11 11 11 for n=9
for n=4
1 2𝜋 4𝜋 ℎ 9 = ℎ 11 − 1 − 9 = ℎ 1 = −0.054
ℎ 4 = 1 + 2 cos 4−5 + 2 cos 4−5 = 0.3194
11 11 11 for n=10
for n=5
1 2𝜋 4𝜋
ℎ 5 = 1 + 2 cos 5−5 + 2 cos −5 = 0.4595 ℎ 10 = ℎ 11 − 1 − 10 = ℎ 0 = 0.0694
11 11 11

www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique

Step 4: Take Z-Transform of impulse response h(n) to get filter transfer function H(z)
10

𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑛=0

= ℎ 0 𝑍 0 + ℎ 1 𝑍 −1 + ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 + ℎ 4 𝑍 −4 + ℎ 5 𝑍 −5 + ℎ 6 𝑍 −6 + ℎ 7 𝑍 −7 + ℎ 8 𝑍 −8 + ℎ 9 𝑍 −9 + ℎ 10 𝑍 −10

𝐻 𝑍 = 0.0694 1 + 𝑍 −10 − 0.054 𝑍 −1 + 𝑍 −9 − 0.1094 𝑍 −2 + 𝑍 −8 + 0.0473 𝑍 −3 + 𝑍 −7 + 0.3194 𝑍 −4 + 𝑍 −6 + 0.4595𝑍 −5

www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique
Q) Using frequency sampling method, design a band pass filter with the following specifications , sampling frequency
F=8000Hz ,cut off frequency fc1=1000Hz, fc2=3000Hz, Determine the filter coefficients for N=7

Solution
Step1 : Find the desired frequency response Step2: Sample 𝐻𝑑 𝑒 𝑗𝜔 at N point by taking
2𝜋𝑘
𝜔 = 𝜔𝑘 =
For digital sampling we are taking the limit as 0 to 2π 𝑁

2𝜋𝑓𝑐1 2𝜋1000 𝜋 2𝜋𝑘


𝜔𝑐1 = 2𝜋𝑓𝑐1 𝑇 = = = = 0.25𝜋 Sampling frequency 𝜔𝑘 = for k= 0 to 6
𝐹 8000 4 7
2𝜋𝑓𝑐2 2𝜋3000 3𝜋
𝜔𝑐2 = 2𝜋𝑓𝑐2 𝑇 = = = = 0.75𝜋 2𝜋 ∗ 0
𝐹 8000 4 for k=0 𝜔0 = =0
7
𝐻𝑑 𝑒 𝑗𝜔 2𝜋 ∗ 1 2𝜋 ∗ 4
for k=1 𝜔0 = = 0.28𝜋 for k=4 𝜔0 = = 1.14𝜋
7 7
2𝜋 ∗ 2 2𝜋 ∗ 5
for k=2 𝜔0 = = 0.57𝜋 for k=5 𝜔0 = = 1.4𝜋
7 7
2𝜋 ∗ 3 2𝜋 ∗ 6
for k=3 𝜔0 = = 0.85𝜋 for k=6 𝜔0 = = 1.71𝜋
0 𝜋 3𝜋 5𝜋 7𝜋 7 7
4 4 4 4
Due to symmetricity at (N-1)/2 then there will be an α
𝐻 𝑘
exponential term in the expression
0 , 𝑓𝑜𝑟 𝑘 = 0
−𝑗𝛼𝜔 , 0.25𝜋 ≤ 𝜔 ≤ 0.75𝜋 2𝜋𝑘
𝑒 𝑒 −𝑗3
7 , 𝑓𝑜𝑟 𝑘 = 1,2
𝑗𝜔 , 0.75𝜋 ≤ 𝜔 ≤ 1.25𝜋 𝐻 𝑘 =
𝐻𝑑 𝑒 =൞ 0 0 , 𝑓𝑜𝑟 𝑘 = 3 , 4
𝑒 −𝑗𝛼𝜔 ,1.25𝜋 ≤ 𝜔 ≤ 1.7𝜋 2𝜋𝑘
𝑘 𝑒 −𝑗37 , 𝑓𝑜𝑟 𝑘 = 5,6
0.25π

1.25 π

1.71 π
1.75 π
0.75 π
0.28 π
0.57 π

0.85 π
1.14 π

1.4 π
𝑁−1 7−1 0
𝑤ℎ𝑒𝑟𝑒, 𝛼 =
2
=
2
=3 www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique

Step 3: Compute the N samples of impulse response h(n)


𝑁−1 𝑁−1
2
2 1 𝑗2𝜋𝑛𝑘
1 𝑗2𝜋𝑛𝑘 ℎ 𝑛 =
𝑁
𝐻 0 + 2 ෍ 𝑅𝑒 𝐻 𝑘 𝑒 𝑁 , 𝑓𝑜𝑟 𝑁 = 𝑜𝑑𝑑
ℎ 𝑛 = 𝐻 0 + 2 ෍ 𝑅𝑒 𝐻 𝑘 𝑒 𝑁 𝑘=1
𝑁
𝑘=1

3 2
1 −𝑗3
2𝜋𝑘 𝑗2𝜋𝑛𝑘 1 −𝑗3
2𝜋𝑘 𝑗2𝜋𝑛𝑘
= 0 + 2 ෍ 𝑅𝑒 𝑒 7 𝑒 7 = 2 ෍ 𝑅𝑒 𝑒 7 𝑒 7
7 7
𝑘=1 𝑘=1

2
2 𝑗
2𝜋𝑘
𝑛−3
= ෍ 𝑅𝑒 𝑒 7
7
𝑘=1

2 −𝑗
2𝜋
𝑛−3 −𝑗
4𝜋
𝑛−3
= 2𝑅𝑒 𝑒 7 + 2𝑅𝑒 𝑒 7
7
0 , 𝑓𝑜𝑟 𝑘 = 0
2𝜋𝑘
𝑒 −𝑗3
7 , 𝑓𝑜𝑟 𝑘 = 1,2
2 2𝜋 4𝜋 𝐻 𝑘 =
ℎ 𝑛 = 2 cos 𝑛−3 + 2 cos 𝑛−3 0 , 𝑓𝑜𝑟 𝑘 = 3 , 4
7 7 7 2𝜋𝑘
−𝑗3
𝑒 7 , 𝑓𝑜𝑟 𝑘 = 5,6
www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique

Now let’s calculate h(n) for n = 0 to 6, using symmetric condition ( h(n)=h(N-1-n) )

for n=0
2 2𝜋 4𝜋 for n=4
ℎ 0 = 2 cos 0−3 + 2 cos 0−3 = −0.0792
7 7 7
ℎ 4 =ℎ 7−1−4 =ℎ 2 = 0.1145
for n=1
2 2𝜋 4𝜋
ℎ 1 = 2 cos 1−3 + 2 cos 1−3 = −0.321 for n=5
7 7 7
ℎ 5 =ℎ 7−1−5 =ℎ 1 = −0.321
for n=2
2 2𝜋 4𝜋
ℎ 2 = 2 cos 2−3 + 2 cos 2−3 = 0.1145 for n=6
7 7 7
ℎ 6 =ℎ 7−1−6 =ℎ 0 = −0.0792
for n=3
2 2𝜋 4𝜋
ℎ 3 = 2 cos 3−3 + 2 cos 3−3 = 0.571
7 7 7

www.iammanuprasad.com
YouTube - IMPLearn Design of linear phase FIR filter by frequency sampling technique

Step 4: Take Z-Transform of impulse response h(n) to get filter transfer function H(z)
6

𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑛=0

= ℎ 0 𝑍 0 + ℎ 1 𝑍 −1 + ℎ 2 𝑍 −2 + ℎ 3 𝑍 −3 + ℎ 4 𝑍 −4 + ℎ 5 𝑍 −5 + ℎ 6 𝑍 −6

𝐻 𝑍 = −0.0792 1 + 𝑍 −6 − 0.321 𝑍 −1 + 𝑍 −5 + 0.1145 𝑍 −2 + 𝑍 −4 + 0.571𝑍 −3

ℎ 6 =ℎ 7−1−6 =ℎ 0 = −0.0792
ℎ 5 =ℎ 7−1−5 =ℎ 1 = −0.321
ℎ 4 =ℎ 7−1−4 =ℎ 2 = 0.1145

ℎ 3 = 0.571

www.iammanuprasad.com
YouTube - IMPLearn
Infinite Impulse Response (IIR) Filters

• The FIR filters are non recursive type filters(present input depends on the present and previous inputs)
where as IIR filters are recursive type (present input depends on the present, past and output samples)
• IIR (infinite impulse response) filters are generally chosen for applications where linear phase is not
too important and memory is limited.
• They have been widely deployed in audio equalization, biomedical sensor signal processing, IoT/IIoT
smart sensors and high-speed telecommunication/RF applications
• IIR filter have infinite-duration impulse responses, hence they can be matched to analog filters, all of
which generally have infinitely long impulse responses.
• The basic techniques of IIR filter design transform well-known analog filters into digital filters using
complex-valued mappings.
• First we design an antilog prototype filter and then transform the prototype to a digital filter, hence it is
also called indirect method

www.iammanuprasad.com
YouTube - IMPLearn
Infinite Impulse Response (IIR) Filters

• An IIR filter is categorized by its theoretically infinite impulse response, Practically speaking, it is not possible to
compute the output of an IIR using this equation. Therefore, the equation may be re-written in terms of a finite
number of poles p and zeros q, as defined by the linear constant coefficient difference equation
𝑞 𝑝

𝑦 𝑛 = ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘 − ෍ 𝑎𝑘 𝑦 𝑛 − 𝑘
𝑘=0 𝑙=1

• where, a(k) and b(k) are the filter’s denominator and numerator polynomial coefficients, who’s roots are equal to
the filter’s poles and zeros respectively. Thus, a relationship between the difference equation and the z-transform
(transfer function) may therefore be defined by using the z-transform delay property such that,


−𝑛
σ𝑞𝑘=0 𝑏𝑘 𝑍 −𝑘
𝐻 𝑧 = ෍𝑦 𝑛 𝑍 = 𝑝
1 + σ𝑘=1 𝑎𝑘 𝑍 −𝑘
𝑛=0

• As seen, the transfer function is a frequency domain representation of the filter.


• Notice also that the poles act on the output data, and the zeros on the input data.
• Since the poles act on the output data, and affect stability, it is essential that their radii remain inside the unit circle
(i.e. <1) for BIBO (bounded input, bounded output) stability. The radii of the zeros are less critical, as they do not
affect filter stability.
www.iammanuprasad.com
YouTube - IMPLearn
Specifications for magnitude response of lowpass filter

Digital Analog Alternate specifications of lowpass filter


𝜔𝑝 → Passband frequency (rad/samples) Ω𝑝 → Passband frequency (rad/sec)
2 𝛿𝑝
𝜔𝑠 → Stopband frequency (rad/samples) Ω𝑠 → Stopband frequency (rad/sec) ε=
1 − 𝛿𝑝
𝜔𝑐 → 3dB cut off frequency (rad/samples) Ω𝑐 → 3dB cut off frequency (rad/sec)
2
ε → Passband parameter 𝛿𝑝 → Passband error tolerance 1 + 𝛿𝑝 − 𝛿𝑠2
λ → Stopband parameter 𝛿𝑠 → max allowable magnitude in stop band λ=
𝛿𝑠
www.iammanuprasad.com
YouTube - IMPLearn
Design of steps of IIR Filters

1. Map the desired digital filter specifications into those for an equivalent analog
filter
2. Derive the analog transfer function for the analog prototype
3. Transform the transfer function of the analog prototype into an equivalent digital
filter transfer function

www.iammanuprasad.com
YouTube - IMPLearn
Analog lowpass filter design
Mainly there are two types of analog filter designs
1. Butterworth Filter
2. Chebyshev filter

Analog low pass Butterworth Filter


The magnitude function of the lowpass Butterworth filter is

1
𝐻 𝑗Ω = 1
2𝑁 2 Where N is the order of the
Ω filter
1+
Ω𝑐

Properties of Butterworth filters


1. Butterworth filters are all pole design
2. The magnitude of normalised Butterworth filter is 1/√2 at cut off frequency Ω𝑐
3. The filter order specified the filter
4. Magnitude is maximally flat at the origin
5. As N increases the response approaches to ideal response
www.iammanuprasad.com
YouTube - IMPLearn
Analog low pass Butterworth Filter

Order Normalised transfer function


1 1
𝑠+1
2 1
𝑠 2 + √2𝑠 + 1
3 1
𝑠 + 1 𝑠2 + 𝑠 + 1
4 1
𝑠 2 + 0.765𝑠 + 1 𝑠 2 + 1.848𝑠 + 1
5 1
𝑠 + 1 𝑠 2 + 0.618𝑠 + 1 𝑠 2 + 1.618𝑠 + 1
6 1
𝑠 2 + 1.931𝑠 + 1 𝑠 2 + 2𝑠 + 1 𝑠 2 + 0.517𝑠 + 1

www.iammanuprasad.com
YouTube - IMPLearn
Order of the Butterworth filter

Let the maximum passband attenuation in positive dB is 𝛼𝑝 (<3dB) at passband


frequency Ω𝑝 and 𝛼𝑠 is the minimum stopband attenuation at stopband frequency Ω𝑠 . The
magnitude function can be written as

1
𝐻 𝑗Ω = 1
2𝑁 2
Ω
1 + ε2 Ω
𝑝

2
1
𝐻 𝑗Ω = 2𝑁 Ω𝑝 → Passband frequency (rad/sec)
Ω
1 + ε2 Ω𝑠 → Stopband frequency (rad/sec)
Ω𝑝
ε → Passband parameter
Taking log on both sides
λ → Stopband parameter
𝛼𝑝 → Passband attenuation
20 log 𝐻 𝑗Ω = 10 log 1 − 10 log 1 + ε2
𝛼𝑠 → Stopband attenuation

www.iammanuprasad.com
YouTube - IMPLearn
Order of the Butterworth filter

At Ω = Ω𝑝 , 20 log 𝐻 𝑗Ω = −𝛼𝑝 At Ω = Ω𝑠 , 20 log 𝐻 𝑗Ω = −𝛼𝑠

2 2𝑁
𝛼𝑝 = 10 log 1 + ε Ω𝑠 Taking log on both sides and
𝛼𝑠 = 10 log 1 + ε2
Ω𝑝 finding the value of N
0.1𝛼𝑝 = log 1 + ε2

Taking antilog on both sides 100.1𝛼𝑠 − 1


log 0.1𝛼𝑝
Taking antilog on both sides
𝑁≥ 10 −1
2𝑁
Ω𝑠 Ω
100.1𝛼𝑝 = 1 + ε2 100.1𝛼𝑠 − 1 = ε2 log 𝑠
Ω𝑝
Ω𝑝
ε2 = 100.1𝛼𝑝 − 1 or
2𝑁
1 Ω𝑠 100.1𝛼𝑠 −1
ε = 10 0.1𝛼𝑝
−1 2 = λ
Ω𝑝 ε2 log
ε
𝑁≥
Ω
log 𝑠
Ω𝑠
2𝑁
100.1𝛼𝑠 − 1 Ω𝑝
= 0.1𝛼𝑝
Ω𝑝 10 −1
www.iammanuprasad.com
YouTube - IMPLearn
Steps to design an analog Butterworth filter

1. Find the order of the filter N &round off to higher integer


2. Find the transfer function H(s) for Ωc=1 rad/sec for the values of N
3. Calculate value of cut-off frequency Ωc
4. Find transfer function Ha(s) for the value of Ωc calculated by substituting
𝑠
𝑠= in H(s)
Ωc

www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter
Q) For given specifications design an analog Butterworth filter

0.9 ≤ 𝐻 𝑗Ω ≤ 1 𝑓𝑜𝑟 0 ≤ Ω ≤ 0.2𝜋


𝐻 𝑗Ω ≤ 0.2 𝑓𝑜𝑟 0.4𝜋 ≤ Ω ≤ 𝜋

Solution
1
Ω𝑝 = 0.2𝜋 = 0.9 ε = 0.484
1+ ε2
1
Ω𝑠 = 0.4𝜋 = 0.2
1+ λ2 λ = 4.898

Step 1: Find the order of the filter N & round off to higher
integer

λ 4.898
log log
ε 0.484
𝑁≥ ≥ = 3.34 𝑁≈4
Ω 0.4𝜋
log 𝑠 log
Ω𝑝 0.2𝜋

www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter

Step 2: Find the transfer function H(s) for Ωc=1 rad/sec for the values of N

1
𝐻 𝑆𝑛 =
𝑠 2 + 0.765𝑠 + 1 𝑠 2 + 1.848𝑠 + 1

Step 3: Calculate value of cut-off frequency Ωc

Ω𝑝 0.2𝜋
Ω𝑐 = 1
= 1 = 0.24𝜋
100.1𝛼𝑝 − 1 2𝑁 ε4
1
ε = 100.1𝛼𝑝 − 1 2

www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter

𝑠
Step 4: Find transfer function H(s) for the value of Ωc calculated by substituting 𝑠 = Ω in H(s)
c

1
𝐻 𝑆𝑛 =
𝑠 2 + 0.765𝑠 + 1 𝑠 2 + 1.848𝑠 + 1

1
𝐻 𝑠 =
𝑠 2 𝑠 𝑠 2 𝑠
+ 0.765 +1 + 1.848 +1
0.24𝜋 0.24𝜋 0.24𝜋 0.24𝜋

0.323
𝐻 𝑠 = 2
𝑠 + 0.577𝑠 + 0.057𝜋 2 𝑠 2 + 1.39𝑠 + 0.0576𝜋 2

www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter
Q) Design an analog Butterworth filter that has a -2dB passband
attenuation at a frequency of 20 rad/sec and at least -10dB stopband
attenuation at 30 rad/sec

Solution

𝛼𝑝 = 2𝑑𝐵
Ω𝑝 = 20 𝑟𝑎𝑑/𝑠𝑒𝑐

Ω𝑠 = 30 𝑟𝑎𝑑/𝑠𝑒𝑐 𝛼𝑠 = 10𝑑𝐵

Step 1: Find the order of the filter N & round off to higher
integer

100.1𝛼𝑠 − 1 100.1∗10 − 1
log 0.1𝛼𝑝 log
10 −1 100.1∗2 − 1
𝑁≥ ≥ = 3.37 𝑁≈4
Ω 30
log 𝑠 log
20
Ω𝑝

www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter

Step 2: Find the transfer function H(s) for Ωc=1 rad/sec for the values of N

1
𝐻 𝑆𝑛 =
𝑠 2 + 0.765𝑠 + 1 𝑠 2 + 1.848𝑠 + 1

Step 3: Calculate value of cut-off frequency Ωc

Ω𝑝 20
Ω𝑐 = 1 = 1 = 21.386
100.1𝛼𝑝 − 1 2𝑁 100.1∗2 − 1 2∗4

www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter

𝑠
Step 4: Find transfer function Ha(s) for the value of Ωc calculated by substituting 𝑠 = Ω in H(s)
c

1
𝐻 𝑆𝑛 =
𝑠 2 𝑠 𝑠 2 𝑠
+ 0.765 +1 + 1.848 +1
21.386 21.386 21.386 21.386

0.20921 × 106
𝐻 𝑆𝑛 = 2
𝑠 + 16.368𝑠 + 457.39 𝑠 2 + 39.51𝑠 + 457.394

www.iammanuprasad.com
YouTube - IMPLearn
Design digital filter from analog filter

Digital filter from


analog filter

Impulse invariant
Bilinear transformation
method

www.iammanuprasad.com
YouTube - IMPLearn
Design of IIR filter using Impulse invariant method

• Here we require that the impulse response of the discrete system (digital filter) be the
discrete version of the impulse response of the analogue system (filter)
• Hence the name impulse invariant
• In impulse invariant method the IIR filter is designed such that the unit impulse
response h(n) of digital filter is the sampled version of impulse response of analog filter

Z transform 𝑆 = 𝜎 + 𝑗Ω 𝑍 = 𝑟𝑒 𝑗𝜔
𝑁
𝑟𝑒 𝑗𝜔 = 𝑒 𝜎+𝑗Ω 𝑇
𝐻 𝑍 = ෍ ℎ 𝑛 𝑍 −𝑛
𝑛=0 Equating real and imaginary parts
For impulse invariant method we do the mapping as
𝑟 = 𝑒 𝜎𝑇 𝜔 = ΩT
𝑁

𝐻 𝑍 |𝑧=𝑒 𝑠𝑇 = ෍ ℎ 𝑛 𝑒 −𝑠𝑇𝑛 Real part of analog


pole =radius of Z-
Imaginary part of
analog pole = angle
𝑛=0 plane pole of digital pole
www.iammanuprasad.com
YouTube - IMPLearn
𝐼𝑚 𝑧 𝑗Ω

Case 1 :

𝜎=0
𝑅𝑒 𝑧 𝜎

𝑟 = 𝑒 0𝑇 = 1

Z - Plane S-Plane
Impulse invariant mapping map poles from s-plane’s
𝑗Ω axis to Z-plane’s unit circle

www.iammanuprasad.com
YouTube - IMPLearn
𝐼𝑚 𝑧 𝑗Ω

Case 2 :

𝜎 < 0 (𝑝𝑜𝑙𝑒𝑠 𝑖𝑛 𝑙𝑒𝑓𝑡 ℎ𝑎𝑙𝑓 𝑜𝑓 𝑆 − 𝑝𝑙𝑎𝑛𝑒)


𝑅𝑒 𝑧 𝜎

𝑟 = 𝑒 𝜎𝑇 < 1

Z - Plane S-Plane
All S-plane poles with –ve real parts map to Z–plane
poles inside unit circle

www.iammanuprasad.com
YouTube - IMPLearn
𝐼𝑚 𝑧 𝑗Ω

Case 3 :

𝜎 > 0 (𝑝𝑜𝑙𝑒𝑠 𝑖𝑛 𝑟𝑖𝑔ℎ𝑡 ℎ𝑎𝑙𝑓 𝑜𝑓 𝑆 − 𝑝𝑙𝑎𝑛𝑒)


𝑅𝑒 𝑧 𝜎

𝑟 = 𝑒 𝜎𝑇 > 1

Z - Plane S-Plane
Poles in right half of S-plane map to digital poles
outside unit circle

www.iammanuprasad.com
YouTube - IMPLearn

Let Ha(s) is the system function of analog filter


1
𝑁 𝐿 = 𝑒 𝑎𝑡
𝐶𝑘 𝑃𝑘 → 𝑃𝑜𝑙𝑒𝑠 𝑜𝑓 𝑎𝑛𝑎𝑙𝑜𝑔 𝑓𝑖𝑙𝑡𝑒𝑟 𝑠−𝑎
𝐻𝑎 𝑠 = ෍
𝑆 − 𝑃𝑘 𝐶𝑘 → 𝐶𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡𝑠 𝑖𝑛 𝑝𝑎𝑟𝑡𝑖𝑎𝑙𝑓𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑒𝑥𝑝𝑎𝑛𝑠𝑖𝑜𝑛
𝑘=1

Taking inverse Laplace transform ∞ 𝑁


𝑁 𝐻 𝑧 = ෍ ෍ 𝐶𝑘 𝑒 𝑃𝑘 𝑛𝑇 𝑧 −𝑛
ℎ𝑎 𝑡 = ෍ 𝐶𝑘 𝑒 𝑃𝑘𝑡 𝑛=0 𝑘=1 𝑁
𝑘=1 𝑁 ∞ 𝐶𝑘
𝐻𝑎 𝑠 = ෍
= ෍ 𝐶𝑘 ෍ 𝑒 𝑃𝑘𝑇 𝑧 −1 𝑛 𝑆 − 𝑃𝑘
Sample ha(t) at t=nT 𝑘=1
𝑘=1 𝑛=0
𝑁
𝑁 𝑁
ℎ 𝑛 = ℎ 𝑛𝑇 = ෍ 𝐶𝑘 𝑒 𝑃𝑘𝑛𝑇 𝐶𝑘 𝐶𝑘
𝐻 𝑧 =෍ 𝐻 𝑧 =෍
𝑘=1 1 − 𝑒 𝑃𝑘𝑇 𝑧 −1 1 − 𝑒 𝑃𝑘𝑇 𝑧 −1
𝑘=1 𝑘=1
Now taking Z - Transform

𝐻 𝑧 = ෍ ℎ 𝑛 𝑧 −𝑛
www.iammanuprasad.com
𝑛=0
YouTube - IMPLearn

Steps to design IIR filter using


Impulse invariant method

1. For the given specification find Ha(s), the transfer function of analog filter
2. Select the sampling rate of the digital filter, T seconds/sample
3. Express the analog filter transfer function as the sum of single pole filters
𝑁
𝐶𝑘
𝐻𝑎 𝑠 = ෍
𝑆 − 𝑃𝑘
𝑘=1

4. Compute the Z transform of the digital filter by using the formula


𝑁
𝐶𝑘
𝐻 𝑧 =෍
1 − 𝑒 𝑃𝑘𝑇 𝑧 −1
𝑘=1
𝑁
𝑇𝐶𝑘
𝐻 𝑧 =෍ for T < 1
1 − 𝑒 𝑃𝑘𝑇 𝑧 −1
𝑘=1 www.iammanuprasad.com
YouTube - IMPLearn
Design of IIR filter by impulse invariant technique
2
Q) For the analog transfer function 𝐻 𝑠 = Determine H(z) using impulse invariance method. Assume T=1sec
𝑠+1 (𝑠+2)

Solution
2 2
𝐻 𝑠 = −
2 𝑠+1 (𝑠 + 2)
𝐻 𝑠 =
𝑠 + 1 (𝑠 + 2)
2 2
𝐻 𝑠 = −
Using partial fraction method 𝑠 − −1 (𝑠 − −2 )

𝐴 𝐵 For T=1 sec 2 2


𝐻 𝑠 = + 𝐻 𝑧 = −
𝑠+1 (𝑠 + 2) 1 − 𝑒 −1 𝑧 −1 1 − 𝑒 −2 𝑧 −1
2 2
=
2 = 𝐴(𝑠 + 2) + 𝐵 𝑠 + 1 𝑠 − −1 1 − 𝑒 −1 𝑧 −1
0.465𝑧 −1
𝐻 𝑧 =
At s = -1 At s = -2 1 − 0.503𝑧 −1 + 0.0497𝑧 −2
2 2
=
𝐴=2 𝐵 = −2 𝑠 − −2 1 − 𝑒 −2 𝑧 −1

www.iammanuprasad.com
YouTube - IMPLearn
Design of IIR filter by impulse invariant technique
10
Q) An anlog filter has a transfer function 𝐻 𝑠 = 2 Design a digital filter equivalent to this using impulse
𝑠 +7𝑠+10
invariant method for T=0.2 sec
Solution
10 −3.33 3.33
𝐻 𝑠 = 2 𝐻 𝑠 = +
𝑠 + 7𝑠 + 10 𝑠 − −5 (𝑠 − −2 )

Using partial fraction method


For T=0.2 sec
10 𝐴 𝐵
= +
𝑠 2 + 7𝑠 + 10 𝑠+5 (𝑠 + 2)
−3.33 −3.33 −3.33 3.33
= 𝐻 𝑧 = − 0.2
10 = 𝐴(𝑠 + 2) + 𝐵 𝑠 + 5 1 − 𝑒 −1 𝑧 −1 1 − 𝑒 −0.4 𝑧 −1
𝑠 − −5 1 − 𝑒 −5∗0.2 𝑧 −1
At s = -5 At s = -2 0.2012𝑧 −1
𝐻 𝑧 =
3.33 3.33 1 − 1.0378𝑧 −1 + 0.247𝑧 −2
𝐴 = −3.33 𝐵 = 3.33 =
𝑠 − −2 1 − 𝑒 −2∗02 𝑧 −1
−3.33 3.33
𝐻 𝑠 = +
𝑠+5 (𝑠 + 2)
www.iammanuprasad.com
YouTube - IMPLearn
Design of IIR filter by impulse invariant technique
𝑠+𝑎
Q) Apply impulse invariant method and find H(z) for 𝐻 𝑠 =
(𝑠+𝑎)2 +𝑏2 𝐿 𝑠−𝑎
𝑎𝑡
𝑒 cos 𝑏𝑡 ֞
𝑠 − 𝑎 2 + 𝑏2
Solution

𝑠+𝑎 𝑒 𝑗𝑏𝑛𝑇 + 𝑒 −𝑗𝑏𝑛𝑇
𝐻 𝑠 = 𝐻 𝑧 = ෍ 𝑒 −𝑎𝑛𝑇 𝑧 −𝑛
(𝑠 + 𝑎)2 +𝑏 2 2
𝑛=0

Inverse Laplace of the given function 1 𝑛 𝑛
= ෍ 𝑒 −𝑎𝑇 𝑒 𝑗𝑏𝑇 𝑧 −1 + 𝑒 −𝑎𝑇 𝑒 −𝑗𝑏𝑇 𝑧 −1
2
𝑛=0
ℎ 𝑡 = 𝑒 −𝑎𝑡 cos 𝑏𝑡 ∞
1 𝑛 𝑛
= ෍ 𝑒 −(𝑎−𝑗𝑏)𝑇 𝑧 −1 + 𝑒 −(𝑎+𝑗𝑏)𝑇 𝑧 −1 ∞
For sampling the function substitute t=nT 2 1
𝑛=0
෍ 𝑎𝑛 ֞
ℎ 𝑛𝑇 = 𝑒 −𝑎𝑛𝑇 cos 𝑏𝑛𝑇 1 1 1 1−𝑎
𝑛=0
𝐻 𝑧 = +
2 1 − 𝑒 − 𝑎−𝑗𝑏 𝑇 𝑧 −1 1 − 𝑒 − 𝑎+𝑗𝑏 𝑇 𝑧 −1
Taking Z-transform

1 − 𝑒 −𝑎𝑇 cos 𝑏𝑇 𝑧 −1
𝐻 𝑧 = ෍ 𝑒 −𝑎𝑛𝑇 cos 𝑏𝑛𝑇 𝑧 −𝑛 𝐻 𝑧 =
1 − 2𝑒 −𝑎𝑇 cos 𝑏𝑇 𝑧 −1 + 𝑒 −2𝑎𝑇 𝑧 −2 www.iammanuprasad.com
𝑛=0
YouTube - IMPLearn
Steps to design IIR filter using
Bilinear transformation method

The basis operation is to convert an analogue filter H(s) into an equivalent


digital filter H(z) by using bilinear approximation

1. From the given specifications find pre-warping analog frequency


using formula
2 𝜔
Ω = tan
𝑇 2

2. Using the analog frequency find H(s) of the analog filter


3. Select the sampling rate of the digital filter, call it T seconds per
sample
2 1−𝑧 −1
4. Substitute 𝑠 = into the transfer function found in step 2
𝑇 1+𝑧 −1

www.iammanuprasad.com
YouTube - IMPLearn
Design of IIR filter by impulse invariant technique
2
Q) Apply bilinear transformation to 𝐻 𝑠 =
𝑠+1 + 𝑠+2

Solution
2 1 + 𝑧 −1 2
𝐻 𝑠 = =
𝑠+1 + 𝑠+2 3 − 𝑧 −1 2

2 1−𝑧 −1
Substitute 𝑠 = at T=1sec 1 + 𝑧 −1
𝑇 1+𝑧 −1
𝐻 𝑧 =
1 − 0.33𝑧 −1
2
𝐻 𝑧 =
1 − 𝑧 −1 1 − 𝑧 −1
2 +1 + 2 +2
1 + 𝑧 −1 1 + 𝑧 −1
2
=
1 − 𝑧 −1 + 1 + 𝑧 −1 1 − 𝑧 −1
2 + 2 +2
1 + 𝑧 −1 1 + 𝑧 −1
2 1 + 𝑧 −1 2
=
2 − 2𝑧 −1 + 1 + 𝑧 −1 + 2 − 2𝑧 −1 + 2 + 2𝑧 −1
www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter
Q) Design a digital analog Butterworth filter satisfying the constraints
𝜋
0.707 ≤ 𝐻 𝑗𝜔 ≤ 1 𝑓𝑜𝑟 0 ≤ 𝜔 ≤
2
3𝜋
𝐻 𝑗𝜔 ≤ 0.2 𝑓𝑜𝑟 ≤𝜔≤𝜋
4
using bilinear transformation. Take T=1sec
Solution
1 𝜋
= 0.707 ε=1 𝜔𝑝 =
1 + ε2 2
1 3𝜋
= 0.2 λ = 4.89 𝜔𝑠 =
4
1 + λ2

Step 1: Step 1: From the given specifications find pre-warping


2 𝜔
analog frequency using formula Ω = tan
𝑇 2
2 𝜔𝑠 2 𝜔𝑝
Ω𝑠 = tan Ω𝑝 = tan 3𝜋
𝑇 2 𝑇 2 Ω𝑠 2 tan
= 8
3𝜋 𝜋 𝜋 = 2.414
2 Ω𝑝 2 tan
2
Ω𝑠 = tan 4 Ω𝑝 = tan 2 4
1 2 1 2
3𝜋 𝜋
Ω𝑠 = 2 tan Ω𝑝 = 2 tan www.iammanuprasad.com
8 4
YouTube - IMPLearn
Design an analog Butterworth filter

Step 2: Using the analog frequency find H(s) of the analog filter

λ 4.89
log ε log
𝑁≥ ≥ 1 ≥ 1.80
Ω log 2.414
log Ω 𝑠
𝑝

𝑁=2

1
𝐻𝑎 𝑠 =
𝑠 2 + √2𝑠 + 1

𝜋
Ω𝑝 2 tan
Ω𝑐 = = 4 = 2 𝑟𝑎𝑑/𝑠𝑒𝑐
1 1
ε𝑁 12
𝑠
To find H(s) substitute 𝑠 = Ω
𝑐 1 4
𝐻 𝑠 = 𝐻 𝑠 = 2
𝑠2 𝑠 𝑠 + 2.828𝑠 + 4
+ √2 + 1
4 2
www.iammanuprasad.com
YouTube - IMPLearn
Design an analog Butterworth filter

2 1−𝑧 −1
Step 4: Substitute 𝑠 = 𝑇 1+𝑧 −1 into the transfer function

1
𝐻 𝑠 = 2
𝑠 + 2.828𝑠 + 4

1
= 2
1 − 𝑧 −1 1 − 𝑧 −1
2 + 2.828 2 +4
1 + 𝑧 −1 1 + 𝑧 −1

4 1 + 𝑧 −1
𝐻 𝑠 =
4 1 − 𝑧 −1 + 5.656 1 − 𝑧 −2 + 4 1 + 𝑧 −1

www.iammanuprasad.com
YouTube - IMPLearn
Realisation of discrete time system
• A digital filter transfer function can be realized in a variety ways
• Realization of FIR filters
• Realization of IIR filters
• Basic elements required for implementation of an LTI digital system are adder , multiplier and
memory for storing elements
• In digital implementation the delay operation can be implemented by providing a storage register by
each unit delay is required

𝒙𝟏 𝒏 𝒂
𝒙𝟏 𝒏 + 𝒙𝟐 𝒏 𝒙 𝒏 𝒂𝒙 𝒏 Z-1
𝒙 𝒏 𝒙 𝒏−𝟏

𝒙𝟐 𝒏

Adder Multiplier Unit delay

www.iammanuprasad.com
YouTube - IMPLearn

FIR filter realization

• Mainly four types of realisation are there


1. Direct form realisation
2. Cascade form realisation
3. Linear phase realisation
4. Lattice structure realisation

www.iammanuprasad.com
YouTube - IMPLearn
Direct form realization
The direct form of FIR may be obtained by using the equation of linear convolution
𝑁−1

𝑦 𝑘 = ෍ℎ 𝑘 𝑥 𝑛−𝑘 = ℎ 0 𝑥 𝑛 + ℎ 1 𝑥 𝑛 − 1 + ⋯+ ℎ 𝑁 − 1 𝑥 𝑛 − 𝑁 − 1
𝑘=0

Taking Z-transform
𝑌 𝑧 = ℎ 0 𝑋 𝑧 + ℎ 1 𝑋 𝑧 𝑧 −1 + ⋯ + ℎ 𝑁 − 1 𝑋 𝑧 𝑧 − 𝑁−1

𝑿 𝒛
Z-1 Z-1 Z-1 Z-1

𝒉 𝟎 𝒉 𝟏 𝒉 𝟐 𝒉 𝑵−𝟐 𝒉 𝑵−𝟏

𝒀 𝒛

www.iammanuprasad.com
YouTube - IMPLearn
Q) Determine the direct form realization of system function
𝐻 𝑧 = 1 + 2𝑧 −1 − 3𝑧 −2 − 4𝑧 −3 + 5𝑧 −4
𝑌 𝑧
𝐻 𝑧 =
𝑋 𝑧
𝐻 𝑧 = 1 + 2𝑧 −1 − 3𝑧 −2 − 4𝑧 −3 + 5𝑧 −4

𝑌 𝑧 = 𝑋 𝑧 1 + 2𝑧 −1 − 3𝑧 −2 − 4𝑧 −3 + 5𝑧 −4

𝑿 𝒛
Z-1 Z-1 Z-1 Z-1

𝟏 𝟐 −𝟑 −𝟒 𝟓

𝒀 𝒛

www.iammanuprasad.com
YouTube - IMPLearn
Cascade form realization
Q) Obtain cascade form realization of system function 𝐻 𝑧 = 1 + 2𝑧 −1 − 𝑧 −2 1 + 𝑧 −1 − 𝑧 −2

𝐻 𝑧 = 𝐻1 𝑧 𝐻2 𝑧

𝑌1 𝑧 𝑿𝟏 𝒛 𝒀𝟏 𝒛 𝑿𝟐 𝒛 𝒀 𝒛
𝐻1 𝑧 =
𝑋1 𝑧

𝑌2 𝑧
𝐻2 𝑧 =
𝑋2 𝑧 Z-1 Z-1
𝟐 𝟏

𝑌1 𝑧 = 𝑋1 𝑧 1 + 2𝑧 −1 − 𝑧 −2
Z-1 Z-1
𝑌1 𝑧 = 𝑋1 𝑧 + 2𝑋 𝑧 𝑧 −1 −𝑋 𝑧 𝑧 −2
−𝟏 −𝟏
𝑌2 𝑧 = 𝑋2 𝑧 1 + 𝑧 −1 − 𝑧 −2

𝑌2 𝑧 = 𝑋2 𝑧 + 𝑋2 𝑧 𝑧 −1 − 𝑋2 𝑧 𝑧 −2
www.iammanuprasad.com
YouTube - IMPLearn
Cascade form realization
5
Q) Obtain cascade form realization of system function 𝐻 𝑧 = 1 + 𝑧 −1 + 2𝑧 −2 + 2𝑧 −3
2

5 −1
𝐻 𝑧 = 1 + 𝑧 + 2𝑧 −2 + 2𝑧 −3
2 𝑿 𝒛 𝒀 𝒛
𝑧3 5 −1
= 3 1 + 𝑧 + 2𝑧 −2 + 2𝑧 −3
𝑧 2
1 3 5 2 Z-1
= 3 𝑧 + 𝑧 + 2𝑧1 + 2 Z-1 𝟏
𝑧 2
𝟐
The term inside the bracket equal to zero when z=-2 𝟐

So the first term can be (z+2)


Z-1
1 1 𝟏
= 3 𝑧+2 𝑧2 + 𝑧 + 1
𝑧 2

1 1 −1
= 3 𝑧 1 + 2𝑧 𝑧 1 + 𝑧 + 𝑧 −2
−1 2
𝑧 2
www.iammanuprasad.com
YouTube - IMPLearn
Linear phase realization
1 1 1 1 1
Q) Realise the system function 𝐻 𝑧 = + 𝑧 −1 + 𝑧 −2 + 𝑧 −3 + 𝑧 −4 + 𝑧 −5 + 𝑧 −6
2 3 4 3 2
ℎ 0 ℎ 1 𝒉 𝟐 𝒉 𝟑 𝒉 𝟒 𝒉 𝟓 𝒉 𝟔

For a linear phase FIR filter ℎ 𝑛 = ℎ 𝑁 − 1 − 𝑛


𝑁=7
1
ℎ 0 = ℎ 7−1−0 =ℎ 6 =
2 𝑿 𝒛
1 Z-1 Z-1 Z-1
ℎ 1 = ℎ 7−1−1 =ℎ 5 =
3
ℎ 2 = ℎ 7−1−2 =ℎ 4 =1
1
ℎ 3 = ℎ 7−1−3 =ℎ 3 = 𝟏 𝟏
4 𝟏 𝟑
𝟐 Z-1 Z-1 Z-1
𝐻 𝑧
1 −6
1 −1 𝟏
= 1+𝑧 + 𝑧 + 𝑧 −5 𝟒
2 3
−2 −4
1 −3
+ 1. 𝑧 + 𝑧 + 𝑧
4
𝒀 𝒛 www.iammanuprasad.com
YouTube - IMPLearn
Linear phase realization
Q) Realise the system function using minimum number of multiplier
1 1 1 1
𝐻 𝑧 = 1 + 𝑧 −1 + 𝑧 −2 + 𝑧 −3 + 𝑧 −4 + 𝑧 −5
3 4 4 3
ℎ 0 ℎ 1 𝒉 𝟐 𝒉 𝟑 𝒉 𝟒 𝒉 𝟓

For a linear phase FIR filter ℎ 𝑛 = ℎ 𝑁 − 1 − 𝑛


𝑁=6

ℎ 0 = ℎ 6−1−0 =ℎ 5 =1
𝑿 𝒛
1 Z-1 Z-1
ℎ 1 = ℎ 6−1−1 =ℎ 4 =
3
1
ℎ 2 = ℎ 6−1−2 =ℎ 3 =
4 Z-1
𝟏 𝟏
𝟑 𝟒
𝐻 𝑧
1 −1 Z-1 Z-1
= 1 1 + 𝑧 −5 + 𝑧 + 𝑧 −4
3
1 −2
+ 𝑧 + 𝑧 −3
4

𝒀 𝒛 www.iammanuprasad.com
YouTube - IMPLearn
Linear phase realization
Q) Realise the system function using minimum number of multiplier
1 1
𝐻 𝑧 = 1 + 𝑧 −1 1 + 𝑧 −1 + 𝑧 −2 + 𝑧 −3
2 2

𝑿 𝒛 Z-1

Z-1
Z-1
Z-1

𝒀 𝒛

www.iammanuprasad.com
YouTube - IMPLearn
Conversion of lattice coefficient to direct form filter coefficient

The general equation

𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘
𝑘=1

The equations to convert filter coefficients to direct form FIR filter coefficients are

𝛼𝑚 0 = 1

𝛼𝑚 𝑚 = 𝐾𝑚

𝛼𝑚 𝑘 = 𝛼𝑚−1 𝑘 + 𝛼𝑚 𝑚 𝛼𝑚−1 𝑚 − 𝑘

www.iammanuprasad.com
YouTube - IMPLearn
Q) Consider an FIR filter lattice filter with coefficient K1 = ½ ,K2 = 1/3 , K3 = ¼. Determine the
FIR filter coefficients for direct form structure?

Solution 𝑚

𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘
Number of stages (m) = 3 𝑘=1

𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘 = 𝑥 𝑛 + 𝛼3 1 𝑥 𝑛 − 1 + 𝛼3 2 𝑥 𝑛 − 2 + 𝛼3 3 𝑥 𝑛 − 3
𝑘=1

For m=3 For m=2 For m=1


𝛼3 0 = 1 𝛼2 0 = 1 𝛼1 0 = 1
1 1 1
𝛼3 3 = 𝛼2 2 = 𝛼1 1 =
4 3 2
and k=2 and k=1
For m=3 and k=1
𝛼3 2 𝛼2 1
= 𝛼2 2 + 𝛼3 3 𝛼2 1 𝛼3 1 = 𝛼2 1 + 𝛼3 3 𝛼2 2
= 𝛼1 1 + 𝛼2 2 𝛼1 1
1 1 1 1 1 1 2 2 1 1 3
= + 𝛼2 1 = = + . = = + . = www.iammanuprasad.com
3 4 2 2 3 2 3 3 4 3 4
YouTube - IMPLearn
Conversion of direct form FIR filter coefficient to lattice coefficient

The general equation

𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘
𝑘=1

The equations to convert filter coefficients to lattice form FIR filter coefficients are

𝛼𝑚−1 0 = 1

𝐾𝑚 = 𝛼𝑚 𝑚

𝛼𝑚 𝑘 − 𝛼𝑚 𝑚 𝛼𝑚 𝑚 − 𝑘
𝛼𝑚−1 𝑘 = 2 𝑓𝑜𝑟 1 ≤ 𝑘 ≤ 𝑚 − 1
1 − 𝛼𝑚 𝑚
www.iammanuprasad.com
YouTube - IMPLearn
4 3 2
A FIR filter is given by the difference equation 𝑦 𝑛 = 2𝑥 𝑛 + 5 𝑥 𝑛 − 1 + 2 𝑥 𝑛 − 2 + 3 𝑥 𝑛 − 3 Determine
its lattice form

Solution
𝑚
3
𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘
𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘 𝑘=1
𝑘=1

= 𝑥 𝑛 + 𝛼3 1 𝑥 𝑛 − 1 + 𝛼3 2 𝑥 𝑛 − 2 + 𝛼3 3 𝑥 𝑛 − 3

2 3 1
𝑦 𝑛 =2 𝑥 𝑛 + 𝑥 𝑛−1 + 𝑥 𝑛−2 + 𝑥 𝑛−3
5 4 3

Comparing the two equations we get

2 3 1
𝛼3 1 = 𝛼3 2 = 𝛼 3 3 = = 𝑘3
5 4 3

𝛼2 0 = 1
www.iammanuprasad.com
YouTube - IMPLearn 2 3 1
𝛼3 1 = 𝛼3 2 = 𝛼3 3 = = 𝑘3 𝛼2 0 = 1
For m=3, k=1 5 4 3

2 1 3
𝛼3 1 − 𝛼3 3 𝛼3 2 − . 𝑚
𝛼2 1 = = 5 3 4
1 − 𝛼32 3 = 0.1687 𝑦 𝑛 = 𝑥 𝑛 + ෍ 𝛼𝑚 𝑘 𝑥 𝑛 − 𝑘
1 2
1− 3 𝑘=1

For m=3, k=2


3 1 2
𝛼3 2 − 𝛼3 3 𝛼3 1 − .
𝑘2 = 𝛼2 2 = = 4 3 5
= 0.6937
1 − 𝛼22 3 1 2
1− 3

For m=2, k=1

𝛼2 1 − 𝛼2 2 𝛼2 1 0.1687 − (0.6937)0.1687
𝑘1 = 𝛼1 1 = =
1 − 𝛼22 2 1 − 0.6937 2

= 0.0996
www.iammanuprasad.com
YouTube - IMPLearn

IIR filter Realisation

• Mainly four types of realisation are there


1. Direct form I realisation
2. Direct form II realisation
3. Cascade form realisation
4. Parallel form realisation

www.iammanuprasad.com
YouTube - IMPLearn
Direct form I realization
Let us consider an IIR system described by the difference equation
𝑁 𝑀

𝑦 𝑛 = − ෍ 𝑎𝑘 𝑦 𝑛 − 𝑘 + ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘 𝒙 𝒏 𝒚 𝒏
𝒃𝟎 𝒘 𝒏
𝑘=1 𝑘=0

= −𝑎1 𝑦 𝑛 − 1 − 𝑎2 𝑦 𝑛 − 2 …
− 𝑎𝑁 𝑦 𝑛 − 𝑁 + 𝑤 𝑛 Z-1 Z-1
𝒃𝟏 −𝒂𝟏
Where 𝒙 𝒏−𝟏 𝒚 𝒏−𝟏

𝑤 𝑛
Z-1 Z-1
= 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 𝑁 + ⋯
+ 𝑏𝑀 𝑥 𝑛 − 𝑀
𝒃𝑴−𝟏 −𝒂𝑵−𝟏

Z-1 Z-1
𝒃𝑴 −𝒂𝑵
𝒙 𝒏−𝑴 𝒚 𝒏−𝑴
www.iammanuprasad.com
YouTube - IMPLearn
Direct form I realization
Q) Realise the second order digital filter
𝑦 𝑛 = 2𝑟 cos 𝜔0 𝑦 𝑛 − 1 − 𝑟 2 𝑦 𝑛 − 2 + 𝑥 𝑛 − 𝑟 cos 𝜔0 𝑥 𝑛 − 1
Solution

𝑤 𝑛 = 𝑥 𝑛 − 𝑟 cos 𝜔0 𝑥 𝑛 − 1 𝑦 𝑛 = 2𝑟 cos 𝜔0 𝑦 𝑛 − 1 − 𝑟 2 𝑦 𝑛 − 2 + 𝑤 𝑛

𝒙 𝒏 𝒚 𝒏
𝒘 𝒏

Z-1 Z-1
−𝑟 cos 𝜔0 2𝑟 cos 𝜔0

Z-1
𝑟2

www.iammanuprasad.com
YouTube - IMPLearn
Direct form I realization
Q) Obtain the direct form I realisation for the system described by difference equation
𝑦 𝑛 = 0.5𝑦 𝑛 − 1 − 0.25𝑦 𝑛 − 2 + 𝑥 𝑛 + 0.4𝑥 𝑛 − 1
Solution

𝑤 𝑛 = 𝑥 𝑛 + 0.4𝑥 𝑛 − 1 𝑦 𝑛 = 0.5𝑦 𝑛 − 1 − 0.25𝑦 𝑛 − 2 + 𝑤 𝑛

𝒙 𝒏 𝒚 𝒏
𝒘 𝒏

Z-1 Z-1
0.4 0.5

Z-1
−0.25

www.iammanuprasad.com
YouTube - IMPLearn
Direct form II realization
Let us consider an IIR system described by the difference equation
𝑁 𝑀

𝑦 𝑛 = − ෍ 𝑎𝑘 𝑦 𝑛 − 𝑘 + ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘
𝑘=1 𝑘=0 𝑌 𝑧 = 𝑏0 𝑊 𝑧 + 𝑏1 𝑧 −1 𝑊 𝑧 + ⋯ + 𝑏𝑀 𝑧 −𝑀 𝑊 𝑧
The system function can be represented as where
σ𝑀
𝑘=0 𝑏𝑘 𝑧
−𝑘
𝐻 𝑧 = 𝑊 𝑧 + 𝑎1 𝑧 −1 𝑊 𝑧 + 𝑎2 𝑧 −2 𝑊 𝑧 … + 𝑎𝑁 𝑧 −𝑁 𝑊 𝑧 = 𝑋 𝑧
1 + σ𝑁
𝑘=1 𝑎𝑘 𝑧
−𝑘

Let
𝑊 𝑧 = 𝑋 𝑧 − 𝑎1 𝑧 −1 𝑊 𝑧 − 𝑎2 𝑧 −2 𝑊 𝑧 … − 𝑎𝑁 𝑧 −𝑁 𝑊 𝑧
𝑌 𝑧 𝑌 𝑧 𝑊 𝑧
= .
𝑋 𝑧 𝑊 𝑧 𝑋 𝑧 Taking inverse z transform we get
𝑀
𝑌 𝑧 𝑤 𝑛 = 𝑥 𝑛 − 𝑎1 𝑤 𝑛 − 1 − 𝑎2 𝑤 𝑛 − 2 … − 𝑎𝑁 𝑤 𝑛 − 𝑁
= ෍ 𝑏𝑘 𝑧 −𝑘
𝑊 𝑧
𝑘=0
𝑦 𝑛 = 𝑏0 𝑤 𝑛 + 𝑏1 𝑤 𝑛 − 1 + ⋯ + 𝑏𝑀 𝑤 𝑛 − 𝑀
𝑊 𝑧 1
=
𝑋 𝑧 1 + σ𝑁
𝑘=1 𝑎𝑘 𝑧
−𝑘 www.iammanuprasad.com
YouTube - IMPLearn
Direct form II realization
𝑤 𝑛 = 𝑥 𝑛 − 𝑎1 𝑤 𝑛 − 1 − 𝑎2 𝑤 𝑛 − 2 … − 𝑎𝑁 𝑤 𝑛 − 𝑁

𝑦 𝑛 = 𝑏0 𝑤 𝑛 + 𝑏1 𝑤 𝑛 − 1 + ⋯ + 𝑏𝑀 𝑤 𝑛 − 𝑀

𝒙 𝒏 𝒚 𝒏

Z-1
−𝒂𝟏 𝒃𝟏

Z-1

−𝒂𝑵−𝟏 𝒃𝑴−𝟏

Z-1
−𝒂𝑵 𝒃𝑴
www.iammanuprasad.com
YouTube - IMPLearn
Direct form II realization
Q) Realise the second order digital filter using direct form II 𝑌 𝑧 𝑌 𝑧 𝑊 𝑧
= .
𝑦 𝑛 = 2𝑟 cos 𝜔0 𝑦 𝑛 − 1 − 𝑟 2 𝑦 𝑛 − 2 + 𝑥 𝑛 − 𝑟 cos 𝜔0 𝑥 𝑛 − 1 𝑋 𝑧 𝑊 𝑧 𝑋 𝑧
Solution
Taking Z - Transform

𝑌 𝑧 = 2𝑟 cos 𝜔0 𝑌 𝑧 𝑧 −1 − 𝑟 2 𝑌 𝑧 𝑧 −2 + 𝑋 𝑧 − 𝑟 cos 𝜔0 𝑋 𝑧 𝑧 −1

𝑌 𝑧 1 − 2𝑟 cos 𝜔0 𝑧 −1 + 𝑟 2 𝑧 −2 = 𝑋 𝑧 1 − 𝑟 cos 𝜔0 𝑧 −1

𝑌 𝑧 1 − 𝑟 cos 𝜔0 𝑧 −1
=
𝑋 𝑧 1 − 2𝑟 cos 𝜔0 𝑧 −1 + 𝑟 2 𝑧 −2 𝑊 𝑧 1
=
𝑌 𝑧 𝑋 𝑧 1 − 2𝑟 cos 𝜔0 𝑧 −1 + 𝑟 2 𝑧 −2
= 1 − 𝑟 cos 𝜔0 𝑧 −1
𝑊 𝑧
𝑊 𝑧 − 2𝑟 cos 𝜔0 𝑊 𝑧 𝑧 −1 + 𝑟 2 𝑊 𝑧 𝑧 −2 = 𝑋 𝑧
𝑌 𝑧 = 𝑊 𝑧 1 − 𝑟 cos 𝜔0 𝑧 −1
𝑊 𝑧 = 𝑋 𝑧 + 2𝑟 cos 𝜔0 𝑧 −1 𝑊 𝑧 − 𝑟 2 𝑧 −2 𝑊 𝑧
Inverse transform
Inverse transform
𝑦 𝑛 = 𝑤 𝑛 − 𝑟 cos 𝜔0 𝑤 𝑛 − 1 𝑤 𝑛 = 𝑥 𝑛 + 2𝑟 cos 𝜔0 𝑥 𝑛 − 1 − 𝑟 2 𝑥 𝑛 − 2
www.iammanuprasad.com
YouTube - IMPLearn
Direct form II realization
𝑦 𝑛 = 𝑤 𝑛 − 𝑟 cos 𝜔0 𝑤 𝑛 − 1 𝑧 −1 𝑤 𝑛 = 𝑥 𝑛 + 2𝑟 cos 𝜔0 𝑥 𝑛 − 1 − 𝑟 2 𝑥 𝑛 − 2

𝒙 𝒏 𝒘 𝒏 𝒚 𝒏

Z-1
𝟐𝒓 𝒄𝒐𝒔𝝎𝟎 −𝒓 𝒄𝒐𝒔𝝎𝟎

Z-1
−𝒓𝟐

www.iammanuprasad.com
YouTube - IMPLearn
Direct form II realization
Q) Determine the direct form II realisation for the following system 𝑌 𝑧 𝑌 𝑧 𝑊 𝑧
𝑦 𝑛 = −0.1𝑦 𝑛 − 1 + 0.72𝑦 𝑛 − 2 + 0.7𝑥 𝑛 − 0.252𝑥 𝑛 − 1 = .
𝑋 𝑧 𝑊 𝑧 𝑋 𝑧
Solution
Taking Z - Transform

𝑌 𝑧 = −0.1𝑌 𝑧 𝑧 −1 + 0.72𝑌 𝑧 𝑧 −2 + 0.7𝑋 𝑧 − 0.252𝑋 𝑧 𝑧 −1

𝑌 𝑧 1 + 0.1𝑧 −1 − 0.72𝑧 −2 = 𝑋 𝑧 0.7 − 0.252𝑧 −1

𝑌 𝑧 0.7 − 0.252𝑧 −1
=
𝑋 𝑧 1 + 0.1𝑧 −1 − 0.72𝑧 −2 𝑊 𝑧 1
=
𝑌 𝑧 𝑋 𝑧 1 + 0.1𝑧 −1 − 0.72𝑧 −2
= 0.7 − 0.252𝑧 −1
𝑊 𝑧
𝑊 𝑧 + 0.1𝑊 𝑧 𝑧 −1 − 0.72𝑊 𝑧 𝑧 −2 = 𝑋 𝑧
𝑌 𝑧 = 𝑊 𝑧 0.7 − 0.252𝑧 −1
𝑊 𝑧 = 𝑋 𝑧 − 0.1𝑊 𝑧 𝑧 −1 + 0.72𝑊 𝑧 𝑧 −2
Inverse transform
Inverse transform
𝑦 𝑛 = 0.7𝑤 𝑛 − 0.252𝑤 𝑛 − 1 𝑤 𝑛 = 𝑥 𝑛 − 0.1𝑤 𝑛 − 1 + 0.72𝑤 𝑛 − 2
www.iammanuprasad.com
YouTube - IMPLearn
Direct form II realization

𝑦 𝑛 = 0.7𝑤 𝑛 − 0.252𝑤 𝑛 − 1 𝑤 𝑛 = 𝑥 𝑛 − 0.1𝑤 𝑛 − 1 + 0.72𝑤 𝑛 − 2

𝒙 𝒏 𝒘 𝒏 𝟎. 𝟕 𝒚 𝒏

Z-1
−𝟎. 𝟏 −𝟎. 𝟐𝟓𝟐

Z-1
𝟎. 𝟕𝟐

www.iammanuprasad.com
YouTube - IMPLearn
Cascade form realization
Let us consider an IIR system with system function

𝒚𝟏 𝒏 𝒚 𝒏
= 𝒙𝟐 𝒏
𝒙 𝒏 𝒚 𝒏 𝒙 𝒏 = 𝒙𝟏 𝒏 𝒃𝒌𝟎 𝒃𝒎𝟎
H1(z) H2(z)

Z-1 Z-1
𝑏𝑘0 + 𝑏𝑘1 𝑧 −1 + 𝑏𝑘2 𝑧 −2
𝐻1 𝑧 = −𝒂𝒌𝟏 −𝒃𝒌𝟏 −𝒂𝒎𝟏 −𝒃𝒎𝟏
1 + 𝑎𝑘1 𝑧 −1 + 𝑎𝑘2 𝑧 −2

𝑏𝑚0 + 𝑏𝑚1 𝑧 −1 + 𝑏𝑚2 𝑧 −2 Z-1 Z-1


𝐻2 𝑧 =
1 + 𝑎𝑚1 𝑧 −1 + 𝑎𝑚2 𝑧 −2 −𝒂𝒌𝟐 −𝒃𝒌𝟐 −𝒂𝒎𝟐 −𝒃𝒎𝟐

www.iammanuprasad.com
YouTube - IMPLearn
Cascade form realization
Q) Realise the system with difference equation
3 1 1
𝑦 𝑛 = 𝑦 𝑛 − 1 − 𝑦 𝑛 − 2 + 𝑥 𝑛 + 𝑥 𝑛 − 1 in cascade form
4 8 3
𝑌 𝑧
Solution 𝐻 𝑧 =
𝑋 𝑧
Taking Z - Transform

3 1 1
𝑌 𝑧 = 𝑌 𝑧 𝑧 − 𝑌 𝑧 𝑧 + 𝑋 𝑧 + 𝑋 𝑧 𝑧 −1
−1 −2
4 8 3
3 −1 1 −2 1 −1
𝑌 𝑧 1− 𝑧 + 𝑧 =𝑋 𝑧 1+ 𝑧 1
4 8 3 1 + 𝑧 −1
𝐻1 𝑧 = 3
1 1
1 + 𝑧 −1 1 − 𝑧 −1
𝑌 𝑧 3 2
=
𝑋 𝑧 3 1
1 − 𝑧 −1 + 𝑧 −2
4 8 1
1 𝐻2 𝑧 =
1
𝑌 𝑧 1 + 𝑧 −1 1 − 𝑧 −1
= 3 4
𝑋 𝑧 1 1
1 − 𝑧 −1 1 − 𝑧 −1
2 4 www.iammanuprasad.com
YouTube - IMPLearn

1 1
1 + 𝑧 −1 𝐻2 𝑧 =
1
3
𝐻1 𝑧 =
1 1 − 𝑧 −1
4
1 − 𝑧 −1
2
1 1 1
𝑌1 𝑧 = 𝑋1 𝑧 + 𝑋1 𝑧 𝑧 + 𝑌1 𝑧 𝑧 −1
−1
𝑌2 𝑧 = X2 𝑧 + 𝑌2 𝑧
3 2 4
1 1 1
𝑦1 𝑛 = 𝑥1 𝑛 + 𝑥1 𝑛 − 1 + 𝑦1 𝑛 − 1 𝑦2 𝑛 = x2 𝑛 + 𝑦2 𝑛 − 1
3 2 4

𝒚𝟏 𝒏
𝒙 𝒏 = 𝒙𝟏 𝒏 = 𝒙𝟐 𝒏 𝒚𝟐 𝒏

Z-1 Z-1
𝟏 𝟏 𝟏
𝟑 𝟐 𝟒

www.iammanuprasad.com
YouTube - IMPLearn
Parallel form realization
A parallel form realisation of an IIR system can be obtained by performing a partial expansion
𝑁
𝐶𝑘 𝐶1 𝐶2 𝐶𝑁
𝐻 𝑧 =𝐶+෍ 𝐻 𝑧 =𝐶+ + + ⋯ +
1 − 𝑃𝑘 𝑧 −1 1 − 𝑃1 𝑧 −1 1 − 𝑃2 𝑧 −1 1 − 𝑃𝑁 𝑧 −1
𝑘=1

𝑌 𝑧 = 𝑐𝑋 𝑧 + 𝐻1 𝑧 𝑋 𝑧 + 𝐻2 𝑧 𝑋 𝑧 + ⋯ + 𝐻𝑁 𝑧 𝑋 𝑧

𝑪
𝒙 𝒏

H1(z)

H2(z)

Hk(z)
𝒚 𝒏
www.iammanuprasad.com
YouTube - IMPLearn
Parallel form realization
Q) Realise the system given by difference equation
𝑦 𝑛 = −0.1𝑦 𝑛 − 1 + 0.72𝑦 𝑛 − 2 + 0.7𝑥 𝑛 − 0.25𝑥 𝑛 − 2 in parallel form

Taking Z - Transform

𝑌 𝑧 = −0.1𝑌 𝑧 𝑧 −1 + 0.72𝑌 𝑧 𝑧 −2 + 0.7𝑋 𝑧 − 0.25𝑋 𝑧 𝑧 −2

𝑌 𝑧 1 + 0.1𝑧 −1 − 0.72𝑧 −2 = 𝑋 𝑧 0.7 − 0.25𝑧 −2

0.7−0.25𝑧 −2
𝐻 𝑧 =
1+ 0.1𝑧 −1 −0.72𝑧 −2

−0.035𝑧 −1 +0.35
= 0.35 +
1+0.1𝑧 −1 −0.72𝑧 −2

0.206 0.144
= 0.35 + +
1 + 0.9𝑧 −1 1 − 0.8𝑧 −1
www.iammanuprasad.com
YouTube - IMPLearn
Parallel form realization
0.206 0.144
𝐻 𝑧 = 0.35 + +
1 + 0.9𝑧 −1 1 − 0.8𝑧 −1

𝟎. 𝟑𝟓
𝒙 𝒏 𝟎. 𝟐𝟎𝟔

Z-1

−𝟎. 𝟗

𝟎. 𝟏𝟒𝟒 𝒚 𝒏

Z-1
𝟎. 𝟖
www.iammanuprasad.com
YouTube - IMPLearn

Multi rate DSP

• The processing of a discrete time signal at different sampling rates in


different parts of a system is called multi rate DSP
• Discrete time system that employ sampling rate conversion while
processing the discrete time signal are called multi rate DSP system
• The process of converting a signal from one sampling rate to another
sampling rate are of two types
• Down sampling or decimation
• Up sampling or interpolation

www.iammanuprasad.com
YouTube - IMPLearn

Down sampling
• It is the process of reducing the sampling rate by an integer factor D or M
• Down sampled signal of x(n) can be obtained by simply keeping every
Mth sample and removing (M-1) in between samples

𝒙 𝒏 𝒚 𝒏 = 𝒙 𝑴𝒏
ꜜM

𝑥 𝑛 = 1, −1, 2, 4, 0, 3, 2, 1, 5 for M=2

𝑥 𝑀𝑛 = 1, 2, 0, 2, 5

www.iammanuprasad.com
YouTube - IMPLearn

Spectrum of the down sampled signal

𝑀−1
1 𝑗
𝜔−2𝜋𝑘
𝑌 𝑒 𝑗𝜔 = ෍𝑋 𝑒 𝑀
𝑀
𝑘=0

• If the Fourier transform of the input-signal of a down samples in 𝑋 𝑒 𝑗𝜔 , then the


Fourier transform Y 𝑒 𝑗𝜔 of the output signal y(n) is a sum of M uniformly shifted and
stretched version of 𝑋 𝑒 𝑗𝜔 scaled by a factor of 1/M

www.iammanuprasad.com
YouTube - IMPLearn
𝜋 𝜋
Q) Consider a spectrum of input signal 𝑋 𝑒 𝑗𝜔 with a bandwidth of − to shown , when the signal is down
2 2
sampled by a factor D, sketch the spectrum of a down sampled signal for sampling rate reduction factor
D=2,3

𝟑𝝅 𝝅 𝝅 𝟑𝝅
-𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅
𝟐 𝟐 𝟐 𝟐

For M/D=2
When D=2
1
1 𝑗
𝜔−2𝜋𝑘
𝑌 𝑒 𝑗𝜔 = ෍𝑋 𝑒 2 Bandwidth =D.BW =2π
2
𝑘=0

1 𝑗
𝜔 1 𝑗
𝜔−2𝜋
𝑌 𝑒 𝑗𝜔 = 𝑋 𝑒 2 + 𝑋 𝑒 2
2 2

www.iammanuprasad.com
YouTube - IMPLearn
1 𝜔 1 𝑗
𝜔 1 𝑗
𝜔−2𝜋
𝑋 𝑒
𝑗
2 𝑌 𝑒 𝑗𝜔 = 𝑋 𝑒 2 + 𝑋 𝑒 2
2 2 2

𝟏
𝟐

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐
1 𝑗
𝜔−2𝜋
𝑋 𝑒 2
2

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 www.iammanuprasad.com
𝟐 𝟐
YouTube - IMPLearn
𝜋 𝜋
Q) Consider a spectrum of input signal 𝑋 𝑒 𝑗𝜔 with a bandwidth of − to shown , when the signal is down
2 2
sampled by a factor D, sketch the spectrum of a down sampled signal for sampling rate reduction factor
D=2,3

𝟑𝝅 𝝅 𝝅 𝟑𝝅
-𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅
𝟐 𝟐 𝟐 𝟐

For M/D=3
When D=3
2
1 𝑗
𝜔−2𝜋𝑘
𝑌 𝑒 𝑗𝜔
= ෍𝑋 𝑒 3 Bandwidth =D.BW =3π
3
𝑘=0

1 𝑗
𝜔 1 𝑗
𝜔−2𝜋 1 𝑗
𝜔−4𝜋
𝑌 𝑒 𝑗𝜔 = 𝑋 𝑒 3 + 𝑋 𝑒 3 + 𝑋 𝑒 3
3 3 3

www.iammanuprasad.com
1 𝑗
𝜔
1 𝜔 1 𝜔−2𝜋 1 𝜔−4𝜋
YouTube - IMPLearn 𝑋 𝑒 3 𝑌 𝑒 𝑗𝜔
= 𝑋 𝑒
𝑗
3 + 𝑋 𝑒
𝑗
3 + 𝑋 𝑒
𝑗
3
3 𝟏 3 3 3
𝟑

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐
1 𝑗
𝜔−2𝜋
𝑋 𝑒 3
3

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐
1 𝑗
𝜔−4𝜋
𝑋 𝑒 3
3

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 www.iammanuprasad.com
𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐
YouTube - IMPLearn

Anti-aliasing filters

• In order to avoid aliasing the input signal should be band limited to π/D for
decimation by a factor of D

Anti-aliasing
filter

𝒙 𝒏 𝒚 𝒏 = 𝒙 𝑴𝒏
h(n) ꜜM

www.iammanuprasad.com
YouTube - IMPLearn

Up sampling
• It is the process of increasing the sampling rate by an integer factor I or L
• Up sampled signal of x(n) can be obtained by a factor of L by L-1 equally
spaced zeros between each pairs of samples

𝒏
𝒙 𝒏 𝒚 𝒏 =𝒙
ꜛL 𝑳

𝑥 𝑛 = 1, 2, 3, 4, 5 for I/L=3

𝑛
𝑥 = 1, 0, 0, 2, 0, 0, 3, 0, 0, 4,0,0
𝐿

www.iammanuprasad.com
YouTube - IMPLearn

Spectrum of the up sampled signal

𝑌 𝑒 𝑗𝜔 = 𝑋 𝑒 𝑗𝜔𝐼

• The term 𝑋 𝑒 𝑗𝜔𝐼 is the frequency compressed version of 𝑋 𝑒 𝑗𝜔 by a factor I.


• If the frequency response is periodic with 2π , the 𝑋 𝑒 𝑗𝜔𝐼 will repeat I times in a period
of 0 to 2π in the spectrum of up sampled

www.iammanuprasad.com
YouTube - IMPLearn
Q) The spectrum of discrete time signal is shown below. Draw the spectrum of the signal if it is upscaled by
I=2,3

𝟕𝝅 𝟓𝝅 𝟑𝝅 𝝅 𝝅 𝟑𝝅 𝟓𝝅 𝟕𝝅
−𝟒𝝅 − −𝟑𝝅 − −𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅 𝟑𝝅 𝟒𝝅
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐

www.iammanuprasad.com
YouTube - IMPLearn
For I or L=2

𝑌 𝑒 𝑗𝜔 = 𝑋 𝑒 𝑗2𝜔

When I=2

Bandwidth =BW/I =π

𝟑𝝅 𝝅 𝝅 𝟑𝝅
-𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅
𝟐 𝟐 𝟐 𝟐

For I or L=3

𝑌 𝑒 𝑗𝜔 = 𝑋 𝑒 𝑗3𝜔
When I=3

Bandwidth =BW/I =2π/3

𝟑𝝅 𝝅 𝝅 𝟑𝝅 www.iammanuprasad.com
-𝟐𝝅 − −𝝅 − 𝟎 𝝅 𝟐𝝅
𝟐 𝟐 𝟐 𝟐
YouTube - IMPLearn

Anti-imaging filters
• When up sampled by a factor of I, the output spectrum will have I images in each
𝜋
period with each image bandwidth to
𝐼
𝜋
• Since the frequency spectrum in the range to 0 to are unique and we have to
𝐼
filter the other images
• Hence the output of up samples is passed through a lowpass filter with band
𝜋
width
𝐼
• Since the lowpass filter is designed to avoid multiple images in output spectrum ,
it also called anti-imaging filter

Anti-imaging
filter
𝒙 𝒏 𝒚 𝒏
ꜛI h(n)

www.iammanuprasad.com
YouTube - IMPLearn

Digital Signal Processors

• The programmable digital signal processors (PDSPs) are general purpose


microprocessors designed specifically for digital signal processing applications.
• They contain special architecture and instruction set to execute computation -
intensive DSP algorithms more efficiently.
• General purpose digital signal processors: These are basically high-speed
microprocessors with architecture and instruction sets optimized for DSP
operations.
• Special purpose digital signal processors: These types of processors consist of
hardware i) designed for specific DSP algorithms such as FFr, ii) hardware
designed for specific applications such as PCM and filtering.

www.iammanuprasad.com
YouTube - IMPLearn
Harvard Architecture
• The term Harvard originated from the Harvard Mark 1 relay-based computer which stored instruction on
punched tape and data in relay latches
• The Harvard architectures physically separate memories for their instructions and data, requiring dedicated
buses for each of them.
• Instructions and operands can therefore be fetched simultaneously.
• Most of the DSP processors use a modified Harvard architecture with two or three memory buses; allowing
access to filter coefficients and input signals in the same cycle.
• Since it possesses two independent bus systems, the Harvard architecture is capable of simultaneous reading an
instruction code and reading or writing a memory or peripheral as part of the execution of the previous
instruction.

www.iammanuprasad.com
YouTube - IMPLearn
Pipelining
• To improve the efficiency, advanced microprocessors and digital signal processors use an approach
called pipelining in which different phases of operation and execution of instructions are carried out
in parallel.
• In modem processors the first step of execution is performed on the first instruction, and then when
the instruction passes to the next step, a new instruction is started.
• The Fetch phase(F) in which the next instruction is fetched from the address stored in the program counter.
• The decode phase (D) in which the instruction in the instruction register is decoded and the address in the program
counter is incremented
• Memory read (R) phase reads the data from the data buses and also writes data to the data buses.
• The Execute phase (X) executes the instruction currently in the instruction register and also completes the write
process.

Instruction 1 F1 D1 R1 X1

Instruction 2 F2 D2 R2 X2

Instruction 3 F3 D3 R3 X3

Instruction 4 F4 D4 R4 X4
www.iammanuprasad.com
YouTube - IMPLearn
Multiply Accumulate Unit (MAC)
• The Multiply-Accumulate (MAC) operation is the basis of many digital signal processing algorithms
• In digital signal processing, the multiply–accumulate (MAC) operation is a common step that
computes the product of two numbers and adds that product to an accumulator.
• The hardware unit that performs the operation is known as a multiplier–accumulator (MAC unit); the
operation itself is also often called a MAC
• The MAC speed applies both to finite impulse response (FIR) and infinite impulse response (IIR)
fi1ters. The complexity of the filter response dictates the number MAC operations required per
sample period.
• A multiply-accumulate step performs the following:
• Reads a 16-bit sample data (pointed to by a register)
• Increments the sample data-pointer by 2
• Reads a. 16-bit coefficient (pointed to by another register)
• Increments the coefficient register pointer by 2
• Sign Multiply (16-bit) data and coefficient 'to yield a 32~bit resu1t
• Adds the result to the contents of a 32-bit register pair for accumulate.

www.iammanuprasad.com
YouTube - IMPLearn
TMS320C67xx - Digital Signal Processor

• The TMS320 DSP family consists of fixed-point, floating-point, and multiprocessor digital signal
processors (DSPs).
• TMS320 DSPs have an architecture designed specifically for real-time signal processing.
• With a performance of up to 6000 million instructions per second (MIPS) and an efficient C
compiler, the TMS320C6000 DSPs give system architects unlimited possibilities to differentiate
their products.
• High Performance
• Ease of use
• affordable pricing
• The C6000 devices execute up to eight 32-bit instructions per cycle. The C67x CPU consists of 32
general-purpose 32-bit registers and eight functional units.
• These eight functional units contain:
• Two multipliers
• Six ALUs

www.iammanuprasad.com
YouTube - IMPLearn
TMS320C67xx DSP
Architecture

• Central Processing Unit (CPU)


• Internal Memory
• Memory and Peripheral
Options

www.iammanuprasad.com
YouTube - IMPLearn
TMS320C67xx DSP
Architecture
• Central Processing Unit
(CPU)
• Program fetch unit
• Instruction dispatch unit
• Instruction decode unit
• Two data paths, each with four
functional units
• 32 32-bit registers
• Control registers
• Control logic
• Test, emulation, and interrupt
logic

www.iammanuprasad.com
YouTube - IMPLearn
TMS320C67xx DSP
Architecture

• DMA – Direct memory


Access
• EMIF – External Memory
interface
• Program memory/Program
cache
• Data memory /Data cache

www.iammanuprasad.com
YouTube - IMPLearn
TMS320C67xx DSP Architecture

• DMA Controller (C6701 DSP only) transfers data between address ranges in the
memory map without intervention by the CPU. The DMA controller has four
programmable channels and a fifth auxiliary channel.
• EDMA Controller performs the same functions as the DMA controller. The EDMA has 16
programmable channels, as well as a RAM space to hold multiple configurations for future transfers.
• HPI is a parallel port through which a host processor can directly access the CPU’s memory space.
The host device has ease of access because it is the master of the interface. The host and the CPU can
exchange information via internal or external memory. In addition, the host has direct access to
memory-mapped peripherals.
• Expansion bus is a replacement for the HPI, as well as an expansion of the EMIF. The expansion
provides two distinct areas of functionality (host port and I/O port) which can co-exist in a system.
The host port of the expansion bus can operate in either asynchronous slave mode, similar to the HPI,
or in synchronous master/slave mode. This allows the device to interface to a variety of host bus
protocols. Synchronous FIFOs and asynchronous peripheral I/O devices may interface to the
expansion bus.

www.iammanuprasad.com
YouTube - IMPLearn
TMS320C67xx DSP Architecture

• McBSP (multichannel buffered serial port) is based on the standard serial port interface found on the
TMS320C2000 and TMS320C5000 devices. In addition, the port can buffer serial samples in
memory automatically with the aid of the DMA/EDNA controller. It also has multichannel capability
compatible with the T1, E1, SCSA, and MVIP networking standards.
• Timers in the C6000 devices are two 32-bit general-purpose timers used for these functions:
• Time events
• Count events
• Generate pulses
• Interrupt the CPU
• Send synchronization events to the DMA/EDMA controller.
• Power-down logic allows reduced clocking to reduce power consumption. Most of the operating
power of CMOS logic dissipates during circuit switching from one logic state to another. By
preventing some or all of the chip’s logic from switching, you can realize significant power savings
without losing any data or operational context.

www.iammanuprasad.com
YouTube - IMPLearn
Finite Word length Effects

• In the design of FIR Filters, the filter coefficients are determined by the system
transfer functions. These filters co-efficient are quantized/truncated while
implementing DSP System because of finite length registers.
• Only Finite numbers of bits are used to perform arithmetic operations. Typical word
length is 16 bits, 24 bits, 32 bits etc.
• This finite word length introduces an error which can affect the performance of the
DSP system.
• Input quantization error
• Co-efficient quantization error
• Overflow & round off error (Product Quantization error)

www.iammanuprasad.com
YouTube - IMPLearn
Quantization Error

• The effect of error introduced by a signal process depend upon number of factors including the.
• Type of arithmetic
• Quality of input signal
• Type of algorithm implemented
• For any system, during its functioning, there is always a difference in the values of its input and
output. The processing of the system results in an error, which is the difference of those values. The
difference between an input value and its quantized value is called a Quantization Error.

www.iammanuprasad.com
YouTube - IMPLearn
Input quantization error

• The conversion of continuous-time input signal into digital value produces an error which is known
as input quantization error. This error arises due to the representation of the input signal by a fixed
number of digits in A/D conversion process

𝑒 𝑛 = 𝑥𝑞 𝑛 − 𝑥 𝑛

𝑥𝑞 𝑛 → 𝑠𝑎𝑚𝑝𝑙𝑒 𝑞𝑢𝑎𝑡𝑖𝑠𝑒𝑑 𝑣𝑎𝑙𝑢𝑒


𝑥 𝑛 → 𝑖𝑛𝑝𝑢𝑡 𝑣𝑎𝑙𝑢𝑒

www.iammanuprasad.com
YouTube - IMPLearn
Product Quantization error

• In fixed point arithmetic the product of two b-bit numbers results in 2b bits long. In DSP applications
it is necessary to round this product to b-bit number which produce an error known as product
quantization error or product round off noise

𝑥𝑞 𝑛 𝑦 𝑛 = 𝑎𝑥𝑞 𝑛 + 𝑒 𝑛
𝒂

𝑒 𝑛
• The multiplication is modelled as an infinite precision multiplier followed by an adder where round
off noise is added to the product so that overall result equals some quantization level

www.iammanuprasad.com
YouTube - IMPLearn
Coefficient quantization error

• In the design of a digital filter the coefficients are evaluated with infinite precision.
• But when they are quantized, the frequency response of the actual filter deviates
from that which would have been obtained with an infinite word length
representation and the filter may actually fail to meet the desired specifications.
• If the poles of the desired filter are close to the unit circle, then those of the filter
with quantized coefficients my lie just outside the unit circle

www.iammanuprasad.com
YouTube - IMPLearn
Coefficient quantization error
• Consider a second order IIR filter with

www.iammanuprasad.com

You might also like