Professional Documents
Culture Documents
Ece Filter Design
Ece Filter Design
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 1
News
Homework #9
Due on Thursday
Submit via canvas
Coding Assignment #6
Due on next Monday
Submit via canvas
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 2
News
Exam #2 – Great Job!
Mean: 86.3
Median: 87.5
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 3
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 4
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What condition must be satisfied?
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 5
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What condition must be satisfied?
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 6
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response?
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 7
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
Odd Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 + ⋯ − 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 8
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
Odd Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 + ⋯ − 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
2 −1
1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 + ⋯ − 𝑎𝑎1𝑧𝑧 2 − 𝑎𝑎0𝑧𝑧 2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 9
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒 jΘ 𝜔𝜔
Odd Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 + ⋯ − 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
2 −1
1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 + ⋯ − 𝑎𝑎1𝑧𝑧 2 − 𝑎𝑎0𝑧𝑧 2
𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒 jΘ 𝜔𝜔
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 10
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
0 for 𝐺𝐺 𝜔𝜔 > 0
𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒 jΘ 𝜔𝜔 Θ 𝜔𝜔 = �
𝜋𝜋 for 𝐺𝐺 𝜔𝜔 < 0
Odd Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 + ⋯ − 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
2 −1
1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 + ⋯ − 𝑎𝑎1𝑧𝑧 2 − 𝑎𝑎0𝑧𝑧 2
0 for 𝐺𝐺 𝜔𝜔 > 0
𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒 jΘ 𝜔𝜔 Θ 𝜔𝜔 = �
𝜋𝜋 for 𝐺𝐺 𝜔𝜔 < 0
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 11
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 13
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
𝑀𝑀/2−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
= 𝑧𝑧 −
2 � 𝑎𝑎𝑘𝑘 𝑧𝑧 2 −𝑘𝑘 + 𝑧𝑧 2 − 𝑘𝑘
𝑘𝑘=0
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 14
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
𝑀𝑀/2−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
= 𝑧𝑧 −
2 � 𝑎𝑎𝑘𝑘 𝑧𝑧 2 −𝑘𝑘 + 𝑧𝑧 2 − 𝑘𝑘
𝑘𝑘=0
Notice that
𝑋𝑋 𝑧𝑧 = 𝑧𝑧 − 𝑀𝑀−1 𝑋𝑋 𝑧𝑧 −1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 15
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
𝑀𝑀/2−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
= 𝑧𝑧 −
2 � 𝑎𝑎𝑘𝑘 𝑧𝑧 2 −𝑘𝑘 + 𝑧𝑧 2 − 𝑘𝑘
𝑘𝑘=0
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 16
Causality and Linear Phase
Question: Consider a length-M symmetric, causal filter.
What is the phase response? Assume M is even.
Even Symmetry
𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧 −1 + 𝑎𝑎2𝑧𝑧 −2 + ⋯ + 𝑎𝑎1𝑧𝑧 − 𝑀𝑀−2 + 𝑎𝑎0𝑧𝑧 − 𝑀𝑀−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− −1 1− −
= 𝑧𝑧 2 𝑎𝑎0𝑧𝑧 2 + 𝑎𝑎1𝑧𝑧 2 + ⋯ + 𝑎𝑎1𝑧𝑧 2 + 𝑎𝑎0𝑧𝑧 2
𝑀𝑀/2−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−
= 𝑧𝑧 −
2 � 𝑎𝑎𝑘𝑘 𝑧𝑧 2 −𝑘𝑘 + 𝑧𝑧 2 − 𝑘𝑘
𝑘𝑘=0
o o
o o
x x(M-1)
Pole-zero plot property? o o
𝑋𝑋 𝑧𝑧 = 𝑧𝑧 − 𝑀𝑀−1 𝑋𝑋 𝑧𝑧 −1
o o
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 17
Causality
Question: How do we describe causal filter magnitude?
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 18
Causality
Question: How do we describe causal filter magnitude?
Often plotted
in dB (decibels)
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 19
Causality
Question: How do we describe causal filter magnitude?
Often plotted
in dB (decibels)
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 20
Lecture 21: Design of FIR Filters
Foundations of Digital Signal Processing
Outline
• Review Downsampling & Upsampling
• Causality in Filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 21
Designing with Windows
Question: How can I design an FIR filter from an ideal filter?
… …
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 22
Designing with Windows
Question: How can I design an FIR filter from an ideal filter?
… …
ℱ
Non-causal Ideal filter
Infinite Response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 23
Designing with Windows
Question: How can I design an FIR filter from an ideal filter?
… …
ℱ
Non-causal Ideal filter
Infinite Response
… …
ℱ
Non-causal Ideal filter
Infinite Response
… …
ℱ
Non-causal Ideal filter
Infinite Response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 27
Designing with Windows
Different Filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 28
Designing with Windows
Different Filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 29
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 30
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 31
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 32
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 33
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 34
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 35
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 36
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 37
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 38
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 39
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 40
Designing with Windows
Windowing the sinc impulse response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 41
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 42
Design with Frequency Sampling
Option 2: Work backwards with constraints
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 43
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘= 𝑁𝑁+1 /2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 44
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 45
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 𝑁𝑁 + 𝐻𝐻 𝑘𝑘 𝑒𝑒 𝑁𝑁
𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 46
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑛𝑛𝑛𝑛
2𝜋𝜋
−𝑗𝑗 𝑛𝑛𝑛𝑛 𝑗𝑗𝑗𝑗𝑗𝑗𝑗
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 𝑁𝑁 + 𝐻𝐻 𝑘𝑘 𝑒𝑒 𝑁𝑁 𝑒𝑒
𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 47
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
−𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 48
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑛𝑛𝑛𝑛
2𝜋𝜋
−𝑗𝑗 𝑛𝑛𝑛𝑛
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 𝑁𝑁 + 𝑒𝑒 𝑁𝑁
𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 49
Design with Frequency Sampling
Option 2: Work backwards with constraints
𝑁𝑁−1 /2 𝑁𝑁−1 /2
1 2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛𝑛𝑛
2𝜋𝜋
𝑗𝑗 𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘
ℎ 𝑛𝑛 = 𝐻𝐻 0 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒 + � 𝐻𝐻 𝑘𝑘 𝑒𝑒
𝑁𝑁
𝑘𝑘=1 𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛𝑛𝑛
𝑁𝑁 𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 50
Design with Frequency Sampling
An inverse DFT that forces time-symmetry
𝑁𝑁−1 /2
1 2𝜋𝜋
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛𝑛𝑛
𝑁𝑁 𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 51
Design with Frequency Sampling
An inverse DFT that forces time-symmetry
𝑁𝑁−1 /2
1 2𝜋𝜋
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛𝑛𝑛
𝑁𝑁 𝑁𝑁
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 52
Design with Frequency Sampling
An inverse DFT that forces time-symmetry
𝑁𝑁−1 /2
1 2𝜋𝜋
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛𝑛𝑛
𝑁𝑁 𝑁𝑁
𝑘𝑘=1
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/9 𝑛𝑛
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 53
Design with Frequency Sampling
Example: Consider the desired 9-sample frequency response
with the first half defined by [1 1 0 0]
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/9 𝑛𝑛
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 54
Design with Frequency Sampling
Example: Consider the desired 9-sample frequency response
with the first half defined by [1 1 0 0]
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/9 𝑛𝑛
2
In practice, this should be circularly shifted so that the
maximum is centered.
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 55
Design with Frequency Sampling
An inverse DFT that forces time-symmetry
𝑁𝑁−1 /2
1 2𝜋𝜋 𝑁𝑁 − 1
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛 − 𝑘𝑘
𝑁𝑁 𝑁𝑁 2
𝑘𝑘=1
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/9 𝑛𝑛
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 56
Design with Frequency Sampling
Example: Consider the desired 9-sample frequency response
with the first half defined by [1 1 0 0]
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/9 𝑛𝑛 − 8/2
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 57
Design with Frequency Sampling
Example: Consider the desired 17-sample frequency response
with the first half defined by [1 1 1 1 0 0 0 0]
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 4𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 6𝜋𝜋/19 𝑛𝑛𝑐𝑐
17
16
𝑛𝑛𝑐𝑐 = 𝑛𝑛 −
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 58
Design with Frequency Sampling
Example: Consider the desired 17-sample frequency response
with the first half defined by [1 1 1 1 0 0 0 0]
1
ℎ 𝑛𝑛 = 1 + 2 cos 2𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 4𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 6𝜋𝜋/19 𝑛𝑛𝑐𝑐
17
16
𝑛𝑛𝑐𝑐 = 𝑛𝑛 −
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 59
Design with Frequency Sampling
Example: Consider the desired 41-sample frequency response
with the first 10 values defined by 1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 60
Design with Frequency Sampling
Example: Consider the desired 401-sample frequency response
with the first 100 values defined by 1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 61
Design with Frequency Sampling
Note: The definition can be slightly modified
Our definition:
𝑁𝑁−1 /2
1 2𝜋𝜋 𝑁𝑁 − 1
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛 − 𝑘𝑘
𝑁𝑁 𝑁𝑁 2
𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋 𝑁𝑁 1
= 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛 − + 𝑘𝑘
𝑁𝑁 𝑁𝑁 2 2
𝑘𝑘=1
𝑁𝑁−1 /2
1 2𝜋𝜋 1
= 𝐻𝐻 0 + 2 � 𝐻𝐻 𝑘𝑘 cos 𝑛𝑛 + 𝑘𝑘 − 𝜋𝜋𝜋𝜋
𝑁𝑁 𝑁𝑁 2
𝑘𝑘=1
𝑁𝑁−1 /2
1 𝑘𝑘 𝐻𝐻
2𝜋𝜋 1
= 𝐻𝐻 0 + 2 � −1 𝑘𝑘 cos 𝑛𝑛 + 𝑘𝑘
𝑁𝑁 𝑁𝑁 2
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 62
Design with Frequency Sampling
Final Definition
𝑁𝑁−1 /2
1 𝑘𝑘 𝐻𝐻
2𝜋𝜋 1
ℎ 𝑛𝑛 = 𝐻𝐻 0 + 2 � −1 𝑘𝑘 cos 𝑛𝑛 + 𝑘𝑘
𝑁𝑁 𝑁𝑁 2
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 63
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 64
Design with Equi-ripples
Previously derived:
𝑀𝑀/2−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
− 2 − 2 − 𝑘𝑘
𝑋𝑋 𝑧𝑧 = 𝑧𝑧 � 𝑎𝑎𝑘𝑘 𝑧𝑧 2 −𝑘𝑘 + 𝑧𝑧
𝑘𝑘=0
𝑀𝑀/2−1
𝑀𝑀−1 𝑀𝑀−1 𝑀𝑀−1
−𝑗𝑗𝑗𝑗 2 𝑗𝑗𝑗𝑗 2 −𝑘𝑘 −𝑗𝑗𝑗𝑗 2 − 𝑘𝑘
𝑋𝑋 𝜔𝜔 = 𝑒𝑒 � 𝑎𝑎𝑘𝑘 𝑒𝑒 + 𝑗𝑗𝑗𝑗
𝑘𝑘=0
𝑀𝑀/2−1
−𝑗𝑗𝑗𝑗
𝑀𝑀−1 𝑀𝑀 − 1
= 2𝑒𝑒 2 � 𝑎𝑎𝑘𝑘 cos 𝜔𝜔 − 𝑘𝑘
2
𝑘𝑘=0
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 65
Design with Equi-ripples
Equi-ripple design
𝑀𝑀/2−1
𝑀𝑀−1
−𝑗𝑗𝑗𝑗 2 𝑀𝑀 − 1
𝑋𝑋 𝜔𝜔 = 2𝑒𝑒 � 𝑎𝑎𝑘𝑘 cos 𝜔𝜔 − 𝑘𝑘
2
𝑘𝑘=0
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 66
Design with Equi-ripples
Equi-ripple design
𝑀𝑀/2−1
−𝑗𝑗𝑗𝑗
𝑀𝑀−1 𝑀𝑀 − 1
min 𝑊𝑊 𝜔𝜔 𝐻𝐻𝑑𝑑 𝜔𝜔 − 2𝑒𝑒 2 � 𝑎𝑎𝑘𝑘 cos 𝜔𝜔 − 𝑘𝑘
𝑎𝑎𝑘𝑘 2
𝑘𝑘=0
Desired frequency
response
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 67
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 68
IIR Filter Design from Derivatives
Designing IIR Filters
No easy ways to design digital IIR filters
So let us start from analog filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 69
IIR Filter Design from Derivatives
Designing IIR Filters
No easy ways to design digital IIR filters
So let us start from analog filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 70
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
In continuous-time
𝑑𝑑𝑑𝑑 𝑡𝑡
→ 𝑠𝑠𝑠𝑠 𝑠𝑠
𝑑𝑑𝑑𝑑
In discrete-time
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 71
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
In continuous-time
𝑑𝑑𝑑𝑑 𝑡𝑡
→ 𝑠𝑠𝑠𝑠 𝑠𝑠
𝑑𝑑𝑑𝑑
In discrete-time
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑡𝑡 − 𝑥𝑥 𝑡𝑡 − Δ𝑇𝑇 T=1
= lim
𝑑𝑑𝑑𝑑 Δ𝑇𝑇→0 Δ𝑇𝑇
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇
� = = 𝑥𝑥 𝑛𝑛 − 𝑥𝑥 𝑛𝑛 − 1
𝑑𝑑𝑑𝑑 𝑡𝑡=𝑛𝑛𝑛𝑛 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 72
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
In continuous-time
𝑑𝑑𝑑𝑑 𝑡𝑡
→ 𝑠𝑠𝑠𝑠 𝑠𝑠
𝑑𝑑𝑑𝑑
In discrete-time
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑡𝑡 − 𝑥𝑥 𝑡𝑡 − Δ𝑇𝑇
= lim
𝑑𝑑𝑑𝑑 Δ𝑇𝑇→0 Δ𝑇𝑇
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇 1
� = = 𝑥𝑥 𝑛𝑛 − 𝑥𝑥 𝑛𝑛 − 1
𝑑𝑑𝑑𝑑 𝑡𝑡=𝑛𝑛𝑛𝑛 𝑇𝑇 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 73
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
In continuous-time
𝑑𝑑𝑑𝑑 𝑡𝑡
→ 𝑠𝑠𝑠𝑠 𝑠𝑠
𝑑𝑑𝑑𝑑
In discrete-time
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑡𝑡 − 𝑥𝑥 𝑡𝑡 − Δ𝑇𝑇
= lim
𝑑𝑑𝑑𝑑 Δ𝑇𝑇→0 Δ𝑇𝑇
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇 1
� = = 𝑥𝑥 𝑛𝑛 − 𝑥𝑥 𝑛𝑛 − 1
𝑑𝑑𝑑𝑑 𝑡𝑡=𝑛𝑛𝑛𝑛 𝑇𝑇 𝑇𝑇
𝑑𝑑𝑑𝑑 𝑡𝑡 1
� → 1 − 𝑧𝑧 −1 𝑋𝑋 𝑧𝑧
𝑑𝑑𝑑𝑑 𝑡𝑡=𝑛𝑛𝑛𝑛 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 74
IIR Filter Design from Derivatives
Question: What is a second-derivative in discrete-time?
In continuous-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 2
2
→ 𝑠𝑠 𝑋𝑋 𝑠𝑠
𝑑𝑑𝑡𝑡
In discrete-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡
2
=
𝑑𝑑𝑡𝑡 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇
� =
𝑑𝑑𝑑𝑑 𝑡𝑡=𝑛𝑛𝑛𝑛 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 75
IIR Filter Design from Derivatives
Question: What is a second-derivative in discrete-time?
In continuous-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 2
2
→ 𝑠𝑠 𝑋𝑋 𝑠𝑠
𝑑𝑑𝑡𝑡
In discrete-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡
2
=
𝑑𝑑𝑡𝑡 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇 /𝑇𝑇 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇 − 𝑥𝑥 𝑛𝑛𝑛𝑛 − 2𝑇𝑇 /𝑇𝑇
2
� =
𝑑𝑑𝑡𝑡 𝑇𝑇
𝑡𝑡=𝑛𝑛𝑛𝑛
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 76
IIR Filter Design from Derivatives
Question: What is a second-derivative in discrete-time?
In continuous-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 2
2
→ 𝑠𝑠 𝑋𝑋 𝑠𝑠
𝑑𝑑𝑡𝑡
In discrete-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡
2
=
𝑑𝑑𝑡𝑡 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑇𝑇 − 2𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇 + 𝑥𝑥 𝑛𝑛𝑛𝑛 − 2𝑇𝑇 𝑥𝑥 𝑛𝑛 − 2𝑥𝑥 𝑛𝑛 − 1 + 𝑥𝑥 𝑛𝑛 − 2
� = →
𝑑𝑑𝑡𝑡 2 𝑇𝑇2 𝑇𝑇2
𝑡𝑡=𝑛𝑛𝑛𝑛
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 77
IIR Filter Design from Derivatives
Question: What is a second-derivative in discrete-time?
In continuous-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 2
2
→ 𝑠𝑠 𝑋𝑋 𝑠𝑠
𝑑𝑑𝑡𝑡
In discrete-time
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡 𝑑𝑑𝑑𝑑 𝑡𝑡
2
=
𝑑𝑑𝑡𝑡 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑑𝑑2𝑥𝑥 𝑡𝑡 𝑥𝑥 𝑛𝑛𝑇𝑇 − 2𝑥𝑥 𝑛𝑛𝑛𝑛 − 𝑇𝑇 + 𝑥𝑥 𝑛𝑛𝑛𝑛 − 2𝑇𝑇 𝑥𝑥 𝑛𝑛 − 2𝑥𝑥 𝑛𝑛 − 1 + 𝑥𝑥 𝑛𝑛 − 2
� = →
𝑑𝑑𝑡𝑡 2 𝑇𝑇2 𝑇𝑇2
𝑡𝑡=𝑛𝑛𝑛𝑛
𝑑𝑑𝑑𝑑 𝑡𝑡 1 1
� → 2 1 − 2𝑧𝑧 + 𝑧𝑧 𝑋𝑋 𝑧𝑧 = 2 1 − 𝑧𝑧−1 2𝑋𝑋 𝑧𝑧
−1 −2
𝑑𝑑𝑑𝑑 𝑡𝑡=𝑛𝑛𝑛𝑛 𝑇𝑇 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 78
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
Translate continuous-time to discrete-time
𝑑𝑑𝑘𝑘 𝑥𝑥 𝑡𝑡 𝑘𝑘 𝑋𝑋 𝑠𝑠
→ 𝑠𝑠
𝑑𝑑𝑡𝑡𝑘𝑘
𝑑𝑑𝑘𝑘 𝑥𝑥 𝑡𝑡 1 −1 𝑘𝑘 𝑋𝑋 𝑧𝑧
� → 1 − 𝑧𝑧
𝑑𝑑𝑡𝑡𝑘𝑘 𝑇𝑇
𝑡𝑡=𝑛𝑛𝑛𝑛
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 79
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
Translate continuous-time to discrete-time
𝑑𝑑𝑘𝑘 𝑥𝑥 𝑡𝑡 𝑘𝑘 𝑋𝑋 𝑠𝑠
→ 𝑠𝑠
𝑑𝑑𝑡𝑡𝑘𝑘
𝑑𝑑𝑘𝑘 𝑥𝑥 𝑡𝑡 1 −1 𝑘𝑘 𝑋𝑋 𝑧𝑧
� → 1 − 𝑧𝑧
𝑑𝑑𝑡𝑡𝑘𝑘 𝑇𝑇
𝑡𝑡=𝑛𝑛𝑛𝑛
1
𝑠𝑠 → 1 − 𝑧𝑧−1
𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 80
IIR Filter Design from Derivatives
1
Example: 𝑠𝑠 → 1 − 𝑧𝑧 −1
𝑇𝑇
Use the derivative conversion to transform the following biquad
filter into the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 81
IIR Filter Design from Derivatives
1
Example: 𝑠𝑠 → 1 − 𝑧𝑧 −1
𝑇𝑇
Use the derivative conversion to transform the following bi-quad
filter into the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
1 𝑇𝑇2
𝐻𝐻 𝑧𝑧 = 2 = 2
1 1
1 − 𝑧𝑧−1 + 0.1 +9 𝑇𝑇2 1 − 𝑧𝑧−1 + 0.1 +9
𝑇𝑇 𝑇𝑇
𝑇𝑇2 𝑇𝑇2
= 2 = 2
1 − 𝑧𝑧−1 + 0.1𝑇𝑇 + 9𝑇𝑇2 1 + 0.1𝑇𝑇 − 𝑧𝑧 −1 + 9𝑇𝑇2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 82
IIR Filter Design from Derivatives
1
Example: 𝑠𝑠 → 1 − 𝑧𝑧 −1
𝑇𝑇
Use the derivative conversion to transform the following bi-quad
filter into the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
𝑇𝑇2 Finding poles
𝐻𝐻 𝑧𝑧 = 2
1 + 0.1𝑇𝑇 − 𝑧𝑧−1 + 9𝑇𝑇2
−1 2
1 + 0.1𝑇𝑇 − 𝑧𝑧 + 9𝑇𝑇2 = 0
−1 2
1 + 0.1𝑇𝑇 − 𝑧𝑧 = −9𝑇𝑇2
1 + 0.1𝑇𝑇 − 𝑧𝑧 −1 = ±3𝑇𝑇𝑇𝑇
1
𝑧𝑧−1 = 1 + 0.1𝑇𝑇 ∓ 3𝑇𝑇𝑇𝑇 𝑧𝑧 =
1 + 0.1 ∓ 3𝑗𝑗 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 83
IIR Filter Design from Derivatives
1
Example: 𝑠𝑠 → 1 − 𝑧𝑧 −1
𝑇𝑇
Use the derivative conversion to transform the following bi-quad
filter into the discrete-time domain.
1
𝑧𝑧 = Poles
1 + 0.1 + 3𝑗𝑗 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 84
IIR Filter Design from Derivatives
1
Example: 𝑠𝑠 → 1 − 𝑧𝑧 −1
𝑇𝑇
1
𝑧𝑧 =
1 + 0.1 + 3𝑗𝑗 𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 85
IIR Filter Design from Derivatives
Question: What is a derivative in discrete-time?
Translate continuous-time to discrete-time
1
𝑠𝑠 → 1 − 𝑧𝑧−1
𝑇𝑇
Stable IIR
analog filters
Pros: map here
Relatively simple
Cons:
Very limiting 1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 86
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 87
IIR Filter Design by Impulse Invariance
Designing IIR Filters
No easy ways to design digital IIR filters
So let us start from analog filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 88
IIR Filter Design by Impulse Invariance
Question: How else can I represent my transfer function?
𝐾𝐾
1
𝐻𝐻 𝑠𝑠 = �
𝑠𝑠 − 𝑝𝑝𝑘𝑘
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 89
IIR Filter Design by Impulse Invariance
Question: How else can I represent my transfer function?
𝐾𝐾 𝐾𝐾
1
𝐻𝐻 𝑠𝑠 = � = � 𝑐𝑐𝑘𝑘 𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡
𝑠𝑠 − 𝑝𝑝𝑘𝑘
𝑘𝑘=1 𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 90
IIR Filter Design by Impulse Invariance
Question: How else can I represent my transfer function?
𝐾𝐾 𝐾𝐾
1
𝐻𝐻 𝑠𝑠 = � = � 𝑐𝑐𝑘𝑘 𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡
𝑠𝑠 − 𝑝𝑝𝑘𝑘
𝑘𝑘=1 𝑘𝑘=1
𝐾𝐾
ℎ 𝑡𝑡 = � 𝑐𝑐𝑘𝑘 𝑒𝑒 𝑝𝑝𝑘𝑘𝑡𝑡
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 91
IIR Filter Design by Impulse Invariance
Question: How else can I represent my transfer function?
𝐾𝐾 𝐾𝐾
1
𝐻𝐻 𝑠𝑠 = � = � 𝑐𝑐𝑘𝑘 𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡
𝑠𝑠 − 𝑝𝑝𝑘𝑘
𝑘𝑘=1 𝑘𝑘=1
𝐾𝐾
ℎ 𝑡𝑡 = � 𝑐𝑐𝑘𝑘 𝑒𝑒 𝑝𝑝𝑘𝑘𝑡𝑡
𝑘𝑘=1
𝐾𝐾 𝐾𝐾
𝑘𝑘=1 𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 92
IIR Filter Design by Impulse Invariance
Question: How else can I represent my transfer function?
𝐾𝐾 𝐾𝐾
1
𝐻𝐻 𝑠𝑠 = � = � 𝑐𝑐𝑘𝑘 𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡
𝑠𝑠 − 𝑝𝑝𝑘𝑘
𝑘𝑘=1 𝑘𝑘=1
𝐾𝐾
ℎ 𝑡𝑡 = � 𝑐𝑐𝑘𝑘 𝑒𝑒 𝑝𝑝𝑘𝑘𝑡𝑡
𝑘𝑘=1
𝐾𝐾 𝐾𝐾
𝑘𝑘=1 𝑘𝑘=1
𝐾𝐾
𝑐𝑐𝑘𝑘
𝐻𝐻 𝑧𝑧 = �
1 − 𝑒𝑒 𝑝𝑝𝑘𝑘𝑇𝑇 𝑧𝑧 −1
𝑘𝑘=1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 93
IIR Filter Design from Derivatives
𝐾𝐾 𝑐𝑐𝑘𝑘
Example: 𝐻𝐻 𝑧𝑧 = ∑𝑘𝑘=1
1−𝑒𝑒 𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1
Use impulse invariance to transform the following biquad filter into
the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 94
IIR Filter Design from Derivatives
𝐾𝐾 𝑐𝑐𝑘𝑘
Example: 𝐻𝐻 𝑧𝑧 = ∑𝑘𝑘=1
1−𝑒𝑒 𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1
Use impulse invariance to transform the following biquad filter into
the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
Poles:
𝑠𝑠 + 0.1 2 +9=0
𝑠𝑠 = ±3𝑗𝑗 − 0.1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 95
IIR Filter Design from Derivatives
𝐾𝐾 𝑐𝑐𝑘𝑘
Example: 𝐻𝐻 𝑧𝑧 = ∑𝑘𝑘=1
1−𝑒𝑒 𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1
Use impulse invariance to transform the following biquad filter into
the discrete-time domain.
1 1/2 1/2
𝐻𝐻 𝑠𝑠 = 2
= +
𝑠𝑠 + 0.1 + 9 𝑠𝑠 + 3𝑗𝑗 + 0.1 𝑠𝑠 − 3𝑗𝑗 + 0.1
Poles:
2
𝑠𝑠 + 0.1 +9=0
𝑠𝑠 = ±3𝑗𝑗 − 0.1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 96
IIR Filter Design from Derivatives
𝐾𝐾 𝑐𝑐𝑘𝑘
Example: 𝐻𝐻 𝑧𝑧 = ∑𝑘𝑘=1
1−𝑒𝑒 𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1
Use impulse invariance to transform the following biquad filter into
the discrete-time domain.
1 1/2 1/2
𝐻𝐻 𝑠𝑠 = 2
= +
𝑠𝑠 + 0.1 + 9 𝑠𝑠 + 3𝑗𝑗 + 0.1 𝑠𝑠 − 3𝑗𝑗 + 0.1
1/2 1/2
𝐻𝐻 𝑧𝑧 = −3𝑗𝑗−0.1 𝑇𝑇 −1
+
1 − 𝑒𝑒 𝑧𝑧 1 − 𝑒𝑒 3𝑗𝑗−0.1 𝑇𝑇 𝑧𝑧 −1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 97
IIR Filter Design from Derivatives
𝐾𝐾 𝑐𝑐𝑘𝑘
Example: 𝐻𝐻 𝑧𝑧 = ∑𝑘𝑘=1
1−𝑒𝑒 𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1
1/2
𝐻𝐻 𝑧𝑧 = −3𝑗𝑗−0.1 𝑇𝑇 𝑧𝑧 −1
1 − 𝑒𝑒
1/2
+ 3𝑗𝑗−0.1 𝑇𝑇 𝑧𝑧 −1
1 − 𝑒𝑒
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 98
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 99
IIR Filter Design by Bilinear Transform
Designing IIR Filters
No easy ways to design digital IIR filters
So let us start from analog filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 100
IIR Filter Design by Bilinear Transform
Question: How are z and s related?
From continuous-time to discrete-time
𝑠𝑠 = 𝑗𝑗Ω Taylor Series
𝑒𝑒 𝑠𝑠𝑠𝑠 = 𝑒𝑒 𝑠𝑠𝑛𝑛𝑛𝑛 = 𝑧𝑧𝑛𝑛 Expansion / Approximation
𝑧𝑧 = 𝑒𝑒 𝑠𝑠𝑠𝑠
Building an approximation (𝑒𝑒 𝑥𝑥 ≈ 1 + 𝑥𝑥)
𝑠𝑠𝑇𝑇
𝑒𝑒 2 1 + 𝑠𝑠𝑠𝑠/2
𝑧𝑧 = 𝑠𝑠𝑇𝑇 ≈
−2 1 − 𝑠𝑠𝑠𝑠/2
𝑒𝑒
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 101
IIR Filter Design by Bilinear Transform
Question: How are z and s related?
From continuous-time to discrete-time
𝑠𝑠 = 𝑗𝑗Ω
𝑒𝑒 𝑠𝑠𝑠𝑠 = 𝑒𝑒 𝑠𝑠𝑛𝑛𝑛𝑛 = 𝑧𝑧𝑛𝑛 Bilinear
1 Expansion / Approximation
𝑧𝑧 = 𝑒𝑒 𝑠𝑠𝑠𝑠 𝑠𝑠 = ln 𝑧𝑧
𝑇𝑇
Building an approximation
2 𝑧𝑧 − 1
𝑠𝑠 ≈
𝑇𝑇 𝑧𝑧 + 1
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 102
IIR Filter Design by Bilinear Transform
The Bilinear Transform
Continuous-time to discrete-time
2 1 − 𝑧𝑧 −1
𝑠𝑠 →
𝑇𝑇 1 + 𝑧𝑧 −1
Discrete-time to continuous-time
1 + 𝑠𝑠𝑠𝑠/2
𝑧𝑧 →
1 − 𝑠𝑠𝑠𝑠/2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 103
IIR Filter Design by Bilinear Transform
2 1−𝑧𝑧−1 1+𝑠𝑠𝑠𝑠/2
Example: 𝑠𝑠 → , 𝑧𝑧 →
𝑇𝑇 1+𝑧𝑧−1 1−𝑠𝑠𝑠𝑠/2
Use the bilinear transform to transform the following biquad filter
into the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 104
IIR Filter Design by Bilinear Transform
2 1−𝑧𝑧−1 1+𝑠𝑠𝑠𝑠/2
Example: 𝑠𝑠 → , 𝑧𝑧 →
𝑇𝑇 1+𝑧𝑧−1 1−𝑠𝑠𝑠𝑠/2
Use the bilinear transform to transform the following biquad filter
into the discrete-time domain.
1
𝐻𝐻 𝑠𝑠 =
𝑠𝑠 + 0.1 2 + 9
1
𝐻𝐻 𝑧𝑧 = 2
2 1 − 𝑧𝑧−1
+ 0.1 +9
𝑇𝑇 1 + 𝑧𝑧−1
1 + 𝑧𝑧−1 2
= 2
2
1 − 𝑧𝑧−1 + 0.1 + 9 1 + 𝑧𝑧−1 2
𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 105
IIR Filter Design by Bilinear Transform
2 1−𝑧𝑧−1 1+𝑠𝑠𝑠𝑠/2
Example: 𝑠𝑠 → , 𝑧𝑧 →
𝑇𝑇 1+𝑧𝑧−1 1−𝑠𝑠𝑠𝑠/2
1 + 𝑧𝑧−1 2
𝐻𝐻 𝑧𝑧 = 2
2
1 − 𝑧𝑧−1 + 0.1 + 9 1 + 𝑧𝑧−1 2
𝑇𝑇
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 106
Lecture 22: Design of FIR / IIR Filters
Foundations of Digital Signal Processing
Outline
• Designing FIR Filters with Windows
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 107
Multi-pole Filters
Butterworth: Maximally flat passband
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Frequency [Hz]
10
0
Phase Response
-10
-20
-30
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Frequency [Hz]
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 108
Butterworth Filter
Butterworth Filter of order N
1 𝑗𝑗 2𝑘𝑘+𝑁𝑁−1 𝜋𝜋
𝐻𝐻 𝑗𝑗𝑗𝑗 =
∑𝑁𝑁
𝑘𝑘=1 𝑠𝑠 − 𝑠𝑠𝑘𝑘 𝑠𝑠𝑘𝑘 = 𝑒𝑒 2𝑁𝑁
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 109
Butterworth Filter
Butterworth Filter of order N
N equally spaced poles on a circle on the left-hand-side of the s-
plane
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 110
Butterworth Filter
Properties of the Butterworth Filter
It is maximally flat at 𝜔𝜔 = 0
1
It has a cutoff frequency 𝐻𝐻 𝜔𝜔 = at 𝜔𝜔 = 𝜔𝜔𝑐𝑐
2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 111
Chebyshev Filter
Chebyshev Filter of order N
1
𝐻𝐻 𝑗𝑗𝑗𝑗 =
1 + 𝜖𝜖 2 𝐶𝐶𝑛𝑛2 𝜔𝜔
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 112
Chebyshev Filter
Chebyshev Filter of order N
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 113
Chebyshev Filter
Properties of the Chebyshev Filter
It has ripples in the passband and is smooth in the stopband.
The ratio between the maximum and minimum ripples in the
passband is
(1 + 𝜖𝜖 2) − 1/2
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 114
Elliptic Filter
Elliptic Filter of order N
1
𝐻𝐻 𝑗𝑗𝑗𝑗 =
1 + 𝜖𝜖 2 𝑅𝑅𝑛𝑛2 𝜔𝜔
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 115
Elliptic Filter
Elliptic Filter of order N
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 116
Elliptic Filter
Properties of the Elliptic Filter
It has ripples in the passband and the stopband
The ratio between the maximum and minimum ripples is larger
than the Chebyshev filter, but it has an even quicker transition
from passband to stopband
It has poles and zeros, but they are much more difficult to compute
compared with the Butterworth and Chebyshev filters
Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 117