117
Lecture 22: Designing FIR / IIR Filters Foundations of Digital Signal Processing Outline Designing FIR Filters with Windows Designing FIR Filters with Frequency Selection Designing FIR Filters with Equi-ripples Designing IIR Filters with Discrete Differentiation Designing IIR Filters with Impulse Invariance Designing IIR Filters with the Bilinear Transform Related Analog Filters Lecture 22: Design of FIR / IIR Filters Foundations of Digital Signal Processing 1

Lecture 22: Design of FIR / IIR Filters

  • Upload
    others

  • View
    10

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Selection• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

1

Page 2: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

News Homework #9

Due on Thursday

Submit via canvas

Coding Assignment #6

Due on next Monday

Submit via canvas

2

Page 3: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

News Exam #2 – Great Job!

Mean: 86.3

Median: 87.5

3

Page 4: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Selection• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

4

Page 5: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What condition must be satisfied?

5

Page 6: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What condition must be satisfied?

𝑥𝑥 𝑛𝑛 = ±𝑥𝑥 −𝑛𝑛 + 𝑁𝑁 − 1 = ±𝑥𝑥 𝑁𝑁 − 1− 𝑛𝑛 Positive: Even symmetry

Negative: Odd symmetry

6

Page 7: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response?

7

Page 8: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

8

Page 9: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

Odd Symmetry𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 +⋯−𝑎𝑎1𝑧𝑧− 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧− 𝑀𝑀−1

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯−𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 − 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

9

Page 10: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

Odd Symmetry𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 +⋯−𝑎𝑎1𝑧𝑧− 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧− 𝑀𝑀−1

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯−𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 − 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

10

𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒jΘ 𝜔𝜔

𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒jΘ 𝜔𝜔

Page 11: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

Odd Symmetry𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 +⋯−𝑎𝑎1𝑧𝑧− 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧− 𝑀𝑀−1

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯−𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 − 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

11

𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒jΘ 𝜔𝜔 Θ 𝜔𝜔 = �0 for 𝐺𝐺 𝜔𝜔 > 0𝜋𝜋 for 𝐺𝐺 𝜔𝜔 < 0

𝐺𝐺 𝜔𝜔 = 𝑋𝑋 𝜔𝜔 𝑒𝑒jΘ 𝜔𝜔 Θ 𝜔𝜔 = �0 for 𝐺𝐺 𝜔𝜔 > 0𝜋𝜋 for 𝐺𝐺 𝜔𝜔 < 0

Page 12: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

Odd Symmetry𝑋𝑋 𝑧𝑧 = 𝑎𝑎0 + 𝑎𝑎1𝑧𝑧−1 + 𝑎𝑎2𝑧𝑧−2 +⋯−𝑎𝑎1𝑧𝑧− 𝑀𝑀−2 − 𝑎𝑎0𝑧𝑧− 𝑀𝑀−1

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯−𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 − 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

12

∠𝑋𝑋 𝜔𝜔 = � −𝜔𝜔 𝑀𝑀 − 1 /2 for 𝐺𝐺 𝜔𝜔 > 0−𝜔𝜔 𝑀𝑀 − 1 /2 + 𝜋𝜋 for 𝐺𝐺 𝜔𝜔 < 0

∠𝑋𝑋 𝜔𝜔 = � −𝜔𝜔 𝑀𝑀 − 1 /2 for 𝐺𝐺 𝜔𝜔 > 0−𝜔𝜔 𝑀𝑀 − 1 /2 + 𝜋𝜋 for 𝐺𝐺 𝜔𝜔 < 0

Page 13: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

13

Page 14: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

= 𝑧𝑧−𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 𝑧𝑧𝑀𝑀−12 −𝑘𝑘 + 𝑧𝑧−

𝑀𝑀−12 −𝑘𝑘

14

Page 15: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

= 𝑧𝑧−𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 𝑧𝑧𝑀𝑀−12 −𝑘𝑘 + 𝑧𝑧−

𝑀𝑀−12 −𝑘𝑘

Notice that𝑋𝑋 𝑧𝑧 = 𝑧𝑧− 𝑀𝑀−1 𝑋𝑋 𝑧𝑧−1

15

Page 16: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

= 𝑧𝑧−𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 𝑧𝑧𝑀𝑀−12 −𝑘𝑘 + 𝑧𝑧−

𝑀𝑀−12 −𝑘𝑘

Pole-zero plot property? 𝑋𝑋 𝑧𝑧 = 𝑧𝑧− 𝑀𝑀−1 𝑋𝑋 𝑧𝑧−1

16

Page 17: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

= 𝑧𝑧−𝑀𝑀−12 𝑎𝑎0𝑧𝑧

𝑀𝑀−12 + 𝑎𝑎1𝑧𝑧

𝑀𝑀−12 −1 +⋯+ 𝑎𝑎1𝑧𝑧

1− 𝑀𝑀−12 + 𝑎𝑎0𝑧𝑧

− 𝑀𝑀−12

= 𝑧𝑧−𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 𝑧𝑧𝑀𝑀−12 −𝑘𝑘 + 𝑧𝑧−

𝑀𝑀−12 −𝑘𝑘

Pole-zero plot property? 𝑋𝑋 𝑧𝑧 = 𝑧𝑧− 𝑀𝑀−1 𝑋𝑋 𝑧𝑧−1

Causality and Linear Phase

17

o

o

o

o

o

o

o

o

xx(M-1)

Page 18: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Causality Question: How do we describe causal filter magnitude?

18

Page 19: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Causality Question: How do we describe causal filter magnitude?

19

Often plotted in dB (decibels)

Page 20: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Causality Question: How do we describe causal filter magnitude?

20

Often plotted in dB (decibels)

Page 21: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Review Downsampling & Upsampling• Causality in Filters• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Selection• Designing FIR Filters with Equi-ripples

Lecture 21: Design of FIR FiltersFoundations of Digital Signal Processing

21

Page 22: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Designing with Windows Question: How can I design an FIR filter from an ideal filter?

22

……

Page 23: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Designing with Windows Question: How can I design an FIR filter from an ideal filter?

23

……

ℱIdeal filterNon-causal

Infinite Response

Page 24: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Designing with Windows Question: How can I design an FIR filter from an ideal filter?

Answer: Window the response!

24

……

ℱIdeal filterNon-causal

Infinite Response

Page 25: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Question: How can I design an FIR filter from an ideal filter?

Answer: Window the response!

Designing with Windows

25

……

ℱIdeal filterNon-causal

Infinite Response

Page 26: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Question: How can I design an FIR filter from an ideal filter?

Answer: Window the response!

Designing with Windows

26

……

ℱIdeal filterNon-causal

Infinite Response

Page 27: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Different Filters

Designing with Windows

27

Page 28: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Different Filters

Designing with Windows

28

Page 29: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Different Filters

Designing with Windows

29

Page 30: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

30

Page 31: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

31

Page 32: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

32

Page 33: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

33

Page 34: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

34

Page 35: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

35

Page 36: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

36

Page 37: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

37

Page 38: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

38

Page 39: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

39

Page 40: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

40

Page 41: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Windowing the sinc impulse response

Designing with Windows

41

Page 42: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Sampling• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

42

Page 43: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 = �𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

43

Page 44: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘= 𝑁𝑁+1 /2

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘

44

Page 45: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

45

Page 46: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 +𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗

2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

46

Page 47: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 +𝐻𝐻 𝑘𝑘 𝑒𝑒−𝑗𝑗

2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘𝑒𝑒𝑗𝑗2𝜋𝜋𝑛𝑛

47

Page 48: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁 𝐻𝐻 0 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 +𝐻𝐻 𝑘𝑘 𝑒𝑒−𝑗𝑗

2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘

48

Page 49: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + 𝑒𝑒−𝑗𝑗

2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘

49

Page 50: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Option 2: Work backwards with constraints

Consider the DFT:

ℎ 𝑛𝑛 =1𝑁𝑁�𝑘𝑘=0

𝑁𝑁−1

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 such that 𝐻𝐻 𝑘𝑘 = 𝐻𝐻 𝑁𝑁 − 𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛𝑘𝑘 + �

𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 𝑒𝑒𝑗𝑗2𝜋𝜋𝑁𝑁 𝑛𝑛 𝑁𝑁−𝑘𝑘

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁𝑛𝑛𝑘𝑘

50

Page 51: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling An inverse DFT that forces time-symmetry

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁𝑛𝑛𝑘𝑘

51

Page 52: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling An inverse DFT that forces time-symmetry

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁𝑛𝑛𝑘𝑘

Example: Consider the desired 9-sample frequency responsewith the first half defined by [1 1 0 0]

Compute the frequency sampled filter

52

Page 53: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling An inverse DFT that forces time-symmetry

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁𝑛𝑛𝑘𝑘

Example: Consider the desired 9-sample frequency responsewith the first half defined by [1 1 0 0]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =12

1 + 2 cos 2𝜋𝜋/9 𝑛𝑛

53

Page 54: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Example: Consider the desired 9-sample frequency response

with the first half defined by [1 1 0 0]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =12

1 + 2 cos 2𝜋𝜋/9 𝑛𝑛

54

Page 55: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Example: Consider the desired 9-sample frequency response

with the first half defined by [1 1 0 0]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =12

1 + 2 cos 2𝜋𝜋/9 𝑛𝑛

In practice, this should be circularly shifted so that the maximum is centered.

55

Page 56: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling An inverse DFT that forces time-symmetry

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁

𝑛𝑛 −𝑁𝑁 − 1

2𝑘𝑘

Example: Consider the desired 9-sample frequency responsewith the first half defined by [1 1 0 0]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =12

1 + 2 cos 2𝜋𝜋/9 𝑛𝑛

56

Page 57: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Example: Consider the desired 9-sample frequency response

with the first half defined by [1 1 0 0]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =12

1 + 2 cos 2𝜋𝜋/9 𝑛𝑛 − 8/2

57

Page 58: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =1

171 + 2 cos 2𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 4𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 6𝜋𝜋/19 𝑛𝑛𝑐𝑐

𝑛𝑛𝑐𝑐 = 𝑛𝑛 −162

58

Page 59: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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]

Compute the frequency sampled filter

ℎ 𝑛𝑛 =1

171 + 2 cos 2𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 4𝜋𝜋/19 𝑛𝑛𝑐𝑐 + 2 cos 6𝜋𝜋/19 𝑛𝑛𝑐𝑐

𝑛𝑛𝑐𝑐 = 𝑛𝑛 −162

59

Page 60: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Example: Consider the desired 41-sample frequency response

with the first 10 values defined by 1

Compute the frequency sampled filter

60

Page 61: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Example: Consider the desired 401-sample frequency response

with the first 100 values defined by 1

Compute the frequency sampled filter

Note that in practice, this needs to be circularly shifted to the center

61

Page 62: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Note: The definition can be slightly modified Our definition:

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁

𝑛𝑛 −𝑁𝑁 − 1

2𝑘𝑘

=1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁

𝑛𝑛 −𝑁𝑁2

+12

𝑘𝑘

=1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁

𝑛𝑛 +12

𝑘𝑘 − 𝜋𝜋𝑘𝑘

=1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

−1 𝑘𝑘𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁

𝑛𝑛 +12

𝑘𝑘

62

Page 63: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Frequency Sampling Final Definition

ℎ 𝑛𝑛 =1𝑁𝑁

𝐻𝐻 0 + 2 �𝑘𝑘=1

𝑁𝑁−1 /2

−1 𝑘𝑘𝐻𝐻 𝑘𝑘 cos2𝜋𝜋𝑁𝑁

𝑛𝑛 +12

𝑘𝑘

Side note: This is very closely related to the discrete cosine transform

63

Page 64: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Sampling• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

64

Page 65: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Equi-ripplesPreviously derived:

𝑋𝑋 𝑧𝑧 = 𝑧𝑧−𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 𝑧𝑧𝑀𝑀−12 −𝑘𝑘 + 𝑧𝑧−

𝑀𝑀−12 −𝑘𝑘

𝑋𝑋 𝜔𝜔 = 𝑒𝑒−𝑗𝑗𝜔𝜔𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 𝑒𝑒𝑗𝑗𝜔𝜔𝑀𝑀−12 −𝑘𝑘 + 𝑗𝑗𝜔𝜔−𝑗𝑗𝜔𝜔 𝑀𝑀−1

2 −𝑘𝑘

= 2𝑒𝑒−𝑗𝑗𝜔𝜔𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 cos 𝜔𝜔𝑀𝑀− 1

2− 𝑘𝑘

65

Page 66: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Equi-ripples Equi-ripple design

𝑋𝑋 𝜔𝜔 = 2𝑒𝑒−𝑗𝑗𝜔𝜔𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 cos 𝜔𝜔𝑀𝑀− 1

2− 𝑘𝑘

Goal: Find the optimal 𝑎𝑎𝑘𝑘s that satisfies passband / stopband ripple constraints.

66

Page 67: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Design with Equi-ripples Equi-ripple design

min𝑎𝑎𝑘𝑘

𝑊𝑊 𝜔𝜔 𝐻𝐻𝑑𝑑 𝜔𝜔 − 2𝑒𝑒−𝑗𝑗𝜔𝜔𝑀𝑀−12 �

𝑘𝑘=0

𝑀𝑀/2−1

𝑎𝑎𝑘𝑘 cos 𝜔𝜔𝑀𝑀− 1

2− 𝑘𝑘

67

Desired frequency response

Equals:𝛿𝛿2𝛿𝛿1

for 𝜔𝜔 in pass band

1 for 𝜔𝜔 in stop band

𝛿𝛿2 = stopband ripple𝛿𝛿1 = passband ripple

Page 68: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Sampling• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

68

Page 69: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Designing IIR Filters No easy ways to design digital IIR filters

So let us start from analog filters

69

Page 70: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Designing IIR Filters No easy ways to design digital IIR filters

So let us start from analog filters

Option 1: Preserve the difference equation!

70

Page 71: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Question: What is a derivative in discrete-time? In continuous-time𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

→ 𝑠𝑠𝑋𝑋 𝑠𝑠

In discrete-time

71

Page 72: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Question: What is a derivative in discrete-time? In continuous-time𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

→ 𝑠𝑠𝑋𝑋 𝑠𝑠

In discrete-time𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

= limΔ𝑇𝑇→0

𝑥𝑥 𝑡𝑡 − 𝑥𝑥 𝑡𝑡 − Δ𝑇𝑇Δ𝑇𝑇

�𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡 𝑡𝑡=𝑛𝑛𝑇𝑇

=𝑥𝑥 𝑛𝑛𝑇𝑇 − 𝑥𝑥 𝑛𝑛𝑇𝑇 − 𝑇𝑇

𝑇𝑇= 𝑥𝑥 𝑛𝑛 − 𝑥𝑥 𝑛𝑛 − 1

72

T=1

Page 73: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Question: What is a derivative in discrete-time? In continuous-time𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

→ 𝑠𝑠𝑋𝑋 𝑠𝑠

In discrete-time𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

= limΔ𝑇𝑇→0

𝑥𝑥 𝑡𝑡 − 𝑥𝑥 𝑡𝑡 − Δ𝑇𝑇Δ𝑇𝑇

�𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡 𝑡𝑡=𝑛𝑛𝑇𝑇

=𝑥𝑥 𝑛𝑛𝑇𝑇 − 𝑥𝑥 𝑛𝑛𝑇𝑇 − 𝑇𝑇

𝑇𝑇=

1𝑇𝑇𝑥𝑥 𝑛𝑛 − 𝑥𝑥 𝑛𝑛 − 1

73

Page 74: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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 𝑋𝑋 𝑧𝑧

74

Page 75: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

=𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡

�𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡 𝑡𝑡=𝑛𝑛𝑇𝑇

=𝑥𝑥 𝑛𝑛𝑇𝑇 − 𝑥𝑥 𝑛𝑛𝑇𝑇 − 𝑇𝑇

𝑇𝑇

75

Page 76: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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𝑇𝑇 /𝑇𝑇

𝑇𝑇

76

Page 77: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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𝑇𝑇

𝑇𝑇2 →𝑥𝑥 𝑛𝑛 − 2𝑥𝑥 𝑛𝑛 − 1 + 𝑥𝑥 𝑛𝑛 − 2

𝑇𝑇2

77

Page 78: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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𝑇𝑇

𝑇𝑇2 →𝑥𝑥 𝑛𝑛 − 2𝑥𝑥 𝑛𝑛 − 1 + 𝑥𝑥 𝑛𝑛 − 2

𝑇𝑇2

�𝑑𝑑𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡 𝑡𝑡=𝑛𝑛𝑇𝑇

→1𝑇𝑇2

1− 2𝑧𝑧−1 + 𝑧𝑧−2 𝑋𝑋 𝑧𝑧 =1𝑇𝑇2

1− 𝑧𝑧−1 2𝑋𝑋 𝑧𝑧

78

Page 79: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Question: What is a derivative in discrete-time? Translate continuous-time to discrete-time

𝑑𝑑𝑘𝑘𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡𝑘𝑘

→ 𝑠𝑠𝑘𝑘𝑋𝑋 𝑠𝑠

�𝑑𝑑𝑘𝑘𝑥𝑥 𝑡𝑡𝑑𝑑𝑡𝑡𝑘𝑘

𝑡𝑡=𝑛𝑛𝑇𝑇

→1𝑇𝑇

1− 𝑧𝑧−1 𝑘𝑘𝑋𝑋 𝑧𝑧

79

Page 80: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

80

Page 81: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Example: 𝑠𝑠 → 1

𝑇𝑇1− 𝑧𝑧−1

Use the derivative conversion to transform the following biquadfilter into the discrete-time domain.

𝐻𝐻 𝑠𝑠 =1

𝑠𝑠 + 0.1 2 + 9

81

Page 82: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Example: 𝑠𝑠 → 1

𝑇𝑇1− 𝑧𝑧−1

Use the derivative conversion to transform the following bi-quad filter into the discrete-time domain.

𝐻𝐻 𝑠𝑠 =1

𝑠𝑠 + 0.1 2 + 9

𝐻𝐻 𝑧𝑧 =1

1𝑇𝑇 1− 𝑧𝑧−1 + 0.1

2+ 9

=𝑇𝑇2

𝑇𝑇2 1𝑇𝑇 1− 𝑧𝑧−1 + 0.1

2+ 9

=𝑇𝑇2

1− 𝑧𝑧−1 + 0.1𝑇𝑇 2 + 9𝑇𝑇2=

𝑇𝑇2

1 + 0.1𝑇𝑇 − 𝑧𝑧−1 2 + 9𝑇𝑇2

82

Page 83: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Example: 𝑠𝑠 → 1

𝑇𝑇1− 𝑧𝑧−1

Use the derivative conversion to transform the following bi-quad filter into the discrete-time domain.

𝐻𝐻 𝑠𝑠 =1

𝑠𝑠 + 0.1 2 + 9

𝐻𝐻 𝑧𝑧 =𝑇𝑇2

1 + 0.1𝑇𝑇 − 𝑧𝑧−1 2 + 9𝑇𝑇2

1 + 0.1𝑇𝑇 − 𝑧𝑧−1 2 + 9𝑇𝑇2 = 0

1 + 0.1𝑇𝑇 − 𝑧𝑧−1 2 = −9𝑇𝑇2

1 + 0.1𝑇𝑇 − 𝑧𝑧−1 = ±3𝑇𝑇𝑗𝑗

𝑧𝑧−1 = 1 + 0.1𝑇𝑇 ∓ 3𝑇𝑇𝑗𝑗 𝑧𝑧 =1

1 + 0.1∓ 3𝑗𝑗 𝑇𝑇83

Finding poles

Page 84: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Example: 𝑠𝑠 → 1

𝑇𝑇1− 𝑧𝑧−1

Use the derivative conversion to transform the following bi-quad filter into the discrete-time domain.

𝑧𝑧 =1

1 + 0.1 + 3𝑗𝑗 𝑇𝑇

84

Poles

Page 85: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Example: 𝑠𝑠 → 1

𝑇𝑇1− 𝑧𝑧−1

𝑧𝑧 =1

1 + 0.1 + 3𝑗𝑗 𝑇𝑇

85

Page 86: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Question: What is a derivative in discrete-time? Translate continuous-time to discrete-time

𝑠𝑠 →1𝑇𝑇

1− 𝑧𝑧−1

Pros: Relatively simple

Cons: Very limiting

Stable continuous-time poles can only be mapped to low frequencies

86

1

Stable IIR analog filters map here

Page 87: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Sampling• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

87

Page 88: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Impulse Invariance Designing IIR Filters No easy ways to design digital IIR filters

So let us start from analog filters

Option 2: Preserve the impulse response!

88

Page 89: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Impulse Invariance Question: How else can I represent my transfer function?

𝐻𝐻 𝑠𝑠 = �𝑘𝑘=1

𝐾𝐾1

𝑠𝑠 − 𝑝𝑝𝑘𝑘

89

Page 90: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Impulse Invariance Question: How else can I represent my transfer function?

𝐻𝐻 𝑠𝑠 = �𝑘𝑘=1

𝐾𝐾1

𝑠𝑠 − 𝑝𝑝𝑘𝑘= �

𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

90

Page 91: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Impulse Invariance Question: How else can I represent my transfer function?

𝐻𝐻 𝑠𝑠 = �𝑘𝑘=1

𝐾𝐾1

𝑠𝑠 − 𝑝𝑝𝑘𝑘= �

𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

ℎ 𝑡𝑡 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

91

Page 92: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Impulse Invariance Question: How else can I represent my transfer function?

𝐻𝐻 𝑠𝑠 = �𝑘𝑘=1

𝐾𝐾1

𝑠𝑠 − 𝑝𝑝𝑘𝑘= �

𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

ℎ 𝑡𝑡 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

ℎ 𝑛𝑛𝑇𝑇 = ℎ 𝑛𝑛 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑛𝑛𝑇𝑇 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘 𝑒𝑒𝑝𝑝𝑘𝑘𝑇𝑇 𝑛𝑛

92

Page 93: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Impulse Invariance Question: How else can I represent my transfer function?

𝐻𝐻 𝑠𝑠 = �𝑘𝑘=1

𝐾𝐾1

𝑠𝑠 − 𝑝𝑝𝑘𝑘= �

𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

ℎ 𝑡𝑡 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑡𝑡

ℎ 𝑛𝑛𝑇𝑇 = ℎ 𝑛𝑛 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘𝑒𝑒𝑝𝑝𝑘𝑘𝑛𝑛𝑇𝑇 = �𝑘𝑘=1

𝐾𝐾

𝑐𝑐𝑘𝑘 𝑒𝑒𝑝𝑝𝑘𝑘𝑇𝑇 𝑛𝑛

𝐻𝐻 𝑧𝑧 = �𝑘𝑘=1

𝐾𝐾𝑐𝑐𝑘𝑘

1− 𝑒𝑒𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1

93

Page 94: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

94

Page 95: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

95

Page 96: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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=

1/2𝑠𝑠 + 3𝑗𝑗 + 0.1

+1/2

𝑠𝑠 − 3𝑗𝑗 + 0.1

Poles:𝑠𝑠 + 0.1 2 + 9 = 0𝑠𝑠 = ±3𝑗𝑗 − 0.1

96

Page 97: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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=

1/2𝑠𝑠 + 3𝑗𝑗 + 0.1

+1/2

𝑠𝑠 − 3𝑗𝑗 + 0.1

𝐻𝐻 𝑧𝑧 =1/2

1− 𝑒𝑒 −3𝑗𝑗−0.1 𝑇𝑇𝑧𝑧−1+

1/21− 𝑒𝑒 3𝑗𝑗−0.1 𝑇𝑇𝑧𝑧−1

97

Page 98: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design from Derivatives Example: 𝐻𝐻 𝑧𝑧 = ∑𝑘𝑘=1𝐾𝐾 𝑐𝑐𝑘𝑘

1−𝑒𝑒𝑝𝑝𝑘𝑘𝑇𝑇𝑧𝑧−1

𝐻𝐻 𝑧𝑧 =1/2

1− 𝑒𝑒 −3𝑗𝑗−0.1 𝑇𝑇𝑧𝑧−1

+1/2

1− 𝑒𝑒 3𝑗𝑗−0.1 𝑇𝑇𝑧𝑧−1

98

Page 99: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Sampling• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

99

Page 100: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Bilinear Transform Designing IIR Filters No easy ways to design digital IIR filters

So let us start from analog filters

Option 3: Preserve the definition of z!

100

Page 101: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Bilinear Transform Question: How are z and s related? From continuous-time to discrete-time𝑠𝑠 = 𝑗𝑗Ω𝑒𝑒𝑠𝑠𝑡𝑡 = 𝑒𝑒𝑠𝑠𝑛𝑛𝑇𝑇 = 𝑧𝑧𝑛𝑛

𝑧𝑧 = 𝑒𝑒𝑠𝑠𝑇𝑇

Building an approximation (𝑒𝑒𝑥𝑥 ≈ 1 + 𝑥𝑥)

𝑧𝑧 =𝑒𝑒𝑠𝑠𝑇𝑇2

𝑒𝑒−𝑠𝑠𝑇𝑇2≈

1 + 𝑠𝑠𝑇𝑇/21− 𝑠𝑠𝑇𝑇/2

101

Taylor Series Expansion / Approximation

Page 102: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Bilinear Transform Question: How are z and s related? From continuous-time to discrete-time𝑠𝑠 = 𝑗𝑗Ω𝑒𝑒𝑠𝑠𝑡𝑡 = 𝑒𝑒𝑠𝑠𝑛𝑛𝑇𝑇 = 𝑧𝑧𝑛𝑛

𝑧𝑧 = 𝑒𝑒𝑠𝑠𝑇𝑇 𝑠𝑠 =1𝑇𝑇

ln 𝑧𝑧

Building an approximation

𝑠𝑠 ≈2𝑇𝑇𝑧𝑧 − 1𝑧𝑧 + 1

102

BilinearExpansion / Approximation

Page 103: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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 + 𝑠𝑠𝑇𝑇/21− 𝑠𝑠𝑇𝑇/2

103

Page 104: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Bilinear Transform

Example: 𝑠𝑠 → 2𝑇𝑇1−𝑧𝑧−1

1+𝑧𝑧−1, 𝑧𝑧 → 1+𝑠𝑠𝑇𝑇/2

1−𝑠𝑠𝑇𝑇/2

Use the bilinear transform to transform the following biquad filter into the discrete-time domain.

𝐻𝐻 𝑠𝑠 =1

𝑠𝑠 + 0.1 2 + 9

104

Page 105: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Bilinear Transform

Example: 𝑠𝑠 → 2𝑇𝑇1−𝑧𝑧−1

1+𝑧𝑧−1, 𝑧𝑧 → 1+𝑠𝑠𝑇𝑇/2

1−𝑠𝑠𝑇𝑇/2

Use the bilinear transform to transform the following biquad filter into the discrete-time domain.

𝐻𝐻 𝑠𝑠 =1

𝑠𝑠 + 0.1 2 + 9

𝐻𝐻 𝑧𝑧 =1

2𝑇𝑇

1− 𝑧𝑧−11 + 𝑧𝑧−1 + 0.1

2+ 9

=1 + 𝑧𝑧−1 2

2𝑇𝑇 1− 𝑧𝑧−1 + 0.1

2+ 9 1 + 𝑧𝑧−1 2

105

Page 106: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

IIR Filter Design by Bilinear Transform

Example: 𝑠𝑠 → 2𝑇𝑇1−𝑧𝑧−1

1+𝑧𝑧−1, 𝑧𝑧 → 1+𝑠𝑠𝑇𝑇/2

1−𝑠𝑠𝑇𝑇/2

𝐻𝐻 𝑧𝑧 =1 + 𝑧𝑧−1 2

2𝑇𝑇 1− 𝑧𝑧−1 + 0.1

2+ 9 1 + 𝑧𝑧−1 2

106

Page 107: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Outline• Designing FIR Filters with Windows• Designing FIR Filters with Frequency Sampling• Designing FIR Filters with Equi-ripples• Designing IIR Filters with Discrete Differentiation• Designing IIR Filters with Impulse Invariance• Designing IIR Filters with the Bilinear Transform• Related Analog Filters

Lecture 22: Design of FIR / IIR FiltersFoundations of Digital Signal Processing

107

Page 108: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Multi-pole Filters Butterworth: Maximally flat passband

Chebyshev: Faster cutoff with passband ripple

Elliptic: Fastest cutoff with passband and stopband ripple

108

Frequency [Hz]

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

Mag

nitu

de R

espo

nse

0

0.5

1

1.5

Frequency [Hz]

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

Phas

e R

espo

nse

-30

-20

-10

0

10

Page 109: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Butterworth Filter Butterworth Filter of order N

109

𝐻𝐻 𝑗𝑗𝜔𝜔 =1

∑𝑘𝑘=1𝑁𝑁 𝑠𝑠 − 𝑠𝑠𝑘𝑘 𝑠𝑠𝑘𝑘 = 𝑒𝑒𝑗𝑗 2𝑘𝑘+𝑁𝑁−1 𝜋𝜋

2𝑁𝑁

Page 110: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Butterworth Filter Butterworth Filter of order N N equally spaced poles on a circle on the left-hand-side of the s-

plane

110

Page 111: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Butterworth Filter Properties of the Butterworth Filter It is maximally flat at 𝜔𝜔 = 0

It has a cutoff frequency 𝐻𝐻 𝜔𝜔 = 12

at 𝜔𝜔 = 𝜔𝜔𝑐𝑐

For large 𝑛𝑛, it becomes an ideal filter

111

Page 112: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Chebyshev Filter Chebyshev Filter of order N

112

𝐻𝐻 𝑗𝑗𝜔𝜔 =1

1 + 𝜖𝜖2𝐶𝐶𝑛𝑛2 𝜔𝜔

𝐶𝐶𝑛𝑛2 𝜔𝜔 is an nth-order Chebyshev Polynomial 𝜖𝜖2 controls ripple

Page 113: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Chebyshev Filter Chebyshev Filter of order N

113

Page 114: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

If ϵ is reduced (i.e., the ripple size is reduced), then the stopband attenuation is reduced.

It has a sharper cut-off than a Butterworth filter, but at the expense of passband rippling

114

Page 115: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Elliptic Filter Elliptic Filter of order N

115

𝐻𝐻 𝑗𝑗𝜔𝜔 =1

1 + 𝜖𝜖2𝑅𝑅𝑛𝑛2 𝜔𝜔

𝑅𝑅𝑛𝑛2 𝜔𝜔 is an nth-order elliptic function 𝜖𝜖2 controls ripple

Page 116: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

Elliptic Filter Elliptic Filter of order N

116

Page 117: Lecture 22: Design of FIR / IIR Filters

Lecture 22: Designing FIR / IIR FiltersFoundations of Digital Signal Processing

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

117