lecture 22: design of fir / iir filters

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

Upload: others

Post on 08-May-2022

10 views

Category:

Documents


1 download

TRANSCRIPT

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