Lecture 22: Design of FIR / IIR Filters Foundations of Digital Signal Processing
Total Page:16
File Type:pdf, Size:1020Kb
Lecture 22: Design of 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 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 1 News Homework #9 . Due on Thursday . Submit via canvas Coding Assignment #6 . Due on next Monday . Submit via canvas Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 2 News Exam #2 – Great Job! . Mean: 86.3 . Median: 87.5 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 3 Lecture 22: Design of FIR / IIR Filters Foundations of Digital Signal Processing Outline • Designing FIR Filters with Windows • 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 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 4 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What condition must be satisfied? Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 5 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What condition must be satisfied? = ± + 1 = ± 1 . Positive: Even symmetry − − − − . Negative: Odd symmetry Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 6 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 7 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 0 1 2 ⋯ 1 0 Odd Symmetry = + + + −1 −2 − −2 − −1 0 1 2 ⋯ − 1 − 0 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 8 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − ⋯ 1− − 2 2 2 −1 2 2 0 1 ⋯ 1 0 Odd Symmetry = + + + = −+1 −2 + − −2 − −1 −1 0 1−1 2−1 1 −1 0 −1 − ⋯ − 1− − − 2 2 2 −1 2 2 0 1 ⋯ − 1 − 0 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 9 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − ⋯ 1− − 2 2 2 −1 2 2 0 1 ⋯ 1 0 = jΘ Odd Symmetry = + + + = −+1 −2 + − −2 − −1 −1 0 1−1 2−1 1 −1 0 −1 − ⋯ − 1− − − 2 2 2 −1 2 2 0 1 ⋯ − 1 − 0 = jΘ Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 10 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − ⋯ 1− − 2 2 2 −1 2 2 0 1 ⋯ 1 0 for 0 > 0 = = for < 0 jΘ Odd Symmetry Θ � = + + + = −+1 −2 + − −2 − −1 −1 0 1−1 2−1 1 −1 0 −1 − −1 ⋯ − 1− − − 2 0 2 1 2 1 2 0 2 ⋯ − 0 for− > 0 = = for < 0 jΘ Foundations of Digital Signal ProcessingΘ Lecture 22:� Designing FIR / IIR Filters 11 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − −1 ⋯ 1− − 2 0 2 1 2 1 2 0 2 1⋯/2 for > 0 = 1 /2 + for < 0 − − Odd Symmetry∠ � = + + − +− = −+1 −2 + − −2 − −1 −1 0 1−1 2−1 1 −1 0 −1 − −1 ⋯ − 1− − − 2 0 2 1 2 1 2 0 2 ⋯1−/2 for − > 0 = 1 /2 + for < 0 − − ∠Foundations of� Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 12 − − Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − ⋯ 1− − 2 2 2 −1 2 2 0 1 ⋯ 1 0 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 13 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − / −1 ⋯ 1− − 2 0 2 1 2 1 2 0 2 = 2−1 + ⋯ −1 −1 −1 − − − 2 2 − 2 � =0 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 14 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − / −1 ⋯ 1− − 2 0 2 1 2 1 2 0 2 = 2−1 + ⋯ −1 −1 −1 − − − 2 2 − 2 � =0 Notice that = − −1 −1 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 15 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − / −1 ⋯ 1− − 2 0 2 1 2 1 2 0 2 = 2−1 + ⋯ −1 −1 −1 − − − 2 2 − 2 � =0 Pole-zero plot property? = − −1 −1 Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 16 Causality and Linear Phase Question: Consider a length-M symmetric, causal filter. What is the phase response? Assume M is even. Even Symmetry = + + + + + −1 −2 − −2 − −1 = 0 1 + 2 + + 1 + 0 −1 −1 −1 −1 −1 − / −1 ⋯ 1− − 2 0 2 1 2 1 2 0 2 = 2−1 + ⋯ −1 −1 −1 − − o− o 2 2 − 2 � =0 o o x x(M-1) Pole-zero plot property? o o = − −1 −1 o o Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 17 Causality Question: How do we describe causal filter magnitude? Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 18 Causality Question: How do we describe causal filter magnitude? Often plotted in dB (decibels) Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 19 Causality Question: How do we describe causal filter magnitude? Often plotted in dB (decibels) Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 20 Lecture 21: Design of FIR Filters Foundations of Digital Signal Processing Outline • Review Downsampling & Upsampling • Causality in Filters • Designing FIR Filters with Windows • Designing FIR Filters with Frequency Selection • Designing FIR Filters with Equi-ripples Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 21 Designing with Windows Question: How can I design an FIR filter from an ideal filter? … … ℱ Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 22 Designing with Windows Question: How can I design an FIR filter from an ideal filter? … … Non-causal Ideal filter Infinite Response ℱ Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 23 Designing with Windows Question: How can I design an FIR filter from an ideal filter? … … Non-causal Ideal filter Infinite Response ℱ Answer: Window the response! Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 24 Designing with Windows Question: How can I design an FIR filter from an ideal filter? … … Non-causal Ideal filter Infinite Response ℱ Answer: Window the response! Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 25 Designing with Windows Question: How can I design an FIR filter from an ideal filter? … … Non-causal Ideal filter Infinite Response ℱ Answer: Window the response! Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 26 Designing with Windows Different Filters Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 27 Designing with Windows Different Filters Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 28 Designing with Windows Different Filters Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 29 Designing with Windows Windowing the sinc impulse response Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 30 Designing with Windows Windowing the sinc impulse response Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 31 Designing with Windows Windowing the sinc impulse response Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 32 Designing with Windows Windowing the sinc impulse response Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 33 Designing with Windows Windowing the sinc impulse response Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 34 Designing with Windows Windowing the sinc impulse response Foundations of Digital Signal Processing Lecture 22: Designing FIR / IIR Filters 35 Designing with Windows Windowing the sinc impulse response Foundations of Digital