Filter Analysis and Design

Similar documents
Digital Signal Processing

Design of IIR filters

EE482: Digital Signal Processing Applications

Digital Signal Processing Lecture 8 - Filter Design - IIR

EE 521: Instrumentation and Measurements

LINEAR-PHASE FIR FILTERS DESIGN

Digital Signal Processing IIR Filter Design via Bilinear Transform

Stability Condition in Terms of the Pole Locations

Lecture 7 Discrete Systems

DIGITAL SIGNAL PROCESSING. Chapter 6 IIR Filter Design

Filter structures ELEC-E5410

LABORATORY 3 FINITE IMPULSE RESPONSE FILTERS

-Digital Signal Processing- FIR Filter Design. Lecture May-16

ECE 410 DIGITAL SIGNAL PROCESSING D. Munson University of Illinois Chapter 12

Chapter 7: IIR Filter Design Techniques

DIGITAL SIGNAL PROCESSING UNIT III INFINITE IMPULSE RESPONSE DIGITAL FILTERS. 3.6 Design of Digital Filter using Digital to Digital

Filter Design Problem

ELEG 305: Digital Signal Processing

Digital Control & Digital Filters. Lectures 21 & 22

Lecture 16: Filter Design: Impulse Invariance and Bilinear Transform

UNIT - III PART A. 2. Mention any two techniques for digitizing the transfer function of an analog filter?

Design of Digital Filters

Basic Design Approaches

Filters and Tuned Amplifiers

DSP-CIS. Chapter-4: FIR & IIR Filter Design. Marc Moonen

Lecture 9 Infinite Impulse Response Filters

Chapter 7: Filter Design 7.1 Practical Filter Terminology

INFINITE-IMPULSE RESPONSE DIGITAL FILTERS Classical analog filters and their conversion to digital filters 4. THE BUTTERWORTH ANALOG FILTER

1 1.27z z 2. 1 z H 2

Responses of Digital Filters Chapter Intended Learning Outcomes:

An Iir-Filter Example: A Butterworth Filter

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF INFORMATION TECHNOLOGY. Academic Year

INF3440/INF4440. Design of digital filters

Multimedia Signals and Systems - Audio and Video. Signal, Image, Video Processing Review-Introduction, MP3 and MPEG2

Digital Signal Processing Lecture 9 - Design of Digital Filters - FIR

ELEG 5173L Digital Signal Processing Ch. 5 Digital Filters

UNIVERSITY OF OSLO. Faculty of mathematics and natural sciences. Forslag til fasit, versjon-01: Problem 1 Signals and systems.

Lecture 3 - Design of Digital Filters

(Refer Slide Time: 01:28 03:51 min)

MITOCW watch?v=jtj3v Rx7E

IT DIGITAL SIGNAL PROCESSING (2013 regulation) UNIT-1 SIGNALS AND SYSTEMS PART-A

Like bilateral Laplace transforms, ROC must be used to determine a unique inverse z-transform.

Chapter 5 Frequency Domain Analysis of Systems

LAB 6: FIR Filter Design Summer 2011

EE 225D LECTURE ON DIGITAL FILTERS. University of California Berkeley

Signals and Systems. Lecture 11 Wednesday 22 nd November 2017 DR TANIA STATHAKI

Optimal Design of Real and Complex Minimum Phase Digital FIR Filters

Optimum Ordering and Pole-Zero Pairing of the Cascade Form IIR. Digital Filter

Lecture 8 - IIR Filters (II)

There are two main classes of digital lter FIR (Finite impulse response) and IIR (innite impulse reponse).

Chapter 5 Frequency Domain Analysis of Systems

Review of Fundamentals of Digital Signal Processing

EECE 301 Signals & Systems Prof. Mark Fowler

ECE 8440 Unit 17. Parks- McClellan Algorithm

Signal Processing. Lecture 10: FIR Filter Design. Ahmet Taha Koru, Ph. D. Yildiz Technical University Fall

PS403 - Digital Signal processing

DSP. Chapter-3 : Filter Design. Marc Moonen. Dept. E.E./ESAT-STADIUS, KU Leuven

Electronic Circuits EE359A

Multirate Digital Signal Processing

Computer-Aided Design of Digital Filters. Digital Filters. Digital Filters. Digital Filters. Design of Equiripple Linear-Phase FIR Filters

Lecture 8 - IIR Filters (II)

Exercises in Digital Signal Processing

Digital Signal Processing

The Approximation Problem

Review of Fundamentals of Digital Signal Processing

Discrete-Time Signals and Systems. Frequency Domain Analysis of LTI Systems. The Frequency Response Function. The Frequency Response Function

A system that is both linear and time-invariant is called linear time-invariant (LTI).

UNIVERSITY OF OSLO. Please make sure that your copy of the problem set is complete before you attempt to answer anything.

UNIVERSITI SAINS MALAYSIA. EEE 512/4 Advanced Digital Signal and Image Processing

Question Bank. UNIT 1 Part-A

2.161 Signal Processing: Continuous and Discrete Fall 2008

Multirate signal processing

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

Chap 4. Sampling of Continuous-Time Signals

Time Series Analysis: 4. Linear filters. P. F. Góra

2.161 Signal Processing: Continuous and Discrete Fall 2008

Quadrature-Mirror Filter Bank

Contents. Digital Signal Processing, Part II: Power Spectrum Estimation

Analog and Digital Filter Design

Discrete-Time David Johns and Ken Martin University of Toronto

Problem Set 9 Solutions

Electronic Circuits EE359A

V. IIR Digital Filters

Optimum Ordering and Pole-Zero Pairing. Optimum Ordering and Pole-Zero Pairing Consider the scaled cascade structure shown below

DEPARTMENT OF EI DIGITAL SIGNAL PROCESSING ASSIGNMENT 1

Computer Engineering 4TL4: Digital Signal Processing

Fourier Series Representation of

The Discrete Fourier Transform

Butterworth Filter Properties

Generalizing the DTFT!

The Laplace Transform

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

EE 313 Linear Signals & Systems (Fall 2018) Solution Set for Homework #7 on Infinite Impulse Response (IIR) Filters CORRECTED

1. FIR Filter Design

Time Series Analysis: 4. Digital Linear Filters. P. F. Góra

ESE 531: Digital Signal Processing

EFFICIENT REMEZ ALGORITHMS FOR THE DESIGN OF NONRECURSIVE FILTERS

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

Laplace Transform Analysis of Signals and Systems

Continuous and Discrete Time Signals and Systems

Transcription:

Filter Analysis and Design

Butterworth Filters Butterworth filters have a transfer function whose squared magnitude has the form H a ( jω ) 2 = 1 ( ) 2n. 1+ ω / ω c * M. J. Roberts - All Rights Reserved 2

Butterworth Filters The poles of a lowpass Butterworth filter lie on a semicircle of radius ω c in the open left half-plane. The number of poles is n and the angular spacing between the poles is always π / n. For n odd there is one pole on the negative real axis and all the others occur in complex conjugate pairs. For even n all the poles occur in complex conjugate pairs. The form of the transfer function is H a ( s) = 1 ( 1 s / p 1 )( 1 s / p 2 ) 1 s / p n n ( ) = 1 k=1 = 1 s / p k n k=1 p k p k s * M. J. Roberts - All Rights Reserved 3

Frequency Transformation A normalized lowpass filter can be transformed into an un-normalized lowpass filter or into a highpass, bandpass or bandstop filter by frequency transformation. Lowpass to lowpass s s / ω c Lowpass to highpass s ω c / s Lowpass to bandpass s s2 + ω L ω H s ω H ω L ( ) ( ) Lowpass to bandstop s s ω ω H L s 2 + ω L ω H ω c is the cutoff frequency in rad/s of a lowpass or highpass filter and ω L and ω H are the lower and upper cutoff frequencies in rad/s of a bandpass or bandstop filter. * M. J. Roberts - All Rights Reserved 4

Example Frequency Transformation Design a first-order bandstop Butterworth filter with a cutoff frequencies of 1 khz and 2 khz. H norm ( s) = 1 s +1 H BS ( s) = 1 ( ) s 2 + ω L ω H +1 s ω H ω L ω L = 2π 1000 = 2000π, ω H = 4000π = s 2 + ω L ω H ( ) + ω L ω H s 2 + s ω H ω L s H BS ( s) 2 + 8π 2 10 6 = s 2 + 2000πs + 8π 2 10 s 2 + 7.896 10 7 6 s 2 + 6283s + 7.896 10 7 Zeros at s = ± j8886 which correspond to ω = ±8886 rad/s and f = 1414 Hz Poles at s = 3142 ± j8886. * M. J. Roberts - All Rights Reserved 5

Example Frequency Transformation * M. J. Roberts - All Rights Reserved 6

Chebyshev, Elliptic and Bessel Filters The Butterworth filter is "maximally flat" in its passband. This means that its frequency response in the passband is monotonic and the slope approaches zero at the maximum response. The Chebyshev filter has ripple in either its passband or stopband depending on which type of Chebyshev filter it is. Ripple is a variation of the frequency response between two limits. Allowing this ripple in the passband or stopband lets the transition from pass to stop band be faster than for a Butterworth filter of the same order. The Elliptic (or Cauer) filter has ripple in both the passband and stopband and also has an even faster transition between passband and stopband than the Chebyshev filters. * M. J. Roberts - All Rights Reserved 7

Chebyshev, Elliptic and Bessel Filters * M. J. Roberts - All Rights Reserved 8

Impulse and Step Invariant Design * M. J. Roberts - All Rights Reserved 9

Impulse Invariant Design Let h δ ( t) = h a ( t)δ Ts ( t). Then H δ k= ( ) ( jω ) = f s H a j ω kω s ( ) L where h a ( t) H a ( s). Also let h d [ n] = h a ( nt s ). Then, using ω /f s = Ω ω = f s Ω H d ( e jω ) = f s H a jf s Ω 2πk k= ( ) ( ) * M. J. Roberts - All Rights Reserved 10

Impulse Invariant Design In the expression H d ( e jω ) = f s H a jf s Ω 2πk k = ( ) ( ) it is clear that the digital filter's frequency response consists of multiple scaled aliases of the analog filter's frequency response and, to the extent that the aliases overlap, the two frequency responses must differ. * M. J. Roberts - All Rights Reserved 11

Impulse Invariant Design As an example of impulse invariant design let Then h a H a ( s) = Aω c 2 s 2 + 2ω c s + ω c 2. ( t) = 2Aω c e ω ct / 2 sin( ω c t / 2 )u( t). Sample f s times per second to form h d Then and H d [ n] = 2Aω c e ω cnt s / 2 sin( ω c nt s / 2 )u[ n]. ( ) ze ωcts / 2 sin ω c T s / 2 ( z) = 2Aω c z 2 2e ω ct s / 2 cos( ω c T s / 2 )z + e 2ω ct s / 2 ( ) e H d ( e jω ) jω e ωcts / 2 sin ω c T s / 2 = 2Aω c e j 2Ω 2e ω ct s / 2 cos( ω c T s / 2 )e jω + e 2ω ct s / 2 * M. J. Roberts - All Rights Reserved 12

Impulse Invariant Design The digital filter's frequency response is ( ) e H d ( e jω ) jω e ωcts / 2 sin ω c T s / 2 = 2Aω c and, from a previous slide, H d Therefore e j 2Ω 2e ω ct s / 2 cos( ω c T s / 2 )e jω + e 2ω ct s / 2 2 Aω H d ( e jω ) = f c s k = ( ) ( e jω ) = f s H a jf s Ω 2πk k = ( ( )). ( ) + ω c 2 jf s Ω 2πk 2 + j 2ω c f s Ω 2πk ( ) e jω e ωcts / 2 sin ω c T s / 2 = 2Aω c e j 2Ω 2e ω ct s / 2 cos( ω c T s / 2 )e jω + e 2ω ct s / 2 * M. J. Roberts - All Rights Reserved 13

Impulse Invariant Design Let A = 10 and ω c =100 and f s =200. Then H d and H d ( e jω ) = 2000 k = ( e jω ) = 1000 2 At Ω = 0, and H d ( 1) = 2000 H d ( 1) = ( ) j2 Ω 2πk * M. J. Roberts - All Rights Reserved 14 1 ( ) + 1 2 + j2 2 Ω 2πk ( ) e jω e 1/2 2 sin 1 / 2 2 e j 2Ω 2e 1/2 2 cos( 1 / 2 2 )e jω + e 1/ 2 1 = 1958.5 k = 1 16π 2 k 2 j4 2πk 343.825 1 1.31751+ 0.49306 = 1958.5

Impulse Invariant Design By design the digital filter's impulse response consists of samples of the analog filter's impulse response. * M. J. Roberts - All Rights Reserved 15

Impulse Invariant Design The frequency response of the digital filter differs from the frequency response of the analog filter due to aliasing. * M. J. Roberts - All Rights Reserved 16

Impulse Invariant Design Direct Form II Realization of the Digital Filter Designed by the Impulse Invariant Technique * M. J. Roberts - All Rights Reserved 17

Impulse Invariant Design Let H a Then h a and H d ( s) = Aω c H a ( j2π f ) = s + ω c ( t) = Aω c e ωct u t Aω c H a j2π f + ω c ( ). Sample at rate f s to form h d n z e ( z) = Aω c z e ω ct s H d ( e jω ) jω = Aω c e jω e ω ct s H d ( e jω ) = f s Aω c k = ( jω ) = e jω = Aω jf s ( Ω 2πk) c + ω c e jω e ω ct s Let A = 10, ω c = 50 and f s = 100 and check equality at Ω = 0. Aω c = jf s ( Ω 2πk) + ω c f s k = Aω c e jω e jω e ω ct s = 500 50000 = 1020.7 j200πk + 50 k = 1 = 1270.7 1/2 1 e Aω c jω + ω c. [ ] = Aω c e ω cnt s u[ n] * M. J. Roberts - All Rights Reserved 18

Why are the two results and f s k = Impulse Invariant Design Aω c = jf s ( Ω 2πk) + ω c Aω c 50000 = 1020.7 j200πk + 50 k = e jω e jω e ω ct s = 500 1 = 1270.7 1/2 1 e different by almost 25%? The difference comes from sampling h a [ n] = Aω c e ω cnt s u[ n]. h a t h d ( t) to form ( ) has a discontinuity at t = 0, a sample time. If we let the first sample be Aω c / 2 instead of Aω c the two expressions for H d ( e jω ) are now exactly equal. Aω c / 2 is the average of the two limits at the point of discontinuity. This is consistent with Fourier transform theory which says that the Fourier representation at a discontinuity is the average of the two limits. * M. J. Roberts - All Rights Reserved 19

Impulse Invariant Design ( s) = 9.87 10 4 s 2 Let H a s 4 + 444.3s 3 + 2.467 10 6 s 2 + 5.262 10 8 s + 1.403 10 12 and let f s = 1000. h a h d H d ( t) = 246.07e 122.41t cos(1199.4t 1.48) + 200.5e 99.74t cos(977.27t + 1.683) [ n] = 246.07e 0.12241n cos(1.1994n 1.48) + 200.5e 0.09974n cos(0.97727n + 1.683) ( z) = 48.4z 3 107.7z 2 + 51.46z z 4 1.655z 3 + 2.252z 2 1.319z + 0.6413 u( t) u[ n] * M. J. Roberts - All Rights Reserved 20

Impulse Invariant Design * M. J. Roberts - All Rights Reserved 21

Impulse Invariant Design * M. J. Roberts - All Rights Reserved 22

Impulse Invariant Design * M. J. Roberts - All Rights Reserved 23

Step Invariant Design In step invariant design the analog unit step response is sampled to form the digital unit sequence response. h 1a Z h 1d ( ) H ( t) = L 1 a s s ( [ n] ) = z ( s) = z 1 H d h 1d ( z) H d ( z) = z 1 z [ n ] = h 1,a ( nt s ) 9.87 10 4 s 2 ( [ n] ) Z h 1d Let H a s 4 + 444.3s 3 + 2.467 10 6 s 2 + 5.262 10 8 s + 1.403 10 12 and let f s = 1000. * M. J. Roberts - All Rights Reserved 24

Step Invariant Design h 1d h 1a ( t) = 0.2041e 122.408t cos(1199.4t + 3.1312) u t +0.2041e 99.74t cos(977.27t + 0.01042) 0.2041 ( 0.8847 )n cos(1.1994n + 3.1312) +0.2041( 0.9051) n cos(0.97727n + 0.0102) [ n] = H d ( z) = 0.03443z3 0.03905z 2 0.02527z + 0.02988 z 4 1.655z 3 + 2.252z 2 1.319z + 0.6413 [ ] = 0.03443x[ n 1] 0.03905 x[ n 2] 0.02527 x[ n 2] + 0.02988x[ n 4]+1.655y[ n 1] 2.252 y[ n 2] + 1.319 y[ n 3] 0.6413y[ n 4] y n ( ) u[ n] * M. J. Roberts - All Rights Reserved 25

Step Invariant Design * M. J. Roberts - All Rights Reserved 26

Step Invariant Design * M. J. Roberts - All Rights Reserved 27

Step Invariant Design * M. J. Roberts - All Rights Reserved 28

Finite-Difference Design Finite-difference design is based on approximating continuous-time derivatives by finite differences. The transfer function H a implies the differential equation d dt derivative can be approximated by d dt [ ] y d [ n] y d n + 1 + ay d n T s ( y a ( t) ) + ay a t ( ) = x a t ( y a ( t) ) y n + 1 d T s ( s) = 1 s + a ( ). The [ ] y d [ n] [ ] = x d [ n] and the differential equation in. Then continuous time has become a difference equation in discrete time. Then we can form the discrete-time transfer function H d ( z) = Y d z z X d ( ) ( ) = T s ( ). z 1 at s * M. J. Roberts - All Rights Reserved 29

Finite-Difference Design A derivative can be approximated by a forward difference d dt ( y a ( t) ) y d n + 1 T s a backward difference d dt ( y( t) ) y n d [ ] y d [ n] [ ] y d [ n 1] T s or a central difference d ( y a ( t) ) y d n + 1 [ ] y d [ n 1] Z z 1 Y d ( z) T s Z 1 z 1 T s Y d z ( ) = z 1 ( ) zt s Y d z z z 1 Y d ( z) = z2 1 Y d ( z). 2T s 2zT s Z dt 2T s Since every multiplication by s represents a differentiation in time, finite difference design can be done by simply replacing s with a z-transform expression for a difference that approximates a derivative. * M. J. Roberts - All Rights Reserved 30

Finite-Difference Design Using a forward difference, H d ( z) = H a ( s) = 1 s + a Using a backward difference, H d ( z) = H a ( s) = Using a central difference, H d ( z) = H a ( s) = 1 s + a 1 s + a = s z 1 T s = s z 1 zt s = s z2 1 2zT s 1 z 1 + a T s 1 z 1 + a zt s 1 = T s z ( 1 at s ) = 1 z 2 1 + a 2zT s T s z 1 + at s 1 z 1 + at s = 2T s z z 2 + 2aT s z 1 * M. J. Roberts - All Rights Reserved 31

Finite-Difference Design Using the finite-difference technique it is possible to approximate a stable continuous-time filter by an unstable discrete-time filter. In H a ( s) = 1 s + a 1 ( z) = T s the pole is at s = a. In the digital filter H d z ( 1 at s ) the pole is at z = ( 1 at s ). If H a ( s) is stable, a > 0 and 1 at s is on the real axis of the z plane. If at s 2 the digital filter is unstable. One way to stabilize the design is to use a smaller value for T s, which implies a higher sampling rate. This design was based on using a forward difference. * M. J. Roberts - All Rights Reserved 32

Finite-Difference Design If we use a backward difference instead of a forward difference we get the digital filter H d ( z) = H a ( s) = = 1 s + a T s z 1+ at s s z 1 zt s ( ). z 1 / 1 + at s The pole is now at z = 1 / ( 1+ at s ) and is guaranteed to be inside the unit circle in the z plane, making this filter stable for any a > 0 and any T s. Using a backward difference in any digital filter design guarantees stability, but that guarantee comes at a price. The pole locations are restricted to a small region inside the unit circle. * M. J. Roberts - All Rights Reserved 33

( s) = Finite-Difference Design 9.87 10 4 s 2 Let H a s 4 + 444.3s 3 + 2.467 10 6 s 2 + 5.262 10 8 s + 1.403 10 12 and design a digital filter using the finite-difference technique with f s = 1000. H d ( z) = 0.169z 2 z 1 ( ) 2 z 4 1.848z 3 + 1.678z 2 0.7609z + 0.1712 * M. J. Roberts - All Rights Reserved 34

Finite-Difference Design * M. J. Roberts - All Rights Reserved 35

Finite-Difference Design * M. J. Roberts - All Rights Reserved 36

Matched z and Direct Substitution The matched-z and direct substitution digital filter design techniques use the correspondence z = e st s to map the poles and zeros of the analog filter to corresponding locations in the z plane. If the analog filter has a pole at s = a, the corresonding digital filter pole would be at z = e at s. The matched-z method replaces every factor of the form s a with the factor 1 e at s z 1 or z eat s the direct substitution method replaces it with the factor z e at s. Zeros are mapped in the same way. z and s = a z = e at s * M. J. Roberts - All Rights Reserved 37

Matched z and Direct Substitution Let H a ( s) = 9.87 10 4 s 2 s 4 + 444.3s 3 + 2.467 10 6 s 2 + 5.262 10 8 s + 1.403 10 12. Then, using the matched-z technique y n H d ( z) = 98700 z 2 ( z 1) 2 z 4 1.655z 3 + 2.252z 2 1.319z + 0.6413 [ ] + 98700 x[ n 2] [ ] = 98700 x[ n] 197400 x n 1 +1.655 y[ n 1] 2.252 y[ n 2] + 1.319 y[ n 3] 0.6413y[ n 4] * M. J. Roberts - All Rights Reserved 38

Matched z and Direct Substitution * M. J. Roberts - All Rights Reserved 39

Matched z and Direct Substitution * M. J. Roberts - All Rights Reserved 40

Matched z and Direct Substitution * M. J. Roberts - All Rights Reserved 41

The Bilinear z Method One approach to digital filter design would be to use the mapping z = e st s s ( 1 / T s )ln z z-domain expression H d ( ) to convert the s-domain expression to the ( z) = H a ( s) s ( 1/Ts ) ln( z). Unfortunately this creates a transcendental function of z with infinitely many poles. We can simplify the result by making an approximation to the exponential function. The exponential function is defined by e x = 1+ x + x2 2! + x 3 3! + = x k k! k =0 * M. J. Roberts - All Rights Reserved 42

The Bilinear z Transform We can approximate the exponential function by truncating its series definition to two terms e x 1 + x. Then z = 1+ st s or s z 1. This is exactly the same as the finite difference technique T s using forward differences and has the same drawback, the possibility of converting a stable analog filter into an unstable digital filter. A simple but very significant variation on this idea is to express e st s in the form est s /2 e st s /2 and then approximate both exponentials with the first two terms of the series. Then z = 1 + st s / 2 1 st s / 2 or s 2 z 1. This is T s z + 1 the basis of the bilinear digital filter design technique. * M. J. Roberts - All Rights Reserved 43

The Bilinear z Transform In the mapping s 2 T s z 1 z + 1 let s = jω. Then z = 2 + st s = 2 + jωt s = 1 tan 1 ( ωt s / 2) = e j 2 tan 1 ( ωt s /2) 2 st s 2 jωt s The ω axis of the s plane maps into the unit circle of the z plane. If s = σ + jω, σ < 0, the mapping is from the left half of the s plane to the interior of the unit circle in the z plane. If s = σ + jω, σ > 0, the mapping is from the right half of the s plane to the exterior of the unit circle in the z plane. * M. J. Roberts - All Rights Reserved 44

The Bilinear z Transform For real discrete-time frequencies Ω the correspondence between the s and z planes is s = 2 e jω 1 T s e jω + 1 = j 2 tan Ω T s 2 s = σ + jω, σ = 0 and ω= ( 2 / T s )tan Ω / 2. Then, since ( ). ( ) or Ω = 2 tan 1 ωt s / 2 * M. J. Roberts - All Rights Reserved 45

The Bilinear z Transform Let H a Then H d ( s) = 9.87 10 4 s 2 s 4 + 444.3s 3 + 2.467 10 6 s 2 + 5.262 10 8 s + 1.403 10 12. ( z) = 12.38 ( z + 1) 2 ( z 1) 2 z 4 1.989z 3 + 2.656z 2 1.675z + 0.711 * M. J. Roberts - All Rights Reserved 46

The Bilinear z Transform * M. J. Roberts - All Rights Reserved 47

The Bilinear z Transform * M. J. Roberts - All Rights Reserved 48

The Bilinear z Transform * M. J. Roberts - All Rights Reserved 49

FIR Filter Design An analog filter can be approximated by an FIR digital filter. The impulse response of the analog filter has infinite duration in time but beyond some time it has dropped to a very low value and the remainder beyond that time can be truncated with little change in the filter characteristics. We can create a digital FIR filter by sampling over that time. * M. J. Roberts - All Rights Reserved 50

FIR Filter Design We can also approximate ideal filters, which are non-causal, by truncating that part of the impulse response occurring before time n = 0 and later when the impulse response has fallen to a very low value. * M. J. Roberts - All Rights Reserved 51

FIR Filter Design The truncated impulse response has the form h N N 1 m=0 [ n] = a m δ n m [ ] where N is the number of samples retained. This type of FIR digital filter can be realized in Direct Form II. Its transfer function is H d N 1 ( z) = a m z m. m=0 * M. J. Roberts - All Rights Reserved 52

FIR Filter Design [ ], 0 n < N Let h N [ n] = h n d 0, otherwise impulse response of the digital filter where h d [ n] is the = h d [ n]w[ n] be the sampled ideal analog filter impulse response and w n a window function. Then the frequency response is H N ( e jω ) = H ( d e jω ) W( e jω ). The periodic convolution with W( e jω ) changes the frequency response from ideal and introduces ripple in the frequency response. [ ] is * M. J. Roberts - All Rights Reserved 53

FIR Filter Design Impulse response and frequency response of an FIR lowpass digital filter designed by truncating the ideal impulse response. * M. J. Roberts - All Rights Reserved 54

FIR Filter Design Impulse response and frequency response of an FIR lowpass digital filter designed by truncating the ideal impulse response. * M. J. Roberts - All Rights Reserved 55

FIR Filter Design Impulse response and frequency response of an FIR lowpass digital filter designed by truncating the ideal impulse response. * M. J. Roberts - All Rights Reserved 56

FIR Filter Design The digital filter impulse and frequency responses on the previous three slides were all formed by using a rectangular window of the form, w n. Other window 0, otherwise functions could be used to reduce the ripple in the frequency response. [ ] = 1, 0 n < N * M. J. Roberts - All Rights Reserved 57

FIR Filter Design von Hann Bartlett Hamming Blackman Kaiser w n Frequently-Used Window Functions [ ] = 1 2 1 cos 2πn w n w n w[ n] = N 1, 0 n < N 2n, 0 n N 1 N 1 2 2 2n N 1, N 1 n < N 2 2πn N 1, 0 n < N [ ] = 0.54 0.46cos [ ] = 0.42 0.5cos w[ n] = 2πn 4πn N 1 + 0.08cos N 1, 0 n < N 2 N 1 I 0 ω a 2 n N 1 2 N 1 I 0 ω a 2 2 * M. J. Roberts - All Rights Reserved 58

FIR Filter Design * M. J. Roberts - All Rights Reserved 59

FIR Filter Design * M. J. Roberts - All Rights Reserved 60

FIR Filter Design In studying the common types of windows in the last two slides it becomes apparent that in designing FIR filters two design goals are in conflict. The ideal filter has no ripple in the passband and the transition from the passband to the stopband is abrupt in frequency; it has no width. For a fixed window width, if we optimize the transition to be as quick as possible we must accept large ripple in the pass and stop bands. If we want to minimize passband and stopband ripple we must accept a slower transition between the passband and stopband. * M. J. Roberts - All Rights Reserved 61

FIR Filter Design The general form of an FIR impulse response is h d [ n] = h d [ 0]δ [ n] + h d [ 1]δ [ n 1] + + h d [ N 1]δ n N 1 and its z transform is H d ( z) = h d [ 0] + h d [ 1]z 1 + + h d [ N 1]z ( N 1) Let N be an even number and let the coefficients be chosen such that h d 0 ( ) [ ] = h d [ N 1], h d [ 1] = h d [ N 2],, h d [ N / 2 1] = h d [ N / 2] * M. J. Roberts - All Rights Reserved 62

FIR Filter Design The frequency response is H ( d e jω ) = h d [ 0] + h d [ 0]e j( N 1)Ω + h d [ 1]e jω + h d [ 1]e j( N 2)Ω + + h d [ N / 2 1]e j( N /2 1)Ω + h d [ N / 2 1]e jnω/2 which can be expressed in the form N 1 Ω h d [ 0]cos 2 Ω + h N 3 d [ 1]cos 2 Ω + + h d [ N / 2 1]cos( Ω) The phase of the frequency response is linear. This is usually a desirable H ( d e jω ) = 2e j N 1 2 result because it is the same as an ideal filter. By a similar process it can be shown that if the coefficients are anti-symmetric meaning [ ] = h d [ N 1], h d [ 1] = h d [ N 2],, h d [ N / 2 1] = h d [ N / 2] h d 0 that the phase is also linear and this holds true for N even or odd. * M. J. Roberts - All Rights Reserved 63

Optimal FIR Filter Design The Parks-McClellan algorithm is a technique for directly designing a filter by specifying its frequency response by multiple linear functions of frequency in multiple frequency bands separated by transition bands. In MATLAB the syntax is B = firpm(n,f,a) where B is a vector of N + 1 real symmetric coefficients in the impulse response of the FIR filter which is the best approximation to the desired frequency response described by F and A. (See the MATLAB help file for a more detailed description.) * M. J. Roberts - All Rights Reserved 64

Optimal FIR Filter Design Example Design an optimal FIR filter to meet this specification. * M. J. Roberts - All Rights Reserved 65

Optimal FIR Filter Design Example { } and the desired The band edges are Ω = 0, 0.6, 0.7, 2.2, 2.3,π amplitude responses at those band edges are A = { 0,0,1,1,0,0 }. The vector F should be F = Ω / π = { 0, 0.191, 0.2228, 0.7003, 0.7321,1}. N is the length of the filter and can be found by trying different values until filter specification is met. In this case N = 70 meets the specification. * M. J. Roberts - All Rights Reserved 66

Optimal FIR Filter Design * M. J. Roberts - All Rights Reserved 67