Nov '04CS3291: Section 61 UNIVERSITY of MANCHESTER Department of Computer Science CS3291: Digital Signal Processing Section 6 IIR discrete time filter.

Slides:



Advertisements
Similar presentations
Design of Digital IIR Filter
Advertisements

Digital Signal Processing IIR Filter IIR Filter Design by Approximation of Derivatives Analogue filters having rational transfer function H(s) can be.
Nonrecursive Digital Filters
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Filters and Difference Equations Signal Flow Graphs FIR and IIR Filters.
FILTERS Presented by: Mohammed Alani Supervised By: Dr. Nazila Safavi
Signal and System IIR Filter Filbert H. Juwono
Chapter 6 Infinite Impulse Response Filter Design.
24 Nov'09Comp30291 DMP Section 51 University of Manchester School of Computer Science Comp : Digital Media Processing Section 5 z-transforms & IIR-type.
CHAPTER 7 Digital Filter Design Wang Weilian School of Information Science and Technology Yunnan University.
ELEN 5346/4304 DSP and Filter Design Fall Lecture 8: LTI filter types Instructor: Dr. Gleb V. Tcheslavski Contact:
Filtering Filtering is one of the most widely used complex signal processing operations The system implementing this operation is called a filter A filter.
Infinite Impulse Response (IIR) Filters
So far We have introduced the Z transform
Digital Signal Processing – Chapter 11 Introduction to the Design of Discrete Filters Prof. Yasser Mostafa Kadah
Unit 9 IIR Filter Design 1. Introduction The ideal filter Constant gain of at least unity in the pass band Constant gain of zero in the stop band The.
AMI 4622 Digital Signal Processing
Ideal Filters One of the reasons why we design a filter is to remove disturbances Filter SIGNAL NOISE We discriminate between signal and noise in terms.
IIR Filter Design: Basic Approaches Most common approach to IIR filter design: (1)Convert specifications for the digital filter into equivalent specifications.
AGC DSP AGC DSP Professor A G Constantinides 1 Digital Filter Specifications Only the magnitude approximation problem Four basic types of ideal filters.
EE513 Audio Signals and Systems Digital Signal Processing (Systems) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
DSP. What is DSP? DSP: Digital Signal Processing---Using a digital process (e.g., a program running on a microprocessor) to modify a digital representation.
Fourier Analysis of Systems Ch.5 Kamen and Heck. 5.1 Fourier Analysis of Continuous- Time Systems Consider a linear time-invariant continuous-time system.
Sept'05CS32911 CS3291 Sect 2: Review of analogue systems Example of an analogue system: Represent as “black box” R C y(t) x(t) y(t)
Chapter 7 IIR Filter Design
Nov'04CS3291: Section 41 University of Manchester Department of Computer Science CS3291 Digital Signal Processing '04-'05 Section 4: ‘A design technique.
16 Oct'09Comp30291 Section 31 University of Manchester School of Computer Science Comp30291: Digital Media Processing Section 3 : Discrete-time.
IIR Filter design (cf. Shenoi, 2006) The transfer function of the IIR filter is given by Its frequency responses are (where w is the normalized frequency.
Chapter 8 Design of infinite impulse response digital filter.
Oct'04CS32911 CS3291 : Digital Signal Processing '04-05 Section 3 : Discrete-time LTI systems 3.1Introduction: A discrete time system takes discrete time.
Nov'04CS3291 DSP Sectn 51 University of Manchester Department of Computer Science CS 3291 : Digital Signal Processing Section 5: z-transforms & IIR-type.
Lecture 10a Infinite Impulse Response (IIR) Filters.
Dan Ellis 1 ELEN E4810: Digital Signal Processing Topic 8: Filter Design: IIR 1.Filter Design Specifications 2.Analog Filter Design 3.Digital.
Nov '04CS3291: Section 61 Baseado no material da: UNIVERSITY of MANCHESTER Department of Computer Science CS3291: Digital Signal Processing Section 6 IIR.
Ch.10 Design of Digital Filters and Controllers Discretization The sampled signal x s (t) = x(t) p(t) where p(t) is the sampling pulse signal, with.
Chapter 7 Finite Impulse Response(FIR) Filter Design
1 Introduction to Digital Filters Filter: A filter is essentially a system or network that selectively changes the wave shape, amplitude/frequency and/or.
Chapter 9-10 Digital Filter Design. Objective - Determination of a realizable transfer function G(z) approximating a given frequency response specification.
1 Conditions for Distortionless Transmission Transmission is said to be distortion less if the input and output have identical wave shapes within a multiplicative.
IIR Digital Filter Design
Ch. 8 Analysis of Continuous- Time Systems by Use of the Transfer Function.
Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013)1 BME 452 Biomedical Signal Processing Lecture 5  Digital filtering.
Chapter 7. Filter Design Techniques
1 Digital Signal Processing Digital Signal Processing  IIR digital filter structures  Filter design.
Signals and Systems Filter Design. Part III Design.
Z Transform The z-transform of a digital signal x[n] is defined as:
Nov '03csDSP61 CS3291: Section 6 IIR discrete time filter design Introduction: Many design techniques for IIR discrete time filters have adopted ideas.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, MGI,India DTEL DTEL (Department for Technology.
FILTER DESIGN Ideal Filter Magnitude Response NumericLogaritmic.
DISP 2003 Lecture 5 – Part 1 Digital Filters 1 Frequency Response Difference Equations FIR versus IIR FIR Filters Properties and Design Philippe Baudrenghien,
15 Oct 2009Comp30291 Section 21 UNIVERSITY of MANCHESTER School of Computer Science Comp30291: Digital Media Processing Section 2 Analogue filtering.
Digital Signal Processing Lecture 6 Frequency Selective Filters
Lecture 09b Finite Impulse Response (FIR) Filters
Finite Impulse Response Filtering EMU-E&E Engineering Erhan A. Ince Dec 2015.
Digital Signal Processing
IIR Filter design (cf. Shenoi, 2006)
UNIT - 5 IIR FILTER DESIGN.
Lecture: IIR Filter Design
IIR Filters FIR vs. IIR IIR filter design procedure
Infinite Impulse Response (IIR) Filters
EE Audio Signals and Systems
Chapter 8 Design of Infinite Impulse Response (IIR) Digital Filter
ME2300 DIGITAL SIGNAL PROCESSING [Slide 6] IIR Filter Design BY DREAMCATCHER
University of Manchester School of Computer Science
Infinite Impulse Response Filters
Analogue filtering UNIVERSITY of MANCHESTER School of Computer Science
Ideal Filters One of the reasons why we design a filter is to remove disturbances Filter SIGNAL NOISE We discriminate between signal and noise in terms.
Usıng the impulse sampling method Prepared by: Dr. Erhan A. INCE
Chapter 6 Discrete-Time System
Tania Stathaki 811b LTI Discrete-Time Systems in Transform Domain Simple Filters Comb Filters (Optional reading) Allpass Transfer.
IIR Digital Filter Design
Presentation transcript:

Nov '04CS3291: Section 61 UNIVERSITY of MANCHESTER Department of Computer Science CS3291: Digital Signal Processing Section 6 IIR discrete time filter design

Nov '04CS3291: Section Introduction: Many design techniques for IIR discrete time filters have adopted ideas of analogue filters Transform H a (s) for analogue ‘prototype’ filter into H(z) for discrete time filter. Begin with a reminder about analogue filters Analogue filters

Nov '04CS3291: Section 63 Analogue filters have transfer functions: a 0 + a 1 s + a 2 s a N s N H a (s) =  b 0 + b 1 s + b 2 s b M s M Replace s by j  for frequency-response. For RE(s)  0, H a (s ) is Laplace Transform of h a (t). In terms of poles and zeros: (s - z 1 ) ( z - z 2 )... ( s - z N ) H a (s) = K  (s - p 1 ) ( z - p 2 )... ( s - p M ) Many known techniques for deriving H a (s); e.g. Butterworth low-pass approximation Analogue filters have infinite impulse-responses.

Nov '04CS3291: Section 64 Analogue Butterworth low-pass filter of order n [n/2] is integer part of n/2 & P = 0 /1 if n is even / odd

Nov '04CS3291: Section 65

Nov '04CS3291: Section 66

Nov '04CS3291: Section 67

Nov '04CS3291: Section 68 y(t) + RC dy(t)/dt = x(t) Take Laplace transforms: Y(s) + RC sY(s) = X(s) Y(s) 1 H a (s) =  =  X(s) 1 + RC s 1 1 G a (  ) =  H a (j  )  =  =   1 + RC j   [ 1 + (  /  C ) 2 ]  C = 1/(RC) Shown graphically when  C = 1 y(t)x(t) 6.3 First order RC filter R C

Nov '04CS3291: Section 69 Gain-response of RC filter

Nov '04CS3291: Section 610 Impulse response:-  0 : t < 0 h a (t) =   (1/[RC]) e - t / (R C) : t  0 How to transform this filter to a discrete time filter?

Nov '04CS3291: Section 611 Example: A filter has system function H(s) = (1+s) / (1 + 2 s + 3 s 2 ). What is its differential equation. Solution: y(t) + 2dy(t)/dt + 3 d 2 y(t)/dt 2 = x(t) + dx(t)/dt It’s easy!

Nov '04CS3291: Section 612 Transform an analogue filter with transfer functn H(s) into a digital filter. Many ways exist. We consider four.

Nov '04CS3291: Section Firstly, dispose of a method that will not work. Replacing s by z (or z -1 ) in H a (s) to obtain H(z). Taking previous example with RC = 1: 1 1 H a (s) =  H(z) =  1 + s 1 + z H(z) has pole at z = -1. Even if we moved it to z=0.99, still no good:-

Nov '04CS3291: Section 614 With pole at z=-0.99, what does gain-response look like? High-pass instead of low pass. Forget this one.  G(  ) 

Nov '04CS3291: Section 615 Substituting : y[n] + RC ( y[n] - y[n-1] ) / T = x[n] (1 + RC/T) y[n] = x[n] + (RC/T) y[n-1] y[n] = a 0 x[n] - b 1 y[n-1] a 0 = 1/(1+RC/T), b 1 = -RC / (T + RC) Recursive diffnce eqn. 6.5 “Derivative approximation” technique Differential equn of RC filter is: y(t) + RC dy(t)/dt = x(t) Sample x(t), y(t) at T seconds to obtain x[n] & y[n]. Assuming T small:

Nov '04CS3291: Section 616 Signal flow graph for y[n] = a 0 x[n] - b 1 y[n-1]

Nov '04CS3291: Section 617 For analogue filter :  C = 1/(RC) rad/s. To make cut-off 500 Hz: RC = 1 / (2  x 500) = Let T = s, (f S =10 kHz.) a 0 = 1/(1 + RC/T) = b 1 = - RC/(T + RC) = Difference equation is: y[n] = 0.24 x[n] y[n-1] H(z) =  H a (s) =  ( z - 1 ) 1 + s/(500  2  )  H(e j  )  2 =   H(j  )  2 =  cos(  ) 1 + (  / 3142) 2

Nov '04CS3291: Section 618 Compare gain-responses:- Shapes similar, but not exactly the same. Replaces s by (1 - z - 1 )/T Not commonly used

Nov '04CS3291: Section “Impulse-response invariant” technique Transforms analog prototype to IIR discrete time filter. See text-books Not on exam

Nov '04CS3291: Section 620 Intro to Bilinear Transformation method Most common method for transforming H a (s) to H(z) for IIR discrete time filter. Consider derivative approximation technique: D[n] = dy(t) /dt at t=nT  ( y[n] - y[n-1]) / T. dx(t) /dt at t=nT  (x[n] - x[n-1]) / T. d 2 y(t)/dt 2 at t=nT  (y[n] - 2y[n-1]+y[n-2])/T 2 d 3 y(t)/dt 3 at t=nT  (y[n]-3y[n-1]+3y[n-2]-y[n-3])/T 3 “Backward difference” approximation introduces delay which becomes greater for higher orders. Try "forward differences" : D[n]  [y[n+1] - y[n]] / T, etc. But this does not make matters any better.

Nov '04CS3291: Section 621 Bilinear approximation: 0.5( D[n] + D[n-1])  (y[n] - y[n-1]) / T & similarly for dx(t)/dt at t=nT. Similar formulae may be derived for d 2 y(t)/dt 2, and so on. If D(z) is z-transform of D[n] : 0.5( D(z) + z -1 D(z) ) = ( Y(z) - z -1 Y(z) ) / T

Nov '04CS3291: Section 622  replacing s by [ (2/T) (z-1)/(z+1)] is bilinear approximation. If LT of y(t) is Y(s) LT of dy(t)/dt is sY(s). s y(t) dy(t)/dt (2/T) (z-1)/(z+1) {y[n]}  {dy(t)/dt / t=nT }

Nov '04CS3291: Section Bilinear transformation: Most common transform from H a (s) to H(z). Replace s by (2 / T) (z-1) / (z+1) to obtain H(z). For convenience take T=1. Example 1 1 H a (s) =  then H(z) =  1 + RC s 1 + RC z + 1 =  (1 + 2RC)z + (1 - 2RC)

Nov '04CS3291: Section 624 Re-express as: 1 + z - 1 H(z) = K  1 + b 1 z - 1 where K = 1 / (1 + 2RC) & b 1 = (1 - 2RC) / (1 + 2RC) Properties: (z - 1) (i) H(z) = H a (s) where s = 2  (z + 1) (ii) Order of H(z) = order of H a (s) (iii) If H a (s) is causal & stable, so is H(z). (iv) H(e j  ) = H a (j  ) where  = 2 tan(  /2)

Nov '04CS3291: Section 625 Proof of (iii): Let z p be a pole of H(z). Then s p must be a pole of H a (s) where s p = 2 (z p - 1) / (z p + 1). If s p = a + jb then (z p + 1)(a + jb) = 2 (z p - 1), a jb (a + 2) 2 + b 2  z p =  and  z p  2 =  -a jb (2 - a) 2 + b 2 Now a < 0 as H a (s) is causal & stable,   z p  must be < 1.  if all poles of H a (s) have real parts < 0, all poles of H(z) must lie inside unit circle.

Nov '04CS3291: Section 626 Proof of (iv): When z = e j , then e j  - 1 2(e j  / 2 - e - j  / 2 ) s = 2  =  e j  + 1 e j  / 2 + e -j  / 2 2( 2 j sin (  / 2) =  2 cos (  / 2) = 2 j tan(  / 2)

Nov '04CS3291: Section 627 Frequency warping: By (iv), H(e j  ) = H a (j  ) with  = 2 tan(  /2).  from -  to  mapped to  in the range -  to .

Nov '04CS3291: Section 628 Mapping approx linear for  in the range -2 to 2. As  increases above 2, a given increase in  produces smaller and smaller increases in .

Nov '04CS3291: Section 629 Comparing (a) with (b) below, (b) becomes more and more compressed as    . Frequency warping must be taken into account with this method

Nov '04CS3291: Section Design of IIR low-pass filter by bilinear transfm Given cut-off frequency  C in radians/sample:- (i) Calculate  C = 2 tan(  C /2) radians/sec. (  C is "pre-warped" cut-off frequency) (ii) Find H a (s) for analogue low-pass filter with 1 radian/s cut-off. (iii) Scale cut-off frequency of H a (s) to  C (iv) Replace s by 2(z - 1) / (z+1) to obtain H(z). (v) Rearrange the expression for H(z) (vi) Realise by biquadratic sections.

Nov '04CS3291: Section 631 Example Design 2 nd order Butterworth-type IIR low-pass filter with  C =  / 4. Solution: Prewarped frequency  C = 2 tan(  / 8) = Analogue Butterworth low-pass filter with c/o 1 radian/second: 1 H a (s) =  1 +  2 s + s 2 Scale c/o to 0.828, 1 H a (s) =  1 +  2 s/ (s/0.828) 2 then replace s by 2 (z+1) / (z-1) to obtain: z 2 + 2z + 1 H(z) =  z z + 3.4

Nov '04CS3291: Section 632 which may be realised by the signal flow graph:-

Nov '04CS3291: Section Higher order IIR digital filters: Normally cascaded biquad sections. Example 6.3: Design 4th order Butterwth-type IIR low-pass digital filter with 3 dB c/o at f S / 16.. Solution: (a) Relative cut-off frequency is  /8. Prewarped cut-off :  C = 2 tan((  /8)/2)  0.4 radians/s. Formula for 1 radian/s cut-off is: Replace s by s/0.4 then replace s by 2 (z-1) / (z+1) to obtain:

Nov '04CS3291: Section 634 H(z) may be realised as:

Nov '04CS3291: Section 635

Nov '04CS3291: Section 636 Compare gain-response of 4th order Butt low-pass transfer function used as a prototype, with that of derived digital filter. Both are 1 at zero frequency. Both are at the cut-off frequency. Analogue gain approaches 0 as    whereas digital filter gain becomes exactly zero at  = . Shape of Butt gain response is "warped" by bilinear transfn. For digital filter, cut-off rate becomes sharper as    because of the compression as   .

Nov '04CS3291: Section High-pass band-pass and band-stop IIR filters Apply bilinear transformation to H a (s) obtained by frequency band transformations. Cut-off frequencies pre-warped to find analog c/o frequencies. Example: 4th order band-pass filter with  L =  /4,  u =  /2. Solution: Pre-warp both cutoff frequencies:  L = 2 tan ((  /4)/2) = 2 tan(  /8) = 0.828,  u = 2 tan((  /2)/2)) = 2 tan(  /4) = 2 Need 4 th order H a (s) with pass-band  L to  U. Start from 2nd order Butt 1 radian/sec: H a (s) = 1 / (s 2 +  2 s + 1). Replace s by (s ) / 1.17 s to obtain: 1.37 s 2 H a (s) =  s s s s

Nov '04CS3291: Section 638 We have a problem as the denominatr is not product of 2nd order expressions in s. We have to re-express it in this form. This cannot be done without a computer! One way is to find the roots of the denom using MATLAB: roots([ ]) j j j j (s - ( j ) ) (s - ( j ) ) = ( s s ) (s - ( j) ) ( s - ( ) ) = (s s )

Nov '04CS3291: Section 639 After factorising (using MATLAB): 1.37 s 2 H a (s) =  (s s +3.18)(s s ) Replace s by 2(z - 1)/(z + 1): (z - 1) 2 (z + 1) 2 H(z) =  (9.4 z z + 5 ) ( 6 z z + 3.7)

Nov '04CS3291: Section 640 Rearrange into 2 biquad sections:  z -1 + z - 2  z z - 2 H(z) = 0.1      z z -2  z z -2  whose gain response is:

Nov '04CS3291: Section 641 There are alternative ways of converting H a (s) into second order sections (SOS) in the MATLAB SP tool-box. Can replace s by 2(z - 1)/(z + 1) in the ‘4th order sectn’ expression for H a (s) then use [sos G] = tf2sos ([a 4 a 3 a 2 a 1 a 0 ], [b 4 … b 0 ]) tf2sos does not like functions of s. So we have to convert to a digital filter before using it. ‘help tf2sos’ to find out abt this function I will try to find a more elegant way of doing this one day!

Nov '04CS3291: Section 642 Option of cascading high pass & low-pass digital filters to give band-pass or band-stop filters must be used with care. It is much simpler & avoids the factorisation problem. Calculate  U &  L by prewarping  U &  L Then make sure that analogue prototype is wide-band i.e.  U >> 2  L before applying bilinear transformatn. If it’s not wide-band, use the factorisation method. High-pass filters are easy: Apply transformation s   C /s to H a (s) for a 1 radian/s low-pass filter where  C is prewarped c/o freq. Then apply the bilinear transformation as usual.

Nov '04CS3291: Section 643 Final note: All these design techniques, and many more, are available in the MATLAB SP toolbox. End of ‘bilinear transformation’ method

Nov '04CS3291: Section Comparison of IIR and FIR digital filters: Advantage of IIR type digital filters: Economical in use of delays, multipliers and adders. Disadvantages: (1) Sensitive to coefficient round-off inaccuracies & effects of overflow in fixed point arith. These effects can lead to instability or serious distortion. (2) An IIR filter cannot be exactly linear phase.

Nov '04CS3291: Section 645 Advantages of FIR filters: (1) may be realised by non-recursive structures which are simpler and more convenient for programming especially on devices specifically designed for DSP. (2) FIR structures are always stable. (3) Because there is no recursion, round-off and overflow errors are easily controlled. (4) An FIR filter can be exactly linear phase. Disadvantage of FIR filters: Large orders can be required to perform fairly simple filtering tasks.

Nov '04CS3291: Section 646 Problems: 1 Find H(s) for 3rd order Butterwth low-pass filter with  C = Find H(s) for 3 nd order Butterworth low-pass analog filter with cut-off  C Give its differential equation. Apply derivative approx technique to derive 3rd order IIR Butterwth-type digital filter with cut-off 500 Hz where f S = 10 kHz. 3. A 3rd order low-pass IIR discrete time filter is required with 3 dB cut-off at f S /4. Apply bilinear transfn to Butterwth low- pass transfer function to design it & give its signal flow graph as 2nd & 1st order sections in serial cascade. 4. Give program to implement 3rd order IIR filter above in floating point arithmetic. Then do it in fixed point arithmetic. 5. Low-pass IIR digital filter required with cut-off at f s / 4 & stop- band attenuation at least 20 dB for all frequencies above 3f s /8 & below f s /2. Design by bilinear transfn applied to H(s) for Butterwth low-pass, showing that minimum order required is 3.

Nov '04CS3291: Section Butterworth-type IIR low-pass digital filter needed with 3 dB c/o at f S / 16. Attenuation must be at least 24 dB above f S / 8. What order is needed? Solution: (a) Relative cut-off frequency is  /8. Prewarped cut-off :  C = 2 tan((  /8)/2)  0.40 radians/s. For n t h order Butt low-pass filter with cutoff  C, gain is: 1  H a (j  )  =   [1 + (  /0.4) 2 n ] Gain of IIR filter must be < -24dB at  =  /4.   H a (j  )  must be < -24 dB at  = 2 tan((  /4)/2)  0.83  20 log 1 0 (1/  [1+(.83/.4) 2 n ]) Hence 1 + (2.1) 2 n > = n > 251 n = 4 is smallest possible

Nov '04CS3291: Section Design a 4th order band-pass IIR digital filter with lower & upper cut-off frequencies at 300 Hz & 3400 Hz when f S = 8 kHz. 8. Design a 4th order band-pass IIR digital filter with lower & upper cut-off frequencies at 2000 Hz & 3000 Hz when f S = 8 kHz 9. (This is really for Sectn 5). What limits how good a notch filter we can implement on a fixed point DSP processor? In theory we can make notch sharper & sharper by moving poles closer & closer to zeros. What limits us in practice. I wonder how sharp a notch we could get in 16-bit fixed pt arithmetic?