Presentation is loading. Please wait.

Presentation is loading. Please wait.

EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 8 IIR FILTER DESIGN.

Similar presentations


Presentation on theme: "EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 8 IIR FILTER DESIGN."— Presentation transcript:

1 EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 8 IIR FILTER DESIGN

2 IIR based Digital Filters: The design uses the analog prototype of given specifications. For the given specifications, IIR filters yield much smaller order of the filter. Hence requires much less number of elements. Appropriate mapping and spectral transformation is carried out to result in a desired digital filter.

3 The object is to: Investigate the relationship between s- and z- domains. Workout the equivalence of analog and digital systems. To study the different mapping rules and response matching.

4 Equivalence of analog and digital systems: The approximate continuous time domain impulse response h(t) at the sampling interval t s (=1/f s ) is: h(t)  h a (t) = t s  h(t)  (t-kt s ) = t s  h(kt s )  (t-kt s ); k =[- ,  ]. For the normalized sampled time impulse response, the sampling period t s is 1s and replacing t by n : h s [n] =  h s [k]  [n-k] for k =[- ,  ].

5 Equivalence of analog and digital systems: For k  [- ,  ], the Laplace transform of h a (t)= t s  h(kt s )  (t-kt s ) is H(s)  H a (s) = t s  h(kt s ) exp(-st s )k and z-transform H(z) of normalized h s [n] is: h s [n] =  h s [k]  [n-k] is H d (z) =  h s [k]z -k

6 Equivalence ….. Thus for z k = exp(skt s ), H a (s) = t s H d (z) the conditions can be rewritten as z  exp(st s ) and s  ln(z)/t s. These relationships describe a mapping between variables s and z: z = exp(  j  )t s = exp(  t s ) exp(j  t s ) = exp(  t s ) exp(j  ) Here  =  t s = 2  f/f s = 2  F, where F is the digital frequency in cycles/sample t s is the sampling rate per second  is the analog frequency in radians per second..

7 …..and mapping The DTFT of h s [n] has a periodic spectrum. Therefore ensure that the analog signal h(t) is strictly band-limited and moreover, to obliterate aliasing, is sampled much above the Nyquist rate The normalized band of frequency should lie well within the principal period of H p (f) –0.5  F  0.5.

8 aliasing revisited: The relationships z  exp(st s )  s  ln(z)/t s does not describe a unique mapping between the s-plane and the z-plane. Since exp(j  ) has a period of 2  ; frequencies beyond , such as    k  f s are also mapped on the same circle after  k . Thus a one to one mapping is possible only if the signal is restricted in the range f/f s = F =  0.5. Im z Re z z-plane 1 j   s-plane 3  /T  /T -  /T -3  /T

9 Notes … The logarithmic nature of the transformation s  ln(z)/t s, being a infinite series,, does not convert a rational TF H(s) into a rational TF H(z). The unique representation is true only for band limited signals, those lie well within the principal range. The spectra of such band limited signal repeats at every sampling frequency. If the signal is not band-limited, it will cause inherent aliasing (introduction of corrupted signal in the principal region).

10 Notes…. We need to study the practical mappings. The methods are: Use of standard z-transform: Equivalent finite element integrators. Other methods (not discussed) w-v transform z-forms etc.

11 Use of standard z-transform  These filters use standard z-transform. Therefore the intelligence has to be band limited. The Impulse invariant filter preserves time response. The Matched z-transform filters preserves frequency response. Aliasing is severe. Use high sampling rate. Impulse invariant filters and Matched z-transform filters

12 Impulse Invariance filter mapping It is designed to preserves time response of analog filters using standard z-transform. The mapping rule is: s=ln(z)/ T For compatible frequency response, sampling frequency should be considerably high. The signal should be strictly band-limited.

13 Matched z-transform Factored form of s-domain transfer function is used. Individual singularity is transformed using the standard z-transform. (s-a) = (1-z -1 e aT )= z/(z-e aT )  Characteristic polynomial (denominator) of this and Impulse invariant method are same. It is due to the use of standard z-transform. The zeros are different.  The filter so obtained preserves the frequency response of the analog counterpart, though exhibits considerable distortion.  Standard z-transform related filters should be band limited.

14 Equivalent Integrator: The basic philosophy: The simulation element in signal processing is Integrator. It is (1/s) in Laplace Transform. Different numerical methods of integration are used to create equivalence. They are grouped as : Backward difference, Forward difference, Trapezoidal integration, Simpson’s integration. [not used,increases the order of filter] “ Philips CL,+ Nagle HT, “ Digital Control System Analysis and Design” 3/e, PH Ch.11

15 Backward Difference: (right side rectangular rule) Difference of present and the past sample.  y[t] = y(t) – y(t-T) It’s Laplace transform: sY(s) = [Y(s) – e -sT Y(s)]/T + Y(0 + ) letting Y(0 + )=0, we get: s = (1- e -sT )/T = (1-z -1 )/T Or, z = 1/(1-Ts) = ½ [(1-sT)+(1+sT)]/(1-sT) = ½ [(1- (1+sT)/(1-sT)]; 1/s = T/(1-z -1 ) It is not the z transform of 1/s

16 Backward Difference: (right side rectangular rule) z = ½ [(1- (1+sT)/(1-sT)]; replacing s = j  returns: = ½ [1+ e j2arctan(  T) ] = ½ [1+e j  ]. Mapping left half of j  axis of s-plane into a circle of radius ½ centered at (½,0) in z plane. The region enclosed is very small. If our frequency extends little beyond s=0 or, z=1, there will be severe distortion. Sampling Frequency should be increased to improve the performance.

17 Forward Difference: left side rectangular rule It is the difference between present pulse and forth coming pulse.  y[t] =[y(t+T)- y(t)]/T It’s Laplace transform: s = (z-1)/T z = 1+Ts = 1+ j  T This mapping only shifts j  axis to right by 1. It can make a stable filter into unstable one.

18 Impulse Invariance Integrator, backward difference Integration and right side rectangular integration. Step invariance Integrator, forward difference integration and Left side rectangular integration. In literature: Same mapping rule for

19 Bilinear z-transform Mapping It does not require band limitation. Pre warping of analog frequency is essential before bilinear z-transformation for suitable matching of frequency response. Most suitable for polynomial based flat response filters. Uses Trapezoidal Integration rule.

20 Algorithms for Bilinear Transformation This transformation follows the trapezoidal interpolation rule, or, Tustin’s rule, and is represented by the numerical integration algorithm: y[n] = y[n-1] + (t s /2){x[n] + x[n-1]}. So that: H(z) = 0.5 t s [z+1]/[z-1] And equating with integration rule in s-domain. H(s)  1/s. Thus s = (2/t s ){(z–1) / (z+1)}

21 The time-response matching The idea behind response matching is to match the time-domain analog and digital response at the sampling instants t = t s for a given input. One way to achieve the response is as under. The example below will illustrate that the H[z] is excitation specific.  s-domain input t-domain input  analog filter in s-domain  output in s-domain  output in t-domain  output sampled @ t s  output Y[z]  input sampled @ t s  Input X[z] hence: H[z] = Y[z]/X[z].

22 Time response matching…

23 Example 10.01 Convert analog filter of transfer function H(s) = 1/(s+1) into a digital filter H[z] for (a) impulse input (b) unit step input. Soln: (a) Impulse input : x(t) =  (t)  X(s) = 1; H(s) = 1/(s+1), output Y(s) = 1/(s+1) or, y(t) = e -t U(t). the sampled version is y(nT) = e -nT U[n]. And at n=0, y(nT) = 1.

24 Example 7.01 Letting sampling time t s = 1, for impulse input, we get H[z] = Z e -nT U[n] =1/[1-e -1 z -1 ] =1/[1- 0.3679 z -1 ]. We thus note:  The DC gain H[z=1] = 1.582 while it at H(s=0) =1.  This increase is solely due to aliasing.  Even if the DC gain is normalized, the frequency characteristics does not match. It is shown in Magnitude plot of Fig. 7.02 (a) and (b).  This can be remedied by higher rate of sampling. But it makes it unsuitable for HP and BP filters.

25 Normalized amplitude response:

26 Phase response

27 Time response of Impulse Invariance digital filters and equivalent analog filter:  note similarity in time response.

28 Response with step input: Step response of the filter H[z] = z / [z-0.3679] is Y[z] = z 2 / [z-1][z – 0.3679] Inverse Z-transform is y[n] = 1.5820U[n]–0.214 (0.3679) -n U[n] =1.5820[1-0.1353(0.3679) -n ]U[n].

29 Magnitude-frequency response for step input

30 Remarks on impulse invariant method: Comparison of response in analog domain filters and impulse invariant method in digital domain while the frequency and phase plots are not alike, the time response at the sampling intervals is same in analog and impulse invariant digital filters the time response is remarkably different from its analog counterpart for step input. This clearly illustrates that this scheme is excitation specific.

31 Why Bilinear Transformation Due to high rate of sampling, Impulse invariant filters (IIF) are not suitable for high pass/band reject/all-pass modes while matched-z filters can not realize LPF. Frequency response does not match with those of analog filters in IIF while there is a distortion in matched-z. Aliasing problem in both cases.

32 Bilinear Transformation Alternatively a transformation is attempted which converts 0 to 2  change in   [0 to  ]. Thus the circle of z-domain is converted onto entire j  -axis with one to one mapping. This eliminates the aliasing problem. It is BILINEAR TRANSFORMATION

33 s- and z- planes mapping- we want

34 The relationship between analog and digital frequency : s = (2/t s )[(z-1)/(z+1)] Putting s = j , and z = e j  j  =(2/t s )[(e j  -1) / (e j  +1)] =(2/t s )[{e j  /2 (e j  /2 – e -j  /2 )} / {e j  /2 (e j  /2 + e -j  /2 )}] =(2/t s )[(e j  /2 – e -j  /2 )/ (e j  /2 + e -j  /2 )] =j(2/t s )sin(  /2)/cos(  /2) Or,  = (2/t s )tan(  /2)   = 2 tan -1 (  t s /2)

35 Frequency Warpage in BLT: The graph between  and  for t s =1, red color, is non-linear implying that the warpage has been introduced in the frequency translation. Blue color graph for  is drawn for understanding.

36 Working out frequency in BLT:  = (2/t s )tan(  /2) and  = 2 tan -1 (  t s /2) The above is a non linear or warped characteristic. It has one to one mapping between s and z domains. For  ;  /2. To undo this frequency warping, we pre-warp the analog frequency    p in s-plan so that:  p t s /2 = tan(  t s /2).

37 Linearization of relationship After frequency prewarping  p t s /2 = tan(  t s /2) The Digital frequency becomes:  = 2 tan -1 (  p t s /2) = 2 tan -1 tan(  t s /2) = (2/t s )(  t s /2); we get a linear relation:  = .

38 More over due to carrying out the prewarping, the term 2/t s turns out to be redundant as it cancels out in calculations. Therefore we can individually use: s = (z-1)/(z+1)  p = (2/t s )tan(  t s /2). Or, combining the two: s = cot (  t s /2) (z-1)/(z+1). [Ifeacher et al,”Digital signal Processing’ 2/e, Prentice Hall, pp 473-500.

39 Example: 10.02 Using un-prewarped bilinear transformation and impulse invariance technique synthesize: H(s) =  c /(s+  c ),  c = 105. 1. Bilinear Transformation Method: Putting the transformation s =(2/t s )[(z-1) / (z+1)]; we get; H[z} =  c /[(2/t s )[(z-1) / (z+1)] )+  c ] =  c T(z+1)/(2+  c T)z – (2 -  c T). Selecting the value of T such that T <<  /  c say = 0.1  /  c, H[z] = 0.1357(z +1)/[z- 0.7284] Lathi B.P.,”Signal Processing and Linear Systems” 1998, Oxford

40 Ex. 9.02 contd. Thus |H(e j  T )| =  0.024(1+cos (  10 -6 )/ (1-0.9518cos(  10 -6 ) and  H(e j  T ) = tan -1 [sin(  10 -6 )/ [1+ cos(  10 -6 )] - tan -1 [sin(  10 -6 )/[cos(  10 -6 )-0.7285].

41 Ex.9.02: Impulse Invariance Technique x(t) =  (t), X(s) = 1; H(s) =  c /(s+  c ), output Y(s) =  c /(s+  c ) y(t) =  c exp(-  c t) U(t). Sampled version is y (nT) = exp(-  c nT)U[n]. Therefore H[z] = Y[z]/X[z] Y[z] =  c Tz /[z-exp(-  c T)] For T = 0.1  /  c, as above, H[z] = 0.3142z/[z- 0.7304] Thus |H(e j  T )| = 0.1   [1.533 – 1.4608cos((  10 -6 )] and  H(e j  T ) = -tan -1 [0.7304 sin(  10 -6 )/ [10.7304cos(  10 -6 )]

42 Ex. 09.02: Magnitude function:

43 Ex. 9.02:: Phase function

44 Ex. 10.03: Design an IIR digital filter for T = 2 sec and the transfer function of analog filter given as: H(s) = (s+a)/{(s+a) 2 + b 2 }. where a = 0.1, b = 3. Impulse invariance method: Inverse Laplace transform is: h(t) = e -at cos(bt) U(t). Letting T = t s, the discrete time output is: h[nT] = e -anT cos[bnT] U[nT]; Z-transform of above is H[z] = (z 2 -e -0.2 cos[6] z) / {z 2 - 2e -0.2 cos[6] z +e -0.4 }.

45 Ex. 9.03: Bilinear transformation method without ( pre-warping H(s) = (s+0.1)/{(s+0.1) 2 +9} replace s by 2/T) {(z-1)/(z+1)}, H(z) = 0.1077{(z 2 + 0.18 z – 0.82) / (z 2 + 1.569z + 0.96)}

46 Ex.9.03: Magnitude plots

47 Ex.9.03: Phase Plots

48 Ex. 10.03: Design an IIR digital filter for the TF of analog filter given as: H(s) = (s+a)/{(s+a) 2 + b 2 }. where [a,b] =[0.1,3] and the resonant frequency  r =  /4. with pre-warping. The sampling time, given that b =  c = 3; Using the relation:  =2 tan -1 (  t s /2) and replacing   c and  c ; t s = (2/  c ) tan(  c /2) = (2/3)tan(  /8)=0.276. H(z) = N(z)/D(z) = H(s) for s = (2/T)(z-1)/(z+1) N(z) = (2/0.276){(z-1)/(z+1)} + 0.1 D(z) = N 2 (z) + 9. H(z) = [1+0.027z -1 -0.973z -2 ]/[8.572 –11.84z -1 +8.177z -2 ] [Salivahanan, “DSP” Mcgraw Hills, p.429-430]

49 BZT Bilinear transformation method are useful when the gains are constant over certain frequency bands. This condition exists in low- pass, band-pass, high-pass and band-stop filters. This method requires lower sampling rate compared to Impulse Invariance Method because of absence of aliasing. This absence of aliasing is the result of one-one mapping from a s-plane to z-plane.

50 Warping The digital frequency is limited in the range of -0.5  F  0.5, and sampling time period is decided by the highest frequency of the signal F h is to be preserved. Warping of Digital Frequency scale is inherent in Bilinear Transformation. This can be reduced by pre warping the frequencies in analog domain.

51 Steps to Design IIR BZT filters From specifications, workout the desired discrete- time filter requirements and attributes. Pre-warp the critical discrete time frequencies into corresponding analog frequencies and estimate the order of filter and -3dB critical frequency. Design the analog prototype filter from the continuous-time parameters obtained from above. Convert the analog prototype into an analog filter using frequency-frequency transform. Design a digital filter using a BZTof H(s) that warps the frequency axis which was previously pre- warped. [1.Taylor,”Hands-on digital signal processing”, McGraw Hills, pp414-420 ISBN:0-07-912965- x 2.Chen,”Digital Signal Processing” Oxford, PP. 386-394: ISBN 0-19-513638-1]

52 Example 10.04: Using the bilinear transformation and a low pass analog Butterworth prototype, design a low pass filter operating at a rate of 20 kHz and having a pass band extending to 4kHz with maximum attenuation of 0.5 dB and stop band starting at 5 kHz with a minimum stop band attenuation of 10 dB. Soln : Given that sampling rate is f s =20 kS/s, Pass band =f pass = 4kHz.  F pass = 4/20 Hz/s at -0.5 dB. Stop band =f stop = 5kHz.  F stop = 5/20 Hz/s at +10 dB. [Orfanidis: Introduction to signal Processing pp 612-617]

53 Soln..: Prewarped Digital frequencies are:  pass = tan (2  F pass /2) = 0.7265 rad/sample  stop = tan (2  F stop /2) = 1.00 rad/sample. ln(  )= ln (  stop /  pass ) = ln(1.0/0.7265)

54 Determination of order n of the filter: Given that H(s)H(-s) = [1+(s/j) 2n ] -1, G x = 20 log |H(j  x )| = -10log[1 + (  x /  c ) 2n ] Where s =  x,  c = cut-off frequency, n is order of filter. Letting Pass band gain G p dB occur at  p rad/sec and stop band gain G s dB occur at  s rad/sec. We get expressions as: G p = -10log[1 + (  p /  c ) 2n ]  (  p /  c ) 2n = 10 -Gp/10 -1 G s = -10log[1 + (  s /  c ) 2n ]  (  s /  c ) 2n = 10 -Gs/10 –1 Hence: (  s /  p ) 2n = (10 -Gs/10 –1)/ (10 -Gp/10 –1)

55 Conclusion From here we conclude: n, the order of the filter = log {(10 -Gs/10 –1)/ (10 -Gp/10 –1)} / 2log(  s /  p ).  c, the cut off frequency =  p /{10 -Gp/10 –1} 1/2n ALTERNATIVELLY AS =  s /{10 -Gs/10 –1} 1/2n

56 Hence: (  s /  p ) 2n = (10 -Gs/10 –1)/ (10 -Gp/10 –1)  2nlog((  s /  p )=log[(10 -Gs/10 –1)/ (10 -Gp/10 –1)] Or, n = 0.5 log[(10 -Gs/10 –1)/ (10 -Gp/10 -1)]/log(  s /  p ) In this case, n = 0.5 log[(10 -Gs/10 –1)/ (10 -Gp/10 -1)]/log(  s /  p ) = 6.73 say 7. The -3dB cutoff frequency calculated as  c, =  p /{10 -Gp/10 –1} 1/2n = 0.8443  f o = (f s /  ) tan -1 (  c )= 4.464 kHz.

57 The filter is a 7 th order filter One real pole and three complex poles. The composite TF is: = 0.4578 (1+z -1 )/1-0.0844 z -1 + 0.3413(1+z -1 ) 2 /[1-0.2749z -1 + 0.6402z -2 ] + 0.2578(1+z -1 ) 2 /[1-0.2076 z -1 +0.2386 z -2 ] + 0.2204(1+z -1 ) 2 /[1-0.1775 z -1 +0.0592 z -2 ]

58 Example_10.05 [ extention of example 9.4] A band stop filter to satisfy Butterworth and Tchebyshev Criteria is required to meet following specifications. to meet the following specifications. 1.Stop band 100 to 600 Hz (assumed at - 3dB) 2.At and between 200 and 400 Hz, the magnitude should be at least -20 dB. 3.Maximum Gain (at the zero) =1. 4.Pass band ripple  1.1 dB. 5.Sampling frequency 2000 Hz.

59 Conversion to normalized LPF specs. Calculation of prewarp frequencies:  pr_x = tan (  x T/2) = tan (  f/f s ) since f s T=1 f x Hz  f x /f s rad/s  pr_x rad/s f x1 100 0.15710.1584 f x2 2000.31410.3249 f x3 3000.62830.7265 f x4 4000.94251.3764 Normalized Bandwidth = B = f x4 -f x1 = 1.3764-0.1584 = 1.218 Normalized center frequency =  0 2 = f x4 f x1 = 0.2180

60 Calculation of equivalent LPF Basic equation is:  n  B  x /(  0 2 -  x 2 ) Calculating  n for various values of  x in the equation =1.218  x / (0.2180 -  x 2 )  x soln  n 0.1584 1.218 x 0.1584/[0.218 – (0.1584) 2 ] = 1 0.3249 1.218 x 0.3249 /[0.218 – (0.3249) 2 ] = 3.519 0.7265 1.218 x 0.7265 /[0.218 – (0.7265) 2 ] =-2. 856 1.3764 1.218 x 1.3764 /[0.218 – (1.3764 ) 2 ] = -1  s /  p =min(  2 /  1  3 /  4 ) = 2.856  3. and 1/cosh -1 (2.856) = 0.5846

61 Calculation of number of Tchebyshev poles The control equations is where Given:G s =-20 dB, R=-1.1 dB and Calculated  s /  p = 2.856 1/cosh -1 (2.856) =0.5846 cosh -1 ( )=cosh -1 (18.53) = 3.612 n= 2.11  3 for better transit characteristic

62 Chebyshev polynomial for n=3 and R = 1.1 dB In the polynomial calculated in 9.4 H lp (s) =0.4656/(s+0.4766)(s 2 +0.4766s+0.977) To convert this normalized LP to desired BS, substitute s  1.218 s / (s 2 + 0.2180). Use BZT in the so obtained polynomial in s.

63 1. Butterworth filter. Number of poles of LP filter  = log 10 {(10 -Gs/10 –1)/ (10 -Gp/10 –1)} / 2log 10 (  s /  p ) = log 10 {(10 2 -1)/(10 0.3 -1)/2 log 10 (2.856) = 2.199  3 (for better transition characteristic). The normalized TF = 1/ (s+1)(s 2 +s+1) = 1/ 1+2s+2s 2 +s 3 Transform normalized LP to required BS by s  1.218 s / (s 2 + 0.2180) USE BZT on the H BS (s).

64 Butterworth filter


Download ppt "EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 8 IIR FILTER DESIGN."

Similar presentations


Ads by Google