Presentation is loading. Please wait.

Presentation is loading. Please wait.

The IIR FILTERs These are highly sensitive to coefficients which may affect stability. The magnitude-frequency response of these filters is established.

Similar presentations


Presentation on theme: "The IIR FILTERs These are highly sensitive to coefficients which may affect stability. The magnitude-frequency response of these filters is established."— Presentation transcript:

1 The IIR FILTERs These are highly sensitive to coefficients which may affect stability. The magnitude-frequency response of these filters is established while the phase-frequency response is poor. These filters have short time delay and better time response.

2 The FIR filters FIR have truncated time-response. Thus their frequency response is poor. These can be designed for time-limited as well as frequency-limited response. FIR filters are inherently stable. Can be designed for Linear phase performance. …..contd

3 Advantages of FIR filters Any arbitrary magnitude response can be designed using frequency sampling technique. They are inherently stable. It is the first choice of the designer if the time delay is not important, even though components required are many more times. …..contd

4 Properties of FIR filters…. It is simple to implementation. The finite word length effect is far less severe on frequency performance. Non-causal filters can be designed for the use of mathematical manipulations. To reduce the computation time of convolution the long discrete sequences, FFT algorithms are used.

5 Properties of FIR filters…. FFT can be implemented on hardware as well as on soft-ware. FIR filter are implemented non-recursively. But these can be mathematically expressed recursively. It has no support of analog filters. Computer Aided Designs are used to design such filters.

6 Comparison between IIR and FIR by example 10.01. The following transfer functions, one is recursive and other is non-recursive. Both yield identical magnitude-frequency response. We Compare their computational and storage requirements. Recursive Transfer function H 1 (z) = (b o + b 1 z -1 + b 2 z -2 ) / (1+a 1 z -1 + a 2 z -2 ) where [b o b 1 b 2 ] = [ 0.4981819 0.9274777 0.4981819] [a 1 a 2 ] =[ -0.6744878 - 0.3633482] and

7 Example 10.01 contd… Non recursive transfer function: where h(0) = h(11) = 0.54603280 x 10 -2 h(1) = h(10) = -0.45068750 x 10 -1 h(2) = h(9) = 0.69169420 x 10 -1 h(3) = h(8) = -0.55384370 x 10 -1 h(4) = h(7) = -0.63428410 x 10 -1 h(5) = h(6) = 0.57892400 x 100

8 Summary: Computational and storage requirements Thus we see that IIR filter requires far less components and storage space. But since FIR filter coefficients are symmetrical, the later results in efficient implementation. itemIIR filter H 1 (z) FIR filter H 2 (z) Number of multiplication512 Storage elements211 Storage locations, coefficients 723

9 Linear Phase response FIR: T p  time-phase delay and T g  time group delay. Phase Delay: A signal consists of several frequency components. The phase delay is the amount of time delay each individual frequency components of the signal suffer while transmitted through a system. Non linear phase characteristics of a system results in phase distortion at the output due to alteration in the phase relationship of frequency components of the signal during processing.

10 Phase delay contd. Non linear phase delay is undesirable in hi-fi systems such as video-,bio-, data- transmission etc. Mathematical model of phase delay is: T p = -  (  )/  For linear phase response, the following conditions should be satisfied:      where  and  are constants.

11 In the expression      For a filter of length N, If the symmetry is positive,  = 0 and  = (N -1)/2; and if the symmetry is negative,  =  /2 and  = (N -2)/2). [Ifeachor,”Digital Signal Procesing”2/e, PH,pp344-348]

12 Group Delay It is the average time delay of the frequency components of the composite signal. Mathematically it is defined as: T g = -d  (  )/d  =  “the derivative of phase wrt frequency”. For no phase distortion, the  should be a constant.

13 Phase delay and Group Delay Phase      Phase delay T p = -  (  )/  Group delay T g = -d  (  )/d  =  The phase delay = group delay if  /  is a constant.

14 Phase and Group Delays displayed Figure below shows the waveform of an amplitude-modulated input and the output generated by an LTI system phase

15 Phase and Group Delays Note: The carrier component at the output is delayed by the phase delay. the envelope of the output is delayed by the group delay. It is relative to the waveform of the underlying continuous-time input signal The waveform at the output shows distortion if the group delay is not constant.

16 Phase and Group Delays If the distortion is unacceptable then a delay equalizer is cascaded to enable the overall group delay nearly linear over the frequency band of interest To keep the magnitude response of the parent system unchanged, the magnitude characteristics of delay equalizer need to be constant over the frequency band of interest.

17 Necessary and sufficient condition for a linear phase response filter is: The transfer function of the filter should be symmetrical. This symmetry can be positive or, negative. The word-length N, can be even or, odd. It returns four cases:

18 Two cases for odd word-length Odd coefficients: a o = h[(N-1)/2]; a(n) = 2h[(N-1)/2 - n] CaseWord length Symmetryresponse IoddEven Or, Positive IIoddOdd, Or, Negative

19 Two cases for even word-length Even coefficients: b(n) = 2h(N/2 – n) caseWord length symmetryresponse IIIEvenEven, Or, Positive IVEvenOdd, Or, Negative

20 Even image symmetry with odd and even word length. 1st3rd F D =1/ 2

21 Conclusion…1 Even length filter (IV) always exhibit zero response at F D = 0.5. F D = 0.5 corresponds to half the sampling frequency. Hence it is not suitable for high pass filters. It has zero response at DC too. Negative symmetry filters (II & IV) introduces a phase shift of  in the phase response. It makes output zero at DC or, zero frequency. not suitable for low pass filters. These are useful in design of differentiator and Hilbert transformers as they require  radians phase shift.

22 Conclusion….2 Type I is the most versatile filter.

23 Conclusion….3 Further note that the phase delay for positive symmetry (I and III) or group delay in all the four filters is expressible in terms of the coefficients of the word length of the filter. And hence can be corrected to give a zero phase or, group delay response. Denoting T to be the sampling period, phase delay T p For filter I and III, = (N-1)T/2; For filter II and IV, = (N – 1 -  )T/2. [Ifeachor,”Digital Signal Processing” PH, 2/e, pp.344-348.

24 Summery: configuration & standard filters IIIIIIIV LP  BP  HP  BS 

25 Zero Locations of Linear-Phase FIR Transfer Functions Typical zero locations shown below 1 Type 3Type 1 1 1 Type 4 Type 2 1

26 STEPS IN FIR FILTER DESIGN 1. Filter Specifications: Filter transfer function H(z), Required amplitude and phase responses, acceptable tolerances, sampling frequency and the word length of the input data. 2.Coefficient Calculations:  to determine the coefficients of H(z) so as to satisfy the filter specifications.

27 STEPS IN FIR FILTER DESIGN…. 3.Realization: Conversion of the transfer function into suitable structure. 4.Analysis of finite word length effects:  Error effect of quantization of input signal,  Effect of coefficient quantization.  Optimization of word-length. 5.Implementation:  Producing software codes and/or hardware and performing the actual filtering.

28 Design specifications 1.Pass / Stop band specifications: Magnitude deviation (includes ripple) Pass/Stop band edge frequency (or frequencies in case of band pass/stop filter). 2.Sampling Frequency. 3.Word length of the filter

29 Methods of Calculation of FIR Coefficients 1.The Window Method, 2.Frequency Sampling Method, 3.Optimal or, Min-max design method. Each method can lead to design of a linear phase FIR filter. The common mathematical model is:

30 The window method A suitable window function w[n] is selected, required word length is calculated. Then it is multiplied with the impulse response of a (ideal) LPF. Thus h w [n] = h[n] w[n] Or,  h w [n] = H[F]  W[F]. 

31 The window method…. The spectrum of ideal low pass filter have a jump discontinuity at F = F c. But the windowed spectrum shows over-shoot, ripple and a finite transition width but no abrupt jump.

32 Window method contd… It’s normalized signal magnitude at F = F c is 0.5. It corresponds to attenuation of -6 dB. The ripple in pass band and over-shoot is attributed to Gibb’s phenomena; 9% minimum. The side-lobs produces the ripple in pass band and stop band. The ripples in pass band and stop band have odd symmetry.

33 Window method contd… The transition width is due to main lob. Wider the main lob, wider is the transit band. Wider is the window width, smaller is the width of main-lob. Number of minima and maxima in the pass band and stop band are decided by N. Unlike in Tchebyshev Filters, the peaks here have different heights, maximum near band edges, decaying thereafter.

34 Note that number of samples equal maxima and minima of a rectangular window in pass- and stop band. The peak occurs near band edges. Maxima-Minima

35 Rectangular Window This window has two properties:  maximum number of alternating maxima and minima and  their peaks follow the attenuation at the rate of –6.02dB per octave or, equivalent -20dB/dec.  Mathematical model of different type windows follows.

36 Mathematic Models Of Different Type Of Windows Window RepresentationExpression Rectangular w R [n] 1 Bartlettw T [n] 1 – {2|n| / (N-1)} Von Hannw hn [n]0.50 + 0.50 cos{2n  /(N-1)} Hammingw hm [n]0.54 + 0.46 cos{2n  /(N-1)} Blackmanw b [n]0.42 +0.50 cos{2n  /(N-1)} +0.08 cos{4n  /(N-1)} Kaiser w K [n,  ] I o (x 1 )/I o (x 2 ); ratio of modified bessel function of order zero; where x 1 =(   {1 – 4[n/(N-1)] 2 }); and x 2 = (  )

37 Characteristics of Windows We now examine the characteristics of various other type of windows and compare their performances for N=21and N=51. Before that note various nomeclatures.

38 Mathematical representation: Nomenclatures 1.G P / G S = Peak Gain of main-lob / side-lobe dB 2.A SL = Side-lobe attenuation = (G P /G S ) dB. 3.W M = Half-width of main-lobe 4.W 6 / W 3 = - 6 dB / -3dB half-width 5.D S = stop-band attenuation dB/dec. 6.F WS = C/N where C= constant of filter. 7.W S = Half width in main-lobe to reach the peak level of first side lob. 8.Aws= Peak side-lobe attenuation in dB 9.A WP = Pass band attenuation in dB

39

40

41 WindowGpGp G S /G p A SL dBWMWM WSWS W­ 6 W3W3 DSDS A WS F WS A WP Rectangular10.217213.310.810.60.442021.70.921.562 Bartlett Triangular 0.50.047226.521.620.880.634025 Von Hann Hanning 0.50.026731.521.871.00.7260443.210.1103 Hamming0.540.007342.721.910.90.6520533.470.0384 Blackman0.420.001258.132.821.140.826075.35.710.003 Kaiser  = 0.26 0.43140.0010602.982.721.110.8020 Note: The widths; W M, W S, W 6, W 3 ; must be normalized by the window length N. Empirical Values for Kaiser Window depends on the value of  defined as: G P = |sinc(j  )| / Io(  ); A SL = Sinh(  )/0.22  ; W M =  (1+  2); W 6 =  (0.661+  2)

42 PROCEDURE OF CALCULATING FILTER COEFFICIENTS USING WINDOW Specify the desired frequency response of the filter H d (  ). Obtain the impulse response h D [n] of the desired filter by inverse Fourier transform. Select a window which satisfies the pass-band attenuation specification.

43 PROCEDURE OF CALCULATING FILTER COEFFICIENTS USING WINDOW… Determine the number of coefficients using the appropriate relationship between the filter length and the transition width  f expressed as a fraction of the sampling frequency. Obtain the values of w[n] for the chosen window function and that of the actual FIR coefficients h[n] and multiplying them. Plot the response and verify the compliance of specifications.

44 Summery of ideal impulse response of standard frequency selective filters Filter typeIdeal impulse response h D [n] H D [0] Low Pass 2f c sinc(n  c ) 2f c High Pass 1-2f c sinc(n  c ) 1-2f c Band Pass 2f 2 sinc(n  2 )- 2f 1 sinc(n  1 ) 2(f 2 -f 1 ) Band Stop 2f 1 sinc(n  1 )- 2f 2 sinc(n  2 ) 1-2(f 2 -f 1 ) Note: f c, f 1 and f 2 are the normalized edge frequencies. N is the length of the filter [Ifeachor: p.353]

45 Remarks: The TF of a filter is an even symmetric function. It is an ideal transfer function. It has a linear phase response. Theoretical value of n . But for an FIR filter, n should be finite. With finite n, the response will have ripples. The response will also have at least 9% overs- hoots near critical frequencies, Gibbs Phenomena.

46 Remarks:  If the n in truncated range is increased, ripple is reduced so also the overshoot, upto 9%.  Increased n means increase in number of coefficients.  Ideal truncation is equivalent to convolving an ideal filter h D having frequency response sinc(  ) with rectangular frequency window, W(  ).  It is equivalent to multiplication in time domain.

47 convolution of an ideal filter with a sinc window function. Peak side lob attenuation

48 WindowGpGp G S /G p A SL dBWMWM WSWS W­ 6 W3W3 DSDS A WS F WS A WP Rectangular10.217213.310.810.60.442021.70.921.562 Bartlett Triangular 0.50.047226.521.620.880.634025 Von Hann Hanning 0.50.026731.521.871.00.7260443.210.1103 Hamming0.540.007342.721.910.90.6520533.470.0384 Blackman0.420.001258.132.821.140.826075.35.710.003 Kaiser  = 0.26 0.43140.0010602.982.721.110.8020 Note: All widths; W M, W S, W 6, W 3 ; must be normalized by the window length N. Empirical Values for Kaiser Window depends on the value of  defined as: G P = |sinc(j  )| / Io(  ); A SL = Sinh(  )/0.22  ; W M =  (1+  2); W 6 =  (0.661+  2)

49 Example: Design a low-pass FIR filter to meet the following specs: Pass band edge frequency: 1500 Hz Transition width: 500 Hz. Stop-band attenuationA WS = > 50 dB Sampling frequencyf s = 8000 Hz. Soln: 1.Meaning of given specifications are: Sampling frequency f s = 8000 Hz. Pass band edge frequency: f c =1500/8000 Transition width  f = 500/8000. Stop-band attenuation A WS = > 50 dB

50 Design considerations contd… 2.The filter function is H D (  )= 2f c sinc(n  c ). 3.Because of stop-band attenuation characteristics, either of the Hamming, Blackman or, Kaiser windows can be used. We use Hamming window: w hm [n] =0.54 + 0.46 cos{2n  /(N-1)}

51 Design considerations contd… 4.  f = transition band width/sampling frequency = 0.5/8 =0.0625 = 3.3/N. Thus N = 52.8  53 i.e. for symmetrical window –26  n  26. f c ’ = f c +  f/2 = (1500+ 250)/8000 = 0.21875. 5.Calculate values of h D [n] and w hm [n] for –26  n  26 Add 26 to each index so that the indices range from 0 to 52. 6.Plot the response of the design and verify the specifications.

52 Calculations:  c = 2  f c = 1.3745  2f c =1.3745/  = 0.4375 h D (n) = 2f c [sin(n  c )/ n  c ] w n = [0.54 + 0.46cos(2  n/N) The input signal to the filter function is a series of pulses of known width but of different heights manipulated as per the window function. The overall is the multiplication of two.

53 Calculations… h(n) = h D [n] w D [n] = 0.4375 {[sin(n  c )/ n  c ]} x {[0.54 + 0.46cos(2  n/N)} at n=0, since sin(n  c )/n  c = 1, so also cos(0) = 1;  h(0) = 0.4375 x[0.54 + 0.46] = 0.4375. Again since 2f c /  c = 1/  h(n)= [sin(1.3745n)/n  ] [0.54 +0.46cos(2  n/53)]

54 Coefficient Calculations

55 Example: Design a filter for the specifications: Pass band: 150-250 Hz. Transition width: 50 Hz Pass band ripple: 0.1 dB max. Stop-band attenuation: > 60 dB Sampling frequency: 1000 Hz. Soln: The above is a band pass filter. 1.Interpretations of specifications are: Sampling frequencyfs = 1000 Hz. Pass band edge frequency: fc =150-250/1000 Pass band ripple:  p= 0.1 dB max. Transition width  f =50/1000. Stop-band attenuationA WS = > 60 dB

56 Design considerations contd… 2.The filter function is H D (  )= 2f 2 sinc(n  2 ) -2f 1 sinc(n  1 ) 3.Because of stop-band attenuation characteristics, either of the Blackman or, Kaiser windows can be used. 4.From the specifications of pass band and stop-band: 20 log(1+  p ) = 0.1 or,  p = 0.0115; -20 log (  s ) = 60 dB, or,  s = 0.001. therefore  = min(  p,  s ) = 0.001.

57 WindowGpGp G S /G p A SL dBWMWM WSWS W­ 6 W3W3 DSDS A WS F WS A WP Rectangular10.217213.310.810.60.442021.70.921.562 Bartlett Triangular 0.50.047226.521.620.880.634025 Von Hann Hanning 0.50.026731.521.871.00.7260443.210.1103 Hamming0.540.007342.721.910.90.6520533.470.0384 Blackman0.420.001258.132.821.140.826075.35.710.003 Kaiser  = 0.26 0.43140.0010602.982.721.110.8020 Note: All widths; W M, W S, W 6, W 3 ; must be normalized by the window length N. Empirical Values for Kaiser Window depends on the value of  defined as: G P = |sinc(j  )| / Io(  ); A SL = Sinh(  )/0.22  ; W M =  (1+  2); W 6 =  (0.661+  2)

58 Design considerations contd… 5.We use Blackman window: w b [n] = 0.42 +0.50 cos{2n  /(N-1)} + 0.08 cos{4n  /(N-1)}  f = transition band width/sampling frequency = 50/1000 =0.05 = 5.5/N. hence N  110. i.e. for symmetrical even window –55  n  55, but for n=0., being an even window. We can choose N = 111.

59 Design considerations contd… 6.For N =111,Plot the response of the design and verify the specifications. 7.Calculate values of h D [n] and w hm [n]for –55  n  55 8.Add 55 to each index so that the indices range from 0 to111.

60 Comparison of commonly used windows with Kaiser window: Window type Peak normalized side lob amplitude Approximate. Width of main-lob Appx. peak error 20 log  Equivalent Kaiser Window  Transition Width Rectangular -13 4  /(M+1) -21 0 1.81  /M Bartlett -25 8  /M -25 1.33 2/37  /M Hanning -31 8  /M -44 3.86 5.01  /M Hamming -41 8  /M -53 4.86 6/27  /M Blackman -57 12  /M -74 7.04 9.19  /M The comparison shows that the Kaiser window is more efficient than any other window in question.

61 Example: take-up above problem and solve it using Kaiser window. Soln. specifications are repeated here: Sampling frequencyfs = 1000 Hz. Pass band edge frequency: fc =150-250/1000 Pass band ripple:  p= 0.1 dB max. Transition width  f =50/1000. Stop-band attenuationA WS = > 60 dB

62 WindowGpGp G S /G p A SL dBWMWM WSWS W­ 6 W3W3 DSDS A WS F WS A WP Rectangular10.217213.310.810.60.442021.70.921.562 Bartlett Triangular 0.50.047226.521.620.880.6340 Von Hann Hanning 0.50.026731.521.871.00.7260443.210.1103 Hamming0.540.007342.721.910.90.6520533.470.0384 Blackman0.420.001258.132.821.140.826075.35.710.003 Kaiser  = 0.26 0.43140.0010602.982.721.110.8020 Note: All widths; W M, W S, W 6, W 3 ; must be normalized by the window length N. Empirical Values for Kaiser Window depends on the value of  defined as: G P = |sinc(j  )| / Io(  ); A SL = Sinh(  )/0.22  ; W M =  (1+  2); W 6 =  (0.661+  2)

63 Design using Kaiser Window The filter function is H D (  )= 2f 2 sinc(n  2 ) -2f 1 sinc(n  1 ) Because of stop-band attenuation characteristics, either of the Blackman or, Kaiser windows can be used. From the specifications of pass band and stop-band: 20 log(1+  p ) = 0.1 dB or,  p = 0.0115; -20 log (  s ) = 60 dB, or,  s = 0.001. therefore  = min(  p,  s ) = 0.001.  f = transition band width/sampling frequency = 50/1 =0.05= (A WS -7.95)/ 14.36N = (60-7.95)/14.36N or, N =72.49  73...contd

64 Design using Kaiser Window… Calculation of  by empirical formulae.  = 0 if A  21 dB;  = 0.5842(A WS -21)0.4 + 0.07886(A-21) if A <21<50 dB  = 0.1102(A WS -8.7) if A  50 Hence  = 5.65 Evaluate the coefficients. Evaluate the performance. plot the graph and verify the performance of designed filter.

65 Advantages and disadvantages of the window method. It is simple to apply and simple to understand. It involves minimum computation. Lacks flexibility. Both peak pass band and stop- band ripples are nearly equal, limits the choice of designer. Because of convolution of the spectrum of the window function and the desired response, pass band and stop-band edge frequencies can not be precisely specified. Maximum ripple magnitudes in pass-band and stop- band in the filter response is fixed regardless of N (except in Kaiser Window).

66 Frequency Sampling Method Arbitrary frequency response is possible to design. Since coefficients need not symmetrical, design of recursive filters possible. It is possible to compute coefficients as integers. Unless optimized, the band pass ripple, like in window method, is not equi height. Frequency sampling is at equi-angle on unit circle. Odd coeff. filters will have zeroes at either z = 1 or -1. Even coefficient filters will simultaneously either have zeroes or none at z =  1.

67

68 Mathematics for Linear Phase response. Linear Phase response can be obtained by either even symmetric or, odd symmetric impulse response coefficients. Inverse DFT is expressed as

69 where  = (N-1)/2

70 For all the real coefficients of h(n) And if the coefficients are symmetrical too: For even coefficients, H(0) will be zero.

71 Example: (Ifeachor: p.382) Prob.: Design an FIR linear phase filter having pass band 0-5 kHz, Sampling frequency 18 kHz, filter length 9 Soln: N =9 hence N/2 -1 = 4. frequency interval is f s /N = 18/9 = 2 kHz. |H(k)| = 1 at k =0,  1,  2 = 0 at k=  3,  4 More read Ifeachor PP 382 to 401: matlab: 450 to 453.


Download ppt "The IIR FILTERs These are highly sensitive to coefficients which may affect stability. The magnitude-frequency response of these filters is established."

Similar presentations


Ads by Google