Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design of FIR Filters. 3.1 Design with Least Squared Error 3.1.1 Error Criterion.

Similar presentations


Presentation on theme: "Design of FIR Filters. 3.1 Design with Least Squared Error 3.1.1 Error Criterion."— Presentation transcript:

1 Design of FIR Filters

2 3.1 Design with Least Squared Error 3.1.1 Error Criterion

3 Least square error criterion Desired frequency response:

4 is formed, a quadratic error e given by the energy of the difference signal (deviation from the desired signal) as in (3.3) may be defined. According to Parseval’s theorem, this energy may be defined in both the frequency and time-domains:

5 If we consider an FIR prototype a(n) with an odd number of coefficients N, the error e in (3.4) is

6 The least squared error according to (3.4) is obtained by using the centre N coefficients of the desired impulse response and setting the others to zero.

7 3.2.1 Approximation of the Ideal Low-Pass Filter Start from the desired frequency response. Take N samples of it. Use FFT with N coefficients a d (m) Sometimes also an analytical result can be found easily. The frequency response of the ideal low- pass filter is

8

9 Designing an approximate low-pass filter, the normalised cutoff frequency

10 Example 3.1:

11 The error due to approximation can be reduced by increasing the number of coefficients N. Fig. 3.2 shows an FIR prototype with 21 coefficients. In Fig 3.2a we can see that for -5 n 5 the coefficients have remained unchanged with a better approximation of the ideal low-pass filter than that in Fig3.1b.

12 Fig 3.3 shows a further improvement. In this case 51 coefficients are taken from (3.9). The improved approximation of the ideal low-pass can be seen in fig 3.3b. A comparison of the amplitude frequency responses in Figs 3.1b, 3.2b, and 3.3b. shows, however, that the responses all presereve a finite overshoot near the cutoff frequency. This is known as Gibbs’ phenomenon

13

14

15

16 3.1.3 Design with a Finite Transition Bandwidth There are several ways of responding to Gibbs’ phenomenon. The overshoot can be greatly reduced if we define a transition band of finite width between pass-band and stop-band instead of an abrupt change. This transition band is also referred to as the filter slope.

17

18 Figure 3.4 Desired frequency response when designing with a finite, linear transition between the pass-band (PB) and the stop-band (SB) 1 0 PB SB

19 Besides the pass-band cutoff frequency  p a second parameter, either the stop- band cutoff frequency  s or the relative transition bandwidth is also needed

20 Example 3.2: Fig 3.5a shows in dotted lines a desired frequency response with a transition babdwidth of b = 2%. The overshooting of the amplitude frequency response with 51 coefficients is still clearly visible. If the transition bandwidth is doubled, the amount of overshooting is greatly reduced, see Fig. 3.5b,

21

22 3.2 Design Using Window Functions The most common approach to reduce the ripple in the pass-band and the stop-band due to Gibbs’phenomenon is the use of window functions. The finite impulse response is weighted with a window of equal length. The frequency response obtained shows better behaviour in the transition band but is no longer optimal in the sense of the least squared error criterion

23 3.2.1 Rectangular Window Truncation of the impulse response a d (n) given in (3.9) leads to the finite impulse response a(n) and can be interpreted as multiplying the impulse response a d (n)by a rectangular window function.

24 The appropriate frequency response A(e j  ) can be determined using the convolution therom, whereby the Fourier transform of the rectangular window function is given by

25

26 Example 3.3: The amplitude frequency response in Fig. 3.3b is shown again in a logarithmic scale in Fig. 3.6. Convolution with the sinc-function gives ripple in the pass-band of up to 0.8 dB. The attenuation in the stop-band is at least 20 dB.

27

28 3.2.2 Han Window The oscillations in amplitude in the pass-band and stop-band can be greatly reduced by multiplying the impulse response h(n) with the Han window function  Han (n): h Han (n) =h(n)·  Han (n), n = 0,1,2.......N-1 (3.18)

29 The idea behind this method is to use not just only sinc-function symmetrical to  =0 in the window frequency response W Han (e j  )  Han (n), see (3.16), but to include two additional sinc-functions half the size at  = -2  /(N-1) and  = 2  /(N-1). These compensate the amplitude oscillations when convolved with the frequency response of the ideal low-pass filter. In the time-domain the window function is

30

31 Example 3.4: Fig. 3.7a shows the Han window function with 51 coefficients, Fig. 3.7b the impulse response from Fig. 3.3a weighted with this window. A comparsion between Figs 3.3a and 3.7b shows that the weighting is particularly noticeable at the ends of the impulse response.

32

33 Fig. 3.8 shows the corresponding frequency response H Han (e j  ) h Han (n). The ripple in the pass-band has diminished to approx. 0.05 dB (note the different scale from that in Fig. 3.6b!). The maximum gain in the stop-band is less than –40dB. However, the transition bandwidth has approximately doubled.

34

35 3.2.3 Hamming Window The compensation effect of the sinc- functions in the window frequency response can be further improved if the sinc-functions are not chosen with a ratio 0.5:0.25 as for the Han window, but with a ratio 0.54 : 0.23. This leads to the Hamming window function

36

37

38 Fig. 3.9a shows the Hamming window function with 51 coefficients, Fig. 3.9b the impulse response from Fig. 3.3a weighted by this window. The graphical representations of the impulse responses in the Fig.3.7b and 3.9b can hardly be distinguished.

39

40 The frequency response however, clearly changed, see Fig 3.10. The ripple in the pass-band is reduced to 0.02 dB (different scale!). The minimal attenuation in the stop-band exceeds 50 dB. The transition bandwidth has hardly been altered.

41 3.2.4 Blackman Window

42 Example 3.6: Fig. 3.11a shows a Blackman window with 51 coefficients, Fig. 3.11b the impulse response of the ideal low-pass filter weighted by this window. The stop-band attenuation has increased to 70 dB in comparison to that of the Hamming window, and the pass-band ripple has decreased to less than 0.02 db, see Fig3.12b (different scale!). The transition bandwidth has increased again and is about three times as large as that of the rectangular window, see also Fig. 3.6a.

43

44

45 3.2.5 Further Windows A further simple window is the triangular or Bartlett window. This window leads to approximately the same transition bandwidth as the Han and Hamming windows. However, the compensation of ripple in the pass-band and stop-band is worse.

46 The Kaiser window [Kai 74] mainly uses first kind Bessel functions and has a free praameter. It roughly optimises the relation of energy in the pass-band and transition band and minmal attenuation in the stop- band. If one of these two variables is given, the other can be adjusted optimally using the free parameter. The Dolph-Chebychev window method provides a closed form expression for the window frequency response, which gives equal stop-band ripple of the window frequency response.

47 3.3 Design with Uniform Approximation 3.3.1 Aims and Alternation Theorem Chebyshev Approximation =Equiripple Alternation theorem (N+3)/2 extrema (N odd). Error function:

48 in the case of an odd number N of coefficients, must possess at least (N+3)/2 extrema with equal modulus and alternating sign in the pass-band and stop-band. In the case of an even number N, at least (N+2)/2 extrema must exist. The extrema at the ends of the tolerance band, i.e. at  =  p and  =  s and possibly at  = 0 and  =  are also included, see Fig. 3.13.

49

50 3.3.2 Filter Length and Design Parameters When designing FIR filters with uniform approximation it is important to use the relations between the design parameters. The most important parameters are the lenght of the filter, N-1, or the number of coefficients, N, the relative transition bandwidth b, which is defined as

51 in the case of a tolerance scheme as in Fig. 3.13, and the tolerance widths  p and  s, also referred to as ripple, in the pass-band and stop-band. Bellanger : N as a function of pass- and stop-band ripple and transition bandwidth: 

52

53 Figure 3.14 Low-pass filter with a pass- band cutoff frequency  p =0.5  and a stop-band cutoff frequency  s =0.58  (a) and  p =0.5  (b)

54

55

56 3.3.3 Parks-McClellan Design Iterative alogrithm for the design of linear phase FIR. Weighting factors W P and W s for the trade-off of the accuracy in pass-band and stop-band.

57 Example 3.7: 

58 and from the pass-band ripple of 0.2 dB

59 from (3.24) it follows that

60

61

62 3.4 Design of Half-Band filters 3.4.1 Standard Design Techniques The techniqes discussed in the previous sections can also be applied to half-band filters. When approximating an ideal low-pass filter using the least squared error criterion, the design (3.9) is used. A half–band filter is obtained using  c =  /2 (= half band frequency). The zero-phase impulse response is therefore

63 A half-band filter with a finite filter slope can be approximated in the similar way. In this case the two cutoff frequencies  P and  s in Fig 3.4 are placed symmetrically with respect to the frequency  =  /2.

64 If we like to design a half-band filter by means of window functions, we also start from the truncated impulse response of the ideal low-pass filter. However, instead of (3.31) we use the causal version.

65 The zero-valued coefficients typical of a half band filter remain zero when multiplied by  (n): h(n) = h d (n)·  (n). (3.32) Possible window functions are the Han window  Han (n) as given in (3.19), the Hamming window  Ham (n) according to (3.20) and the Blackman window  Bla (n) according to (3.21).

66 N As a half-band filter alaways has N = 4i –1, i  N, coefficients, i.e. an odd number, the centre coefficient in each of the three windows is equal to one. Therefore the centre coefficient of the causal half-band filter also remains equal ½.

67 3.4.2 Parks-McClellan design with a “Trick”

68 The frequency rseponse of this filter thus only consists of one pass-band and one transition band (filter edge). Thre is no stop-band. Since for N = 4i –1, i  N, the number (N+1)/2 =2i is even, g(n) is an FIR filter of type 2. Its frequency response has a zero at  =  The corresponding zero phase prototype has a period 4 . In the second step, the impulse response is up–sampled by a factor 2 by inserting zeros. Finally the centre coefficient is set to ½.

69 The resulting filter is a half-band filter with a pass-band cutoff  p. Adding the centre coefficient leads to a constant amplitude shift of the frequency response by ½ in the positive direction. The ripple in H(z) is half that of G(z).

70 Example 3.8: A half- band filter with a cutoff frequency  p = 0.45 π and with N = 31 coefficients is to be uniformly approximated. The Parks-McClellan design method is applied with 16 coefficients and a cutoff frequency  p = 0.9 . Fig. 3.19a shows the frequency response G(e j  ) of the one-band filter. The desired half-band filter is obtained by adding the zeros and the centre coefficient of value ½. Fig. 3.19b shows its frequency response

71

72 3.4.3 Lagrange Half-Band Filters When designing filter banks with prefect reconstruction, half-band filters with a non-negtive frequency response are needed. A closed form expression to calculate such half-band filters was proposed by R. Ansari et al. Starting from the general representation

73 of a half-band filter transfer function with 4i-1 coefficients, the coefficients are determined using the Lagrangian interpolation formula: Fig 3.20 shows the zeros and the frequency response of this filter for i = 5

74 The Lagrange half-band filter has a 2i-fold zero at z = -1, i-1 zeros inside the unit circle and i-1 zeros derived from these by mirror imaging with rspect to the unit circle. It is therefore well suited to spectral factorisation H i (z) =H i0 (z)· H i0 (1/z). Because of the large number of zeros at z = -1, each Lagrange filter is regular, and is suited to wavelet design.

75

76 3.4.4 Raised Cosine Half-Band Filters In data transmission system, a raised-cosine characteristic is frequently used. The continuous version of this filter has the following frequency response:

77 The frequency response is real and even. For low frequencies it has the value 1 and for high frequenices the value 0. The transition band between (1-r)  c and (1+ r)  c is cosine-shaped. The value ½ is attained at the cutoff frequency |  | =  c =2  f c. The parameter r is referred to as the rolloff factor and lies in the interval 0 < r  1. For r  0, the ideal low-pass filter with a cutoff frequency  c is approximated.

78 Applying the inverse Fourier transform to equation (3.37) leads to the continous impulse response

79 For r = 0 the impulse response of the ideal low-pass filter is shown to be the sinc- function. The larger the rolloff factor r. the faster the impulse response decreases with increasing time index n. For M=2 a half-band filter is obtained, for further values of M generally an M-th- band filter. The frequency response is zero in the range (1+r)  /M <  < , the attenuation is infinitely large in this range.

80 The impulse response in (3.41) describes a real zero-phase prototype with an infinite number of coefficients. Multiplying with an even rectangular window (symmetrical truncation) and shifting along the time axis by half a window length leads to a realisable causal half-band or M-th-band filter. The half-band or M-th band band characteristic is only approximately realised. In particular, the attenuation in the stop-band (1+r)  /M <  <  takes finite values.

81 Example 3.9: With the help of (3.41), a half-band filter (M=2) and a quarter-band filter (M=4) are to be designed with the rolloff factor of r = 0.1. The lenghts of the impulse responses must be chosen such that the attenuation in the stop- band does not drop below 40 dB. Fig. 3.21 shows the result.

82

83 In order to achieve the required behaviour in the stop-band, the half-band filter requires 51 and the quarter-band filter 103 coefficients. As for FIR filters with uniform approximation, the filter lenght is inversely proportional to the relative transition bandwidth.

84 3.4.5 Square Root Raised-Cosine filters For some filter banks, prototypes are needed with a transfer function which when multiplied by itself, gives a half-band transfer function. Such prototypes can be approximated by a square root raised–cosine characteristic. Since the frequency response H rc (j  ) is not negative, its square root can be taken. Using the relationship (1+ cosx)/2 = cos 2 (x/2) the square root raised-cosine frequency response can be derived from (3.37) and is found to be

85 As for the raised cosine filter, a discrete-time zero-phase impulse response can be derived by the inverse Fourier transform and by sampling at sampling rate f 0 according to (3.39):

86

87 In order to obtain a realisable filter, this impulse response must also be symmetrically truncated and shifted along the time axis. The causal impulse response thus obtained gives, when convolved with itself, only an approximation of a half – band or M-th-band filter. The raised cosine characteristic is only approximately obtained, too.


Download ppt "Design of FIR Filters. 3.1 Design with Least Squared Error 3.1.1 Error Criterion."

Similar presentations


Ads by Google