0% found this document useful (0 votes)
37 views13 pages

FIR Filter Design

Fir

Uploaded by

tanisham426
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
37 views13 pages

FIR Filter Design

Fir

Uploaded by

tanisham426
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 13
UNIT-IV sat DIGITAL WGK NY INTRODUCTION A filter is a frequency selective system. Digital filters are classified as finite duration unit, impulse response (FIR) filters or infinite duration unit impulse response (UR) filters, depending on the form of the unit impulse response of the system. In the FIR system, the impulse response sequence is of finite duration, ic, it has a finite number of non-zero terms, The IIR system has an infinite number of non-zero terms, i.e, its impulse response sequence is of infinite duration. IIR filters are usually implemented using recursive structures (feedback poles and zeros) and FIR filters are usually implemented using nonerecursive structures (no feedback-only zeros). The response of the FIR filter depends only on the present and past input samples, whereas for the IIR filter, the present response is a function of the present and past values of the excitation as well as past values of the response. Advantages of FIR filter over IIR filte FIR filters are always stable FIR filters with exactly linear phase can easily be designed. FIR filters can be realized in both recursive and non-recursive structures, FIR filters are free of limit eycle oscillations, when implemented on a finite word length digital system, 5, Excellent design methods are available for various kinds of FIR filters Disadvantages of FIR filters: 1. The implementation of natrow transition band FIR filters is very costly, as it requites considerably more arithmetic operations and hardware components such as multipliers, adders and delay elements. 2 Memory requirement and execution time are very high FIR filters are employed in filtering problems where linear phase characteristics within the pass band of the filter are required. IF this is not required, either an FIR or an IIR filter may be employed. An IIR filter has lesser number of side lobes in the stop band than an FIR filter with the same number of parameters. For this reason if some phase distortion is tolerable, an IIR filter is preferable. Also, the implementation of an IIR filter involves fewer parameters, less memory requirements and lower computational complexity: Characteristics of Fir Filters with Linear Phase ‘The transfer function ofa FIR causal filter is given by He)=D h(n) 2* where A(n) is the impulse response of the filter, The frequency response [Fourier transform of h(n) is given by Ho Shyer" which is periodic in frequency with period 2, i.., Teo) = Mhot2k ), k=0,1,2. Since £1(o ) is complex it can be expressed as Hoy £| Henle ‘where H(o ) is the magnitude response and (a) is the phase response We define the phase delay + pand group delay +, of a filter as: For FIR filters with linear phase, we can define Olo)=-a0 nS 0S x ‘Where a is constant phase delay in samples a9\0) ao ie. "1% ~@ which means that « is independent of ‘requency. We have LY hope Hb) @ 7" LY Honfeose n ~j sian] = + HC) | [e058 (o ) + sin6 (o )] This gives us © hia) cose n= +|H (00) | e058 () =Y Hn) sino n= |H(w) | sin 0 (o ) ‘Therefore, “ Sn6@) _ snow Shanon OO) exe ¥ Hn fs on cs a cos sin a] =0 © hon sin (a= njo=0 This will be zero when Win) = MN = 1 9) and ‘This shows that FIR filters will have constant phase and group delays when the impulse response is symmetrical about a= (I= 1)2. ‘The impulse response satisfying the symmetry condition h(n) = h(N = 1 =n) for odd and even values of N is shown in Figure 1. When N = 9, the centre of symmetry of the sequence occurs at the fourth sample and when N = 8, the filter delay ig 3 1samples. Centre of © Figure 1 Impulse response sequence of symmetrical sequences fr (a) N odd (b) N even. Ifonly constant group delay is required and not the phase delay, we can write Go) =B - aw Now, we have ‘my 2 [econo Sach = ain 5 scene js = + ere) sa ‘This gives Y hiadeot on = £]M(0) cos weo) 35 nso = |e in) Drm saan Sawown ‘Cross multiplying and rearranging, we get Ff sintetsn sings) snc — i) F mapsmyp~(a-me 2, the above equation can be written as: ‘This equation will be satisfied when hn) ‘This shows that FIR filters have constant group delay + z and not constant phase delay when the impulse response is antisymmetrical about a= (W~ 1)/2 The impulse response sting the antisymmetry condition is shown in Figure 2. When N= 9, the centre of antisymmetzy occurs at fourth sample and when N= 8, the centre of antisymmetry occurs at *Zsamples. From Figure 2, we find that h[(W— 1/2] = Ofer stisymmetric odd sequenee, Centre of Centre of @) ©) Figure 2 Impulse response sequence of antisymmetric sequences fo a) N edd (b) N even EXAMPLE 1 The length of an FIR filter is 7, If this filter has a linear phase, show that wet DY A) sin(e— nyo = 0 “0 is satisfied ‘Solution: The length of the filter is 7. Therefore, for linear phase, o E hin sine—mar =F HapsnG—ne "= A(O) sin 3es + hd) sin 2er + WO) sin 9+ H3) sin 0+ H(A) sin + iS) sin (—209)+ 46) sia (30) ° 5 posnce-ma=0 Hence tbe equation 23 is satis EXAMPLE 2 ‘The following transfer function characterizes an FIR filter (N= 9). Determine the magnitude response and show that the phase and group delays are constant Sams Solution: "The wansfer anction ofthe Filter is sven by “= MOF ADE! +MDz? +H)? + Maz +h) + HOHE +h) HS) ‘The phase delay Hea) = 24 [MO)24 + hiL) 2 + HO) SEM) EADS! ES) A +6 phi 2 hi8) Since A(n) = AW 1 =n) IMO)! +1) + AS +) HME + +m] ‘The frequency response is obtained by replacing 2 with ¢ TO) fel Fe LE MYL 4.6 +O FEF] +H T+ AO)eA* + olny ea eats] *hnor] where [ie i the magaiuude response and 4 delay t, and group delay +, are given by cece) do ‘Thus, the phase delay and the group delay are the same and are constants, Design Techniques for FIR Flilters ‘The well known methods of designing FIR filters areas follows: 1. Fourier series method 2. Window method 3. Frequeney sampling method ‘Optimum filter design In Fourier series method, the desired frequency response Hz (w ) is converted to a Fourier series representation by replacing by 2x /T, where T is the sampling time. Then using this expression, the Fourier coefficients are evaluated by taking inverse Fourier transform of Ha(o ), which is the desired impulse response of the filter a(n). The Z transform of ha(n) gives Hale) which is the transfer function of the desired filter. The Ha(2) obtained from idm) will be a transfer function of unrealizable non causal digital filter of infinite duration. A finite duration impulse response f(n) can be obtained by truncating the infinite duration impulse response h(n) to N-samples. Now, take Z-transform of h(n) 10 get H(2). This H(2) corresponds to a non-causal filter. So multiply this H(z) by 7" to get the transfer function of realizable causal filter of finite duration, In window method, we begin with the desired frequency response specification Fdto ) and determine the corresponding unit sample response hd). The h(n) is given by the inverse Fourier transform of H,(o ). The unit sample response hd) will be an infinite sequence and must be truncated at some point, say, at n= N'— I to yield an FIR filter of length NY. The truncation is achieved by multiplying ha(n) by a window sequence w(n). The resultant sequence will be of length N and can be denoted by h(n). The Z-transform of fin) will give the filter wransfer function (2). There have been many windows proposed like Rectangular window, Triangular window, Hanning window, Hamming window, Blackman wndow and Kaiser window that approximate the desired characteristics Im frequency sampling method of filter design, we begin with the desired frequency response specification H.(o), and it is sampled at N-points t0 generate a sequence /1(k) which corresponds to the DFT coefficients. The N-point IDFT of the sequence H(k) gives the impulse response of the filter hn). The Z-transform of hn) gives the transfer function of the filter. In optimum filter design method, the weighted approximation error between the desired frequency response and the actual frequeney response is spread evenly across the pass band and evenly across the stop band ofthe filter. This results in the reduction of maximum error. ‘The resulting filter have ripples in both the pass band and the stop band, This concept of design is called optimum equiripple design criterion. The various steps in designing FIR filters are as follows: 1 Choose an ideal(desired) frequency response, Ha( 0). 2 Take inverse Fourier transform of #Z( ) to get hy (n) or sample H(e ) at finite number of points (N-point) to get A(&). 3. If ha(n) is determined, then convert the infinite duration h(n) to a finite duration h(n) (usually h(n) is an N-point sequence) or if H(k) is determined, then take N-point inverse DFT to get f(n. Take Z-transform of h(t) to get H(z), where A7(=) isthe transfer function of the digital filter: 5. Choose 2 suitable structure and realize the filter Design OF FIR Filters using Windows ‘The procedure for designing FIR filter using windows is: 1. Choose the desited frequency response of the filter H(@). 2. Take inverse Fourier transform of Ha ) to obtain the des: han), Choose a window sequence (1) and multiply ha(n) by w{n) to convert the infinite duration impulse response to a finite duration impulse response A(n). 4. The transfer function H(2) of the filter is obtained by taking Z-transform of h(n) impulse response 3 Rectangular Window ‘The weighting function (window function) for an N-point rectangular window is given by 4 Maden wet = oe mine ft Osnsw-y 0. elsewhere 0. elsewhere hewn The spectrum (frequency response) of rectangular window Wx(0) is given by the Fourier transform of s(n) The frequency spectrum for N = 31 is shown in Figure 3. The spectrum Wa(@) has two features that are important. They are the width of the main lobe and the side lobe amplitude, The frequeney response is real and its zero occurs when @ = 2k /N where k is an integer. TThe response for between -2x JN and 2x (NV is called the main lobe and the other lobes are called side lobes. For rectangular window the width of main lobe is 4x /N. The first side lobe ‘will be 13 dB down the peak of the main lobe and the roll off will be at 20 dBidecade. As the ‘window is made longer, the main lobe becomes narrower and higher, and the side lobes become ‘more concentrated around @= 0, but the amplitude of side lobes is unaffected. So increase in length does not reduce the amplitude of ripples, but increases the frequency when rectangular ‘window is used, If we design a low-pass filter using reclangular window, we find that the frequency response differs from the desired frequency response in many ways. It does not follow quick transitions in the desired response. The desired response of a low-pass filter changes abruptly from pass band to stop band, but the actual frequency response changes slowly. This region of gradual change is called filter's transition region, which is due to the convolution of the desired response with the window response’s main lobe, The width of the transition region depends on the width of the main lobe. As the filter length increases, the main lobe becomes narrower decreasing the width of the transition region The convolution of the desired response and the window response’s side lobes gives tise to the ripples in both the pass band and stop band. The amplitude of the ripples is dictated by the amplitude of the side lobes. This effect, where maximum ripple occurs just before and just after the transition band, is known as Gibb’s phenomenon, The Gibbs phenomenon can be reduced by using a less abrupt wuncation of filter coefficients. This can be achieved by using a window function that tapers smoothly towards zero at both ends, W409 J 14440)—Lueal response [= 1(0)—Approximate response Figure 3 (a) Rectangular window sequence, (b) Magnitude response of rectangular window, (c] Magnitude response of Now pas iter approximated using rectangular window. Triangular or Bartlett Kindow ‘The triangular window has been chosen such that it hs tapered sequences from the middle con either side. The window function wr(n) is defined as In magnitude response of triangular window, the side lobe level is smaller than that of the rectangular window being reduced from -13 dB to -25 dB, However, the main lobe ‘width is now 8 /N or twice that of the rectangular window. The triangular window produces a smooth magnitude response in both pass band and stop band, but it has the following disadvantages when compared to magnitude response obtained by using rectangular window: 1. The transition region is more, 2 The attenuation in stop band is less. the triangular window is not usually @ good choice Because of these characteris Raised Cosine Window ‘The raised cosine window multiplies the central Fourier coefficients by approximately unity ‘and smoothly truncates the Fourier coefficients toward the ends of the filler. The smoother fends and broader middle section produces less distortion of han) around 1 = 0. It is also called generalized Hamming window. The window sequence is of the form: Hanning Window The Hanning window function is given by a +01-ef wal clyewhere The width of main lobe is 8 /N, ie., twice that of rectangular window which results in doubling of the transition region of the filter. The peak of the first side lobe is -32 dB relative to the maximum value, This results in smaller ripples in both pass band and stop band of the low-pass filter designed using Hanning window, The minimum stop band attenuation of the filler is 44 dB. At higher frequencies the stop band attenuation is even greater. When compared to triangular window, the main lobe width is same, but the magnitude of the side lobe is reduced, hence the Hanning window is preferable to triangular window. Hamming Window ‘The Hamming window function is given by 0:54 + 0.46 eos| for -| | lo — ( [054 — 0.46 cos N lo otic In the magnitude response for N= 31, the magnitude of the first side lobe is down about 4148 from the main lobe peak, an improvement of 10 dB relative to the Hanning window. But this improvement is achieved at the expense of the side lobe magnitudes at higher frequencies, ‘which are almost constant with frequency. The width of the main lobe is 8 /N. In the magnitude response of low-pass filler designed using Hamming window, the fist side lobe peak is ~S1 dB, which is -7 dB lesser with respect to the Hanning window filter. However, at higher frequencies, the stop band attenuation is low when compared to that of Hanning window. Because the Hamming window generates lesser oscillations in the side lobes than the Hanning ‘window for the same main lobe width, the Hamming window is generally preferred. Blackman Window The Blackman window function is another type of cosine window and given by the equation 0 otherwise In the magnitude response, the width of the main lobe is 12x /N, which is highest among ‘windows. The peak of the first side lobe is at~S8 dB and the side lobe magnitude decreases with frequency. This desirable feature is achieved at the expense of increased main lobe width, However, the main lobe width can be reduced by inereasing the value of N, The side lobe attenuation of a low-pass filter using Blackman window is -78 dB. Table 1 gives the important frequency domain characteristics of some window functions. ‘TABLE 1 Frequency domain characterises of some window functions Type of “Approximate Minimum stop Peak of first window ‘transition and attenuation side lobe width of main lobe (a) «By Rectangular 4m iN 21 3 Bartlett 8m iN 25 25 Hanning Bn =44 oI Hamming BxiN 31 41 Blackmann 12 IN 78 58 EXAMPLE 3 Design an ideal low-pass filter with N'= 11 witha frequency response Solution: For the given desired frequency response, The filter coefficients are given by Emenee nyim= 14) oa ey a nyiay= snr =0=n(-4, —ay3)= ain _ nla) = Geant =0= hy uOd= sin Assuming the window function, [| foraSenss va)= (0, otherwise 1a) = bnd-win) = ha We have ‘Therefore, the designed filter coefficients are given as mo) = 4H Wa) =0=H-4), WS) ‘The above coefficients correspond to a non-causal filter which is not realizable, ‘The realizable digital filer transfer function /7{2) is given by oan | 10 | K)4 Shien +2 | nO)+ She +241 tel] HG) [Osh Le + 4S +21 + W) FO)? HIDE HHO FAS = HS) 44G)E7 + 1H “Sr 3° ‘Therefore, the coefficients ofthe realizable digital filter ae: Ho}= = HO, A)=0240), HO) & his), 18)=0240, W=4 WG), WS)

You might also like