Finite Impulse Response Filters
Main advantages of the FIR filter over IIR filter.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 cycle oscillations, when implemented on a finite-word length digital system
Excellent design methods are available for various kinds of FIR filters
The disadvantages of FIR filters are:The implementation of narrow transition band FIR filters are very costly, as it requires considerably more arithmetic operations and hardware components such as multipliers, adder and delay elements.
Memory requirement and execution time are very high.
Fourier Series Method of Designing FIR filters• The frequency response H( ) of a system is periodic in 2л.
From Fourier series analysis we know that any periodic functions can be expressed as a linear combination of complex exponentials. Therefore, the desired frequency response of an FIR filter can be represented by the Fourier Series (1)
• Where the Fourier coefficients are the desired impulse response sequence of the filter
(2)
• The z-transform of the sequence is given by :(3)
• Whereby equation 3 represents a non-causal digital filter of infinite duration. To get an FIR filter transfer function, the series can be truncated by assigning
= 0 otherwise.
Then,
(4)
= (5)
For a symmetrical impulse response having symmetry at n=0
(6)
Therefore, equation 4 can be written as
(7)
The above transfer function is not physically realizable. Realizability can be brought by multiplying Eq.7 by
where is delay in samples.
(8)
Design an ideal highpass filter with a frequency response
for
for
Find the values of h(n) for N=11. Find H(z). Plot the magnitude response.
Solution
The desired frequency response is shown in Fig.1
We know
Figure1: the ideal frequency response of highpass filter of example 1
-
Truncating to 11 samples, we have
for
= 0 otherwise
For n=0
=
From the given frequency response we can find that α =0. Therefore, the filter coefficients are symmetrical about n = 0 satisfying the condition
For n=1
= - 0.225
the transfer function of the filter is given by
=
= 0.75 +
The transfer function of the realizable filter is
= 0.0045 – 0.075 - 0.159 -0.225 + 0. 75 -0.225 -0.159 -0.075 -0.045 (9)
=h(5) = 0.75 , ….
Design of FIR filters using windows
The desired frequency response of a filter is periodic infrequency and can be expanded in a Fourier series. The resultant seriesis given by
Where
and known as Fourier coefficients having infinite length. One possibleway of obtaining FIR filter is to truncate the infinite Fourier series at
, where N is the length of the desired sequence. But abrupt
truncation of the Fourier series results in oscillation in the passband andstopband. These oscillations are due to slow convergence of the Fourierseries and this effect is known as the Gibbs phenomenon. To reducethese oscillations, the Fourier coefficients of the filter are modified bymultiplying the infinite impulse with a finite weighing sequence called a window where
for
= 0 for
After multiplying window sequence with , we get a finiteduration sequence that satisfies the desired magnitude response
for
= 0 for
The frequency response of the filter can be obtained by
convolution of and
=
Figure 2: Windowing technique
Rectangular window The rectangular window sequence is given by
= 0 otherwise An example is shown in Fig 3 for N = 25.
Figure 3: Rectangular window
The spectrum of the rectangular window is given by
=
The frequency spectrum for N = 25 is shown in Fig 4.
Figure 4: (a) Frequency response of rectangular window N=25 (b) Logmagnitude response of rectangular window for N=25.
Hanning window
The Hanning window sequence can be obtained as follow:
= 0 otherwise
The frequency response of Hanning window is
The window sequence and its frequency response are shown inFig.5 and Fig.6 respectively. The main lobe width of Hanning window istwice that of the rectangular window, which results in a doubling of thetransition region of the filter. The magnitude of the side lobe level is -31dB,which is 18dB lower than that of rectangular window. This results is smallerripples in both passband and stopband of the lowpass filter designed usingHanning window. The minimum stopband attenuation of the filter is 44 dBwhich is 23dB lower than the filter designed using rectangular window. Athigher frequencies, the stopband attenuation is even greater.
Figure 5: Hanning window sequence
Figure 6: (a) Frequency response of Hanning window for N = 25 (b) Log magnitude response of Hanning window for N = 25.
Hamming window
The equation for Hamming window can be obtained as follows:
= 0 otherwise
The frequency of the Hamming window is
Figure 7: (a) Frequency response of Hanning window for N = 51 (b) Log magnitude response of Hanning window for N = 51.
Figure 8: Frequency response of LPF using Hanning window for N = 25
Figure 9: Log magnitude response of LPF using Hanning window for N = 25
The window sequence and its magnitude response are shown in Fig.10 and
Fig.11 respectively. The peak side lobe level is down about 41dB from the main lobepeak, an improvement of 10dB relative to the Hanning window. The magnitude andlog magnitude response of lowpass filter designed using Hamming window areshown in Fig.13 and Fig.14 respectively. The first side lobe peak is -53dB; animprovement of 9dB with respect to Hanning window filter. However, at higherfrequencies the stopband attenuation is low when compared to that of Hanningwindow.
Because the Hamming window generates lesser oscillation in the side of the lobes than the Hanning window for the same main lobe width, the Hamming window is generally preferred.
Figure 10: Hamming window sequence
Figure 11: (a) Frequency response of Hamming window for N = 25 (b) Log magnitude response of Hamming window for N = 25.
Figure 12: (a) Frequency response of Hamming window for N = 51 (b) Log magnitude response of Hamming window for N = 51.
Figure 13: Frequency response of LPF using Hamming window for N = 25
Figure 14: Log magnitude response of LPF using Hamming window for N = 25
Blackman window The Blackman window sequence is given by
= 0, otherwise
Figure 15: Blackman window sequence
Figure 16: (a) Frequency response of Blackman window for N = 25 (b) Log magnitude
response of Blackman window for N = 25.
The additional cosine terms (compared with the Hamming and the Hanning windows)
reduces the sidelobes, but increases the main lobe width to . The frequency
sponse of the Blackman window is shown in Fig.17. the peak side lobe level is downabout 57dB from the main lobe peak, an improvement of 16 dB relative to theHamming window. From Fig.19 we can observe that the side lobe attenuation of alowpass filter using Blackman window is -74dB.
Figure 17: (a) Frequency response of Blackman window for N = 51 (b) Log magnitude response of Blackman window for N = 51.
Figure 18: Frequency response of LPF using Blackman window for N = 25
Figure 19: Log magnitude response of LPF using Blackman window for N = 25
Example 2: Repeat the example 1 using (a) Hanning window (b) Hamming window
Solution
(a) Hanning window
= 0 otherwise
For N = 11
= 0 otherwise
The filter coefficients can be obtained as below
The filter coefficients using Hanning window are
= 0 otherwise
The transfer function of the filter is given by
The transfer function of the realizable filter is
The causal filter coefficients are
Figure 20: Log magnitude response of example 2 using Hanning window
(a) Hamming window The Hamming window sequence is given by
The window sequence for N = 11 is given by
The filter coefficients using Hamming window sequence are
The transfer function of the filter is given by
The transfer function of the realizable filter is
The filter coefficients of causal filter are
Figure 21: Log magnitude response of example 2 using Hamming window
Realization of FIR Filters
Transversal Structure
The system function of an FIR filter can be written as
(1)
The equation can be realized as shown in figure 22.
Figure 22: Direct realization of Eq.Y(z)
This structure is known as transversal structure or direct form realization. The transversal structure requires N multipliers, N-1 adders, and N-1 delay elements.
Cascade realization
The equation 1 can be realized in cascade form from the factored form of H(z). For N odd
(2)
For N odd, N-1 will be even and H(z) will have (N-1)/2 second order factors. Each second order factored form of H(Z) is realized in direct form and is cascaded to realize H(z) as shown in figure 23.
Figure 23: Cascade realization of Eq.2
For N even
(3)
For N even, N-1 will be odd and H(z) will have one first order factor (N-2)/2 second order factors.
Each factored form of H(Z) is realized in direct form and is cascaded to realize H(z) as shown in figure 24.
Figure 24: Cascade realization of Eq.3
Example 3
Determine the direct form realization of system function
Solution
Given
The above equation can be realized as shown in Fig.25
Figure 25: Realization structure of example 3
Example 4
Obtain the cascade realization of system function
Solution
Where and
(1)
(2)
The Eq.1 and Eq.2 can be realized in direct form and can be cascaded as shwn in Fig.26.
Figure 26: Cascade realization of example 4
Example 5
Obtain the cascade realization of system function
Solution
Given
The above equation can be realized in cascade form as shown in Fig.27
Figure 27: Cascade realization of example 5