Fir Filter
Fir Filter
Fir Filter
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 (IIR) 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, i.e., 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 non-recursive 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 filters:
1. FIR filters are always stable.
2. FIR filters with exactly linear phase can easily be designed.
3. FIR filters can be realized in both recursive and non-recursive structures.
4. FIR filters are free of limit cycle 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 narrow transition band FIR filters is very costly, as it requires
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.
N 1
where h(n) is the impulse response of the filter. The frequency response [Fourier transform of
h(n)] is given by
N 1
H( ω ) = h(n) e j n
n0
which is periodic in frequency with period 2 , i.e.,
H( ω ) = H( ω + 2k ), k = 0, 1, 2, ...
Since H(ω ) is complex it can be expressed as
where H(ω ) is the magnitude response and (ω) is the phase response
d
i.e. τp = τg =α which means that α is independent of
frequency.
We have
N 1
N 1
N 1
i.e.
N 1
This shows that FIR filters will have constant phase and group delays when the impulse
response is symmetrical about α= (N – 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 is2 3 1 samples.
(a) (b)
Figure 1 Impulse response sequence of symmetrical sequences for (a) N odd (b) N even.
If only constant group delay is required and not the phase delay, we can write
θ(ω ) = β – αω
Now, we have
This gives
Cross multiplying and rearranging, we get
This shows that FIR filters have constant group delay τ g and not constant phase delay when
the impulse response is antisymmetrical about α= (N – 1)/2.
The impulse response satisfying
32 the antisymmetry condition is shown in Figure 2. When
N = 9, the centre of antisymmetry occurs at fourth sample and when N = 8, the centre of
antisymmetry occurs at samples. From Figure 2, we find that h[(N – 1)/2] = 0 for
antisymmetric odd sequence.
a b
Figure 2 Impulse response sequence of antisymmetric sequences for (a) N odd (b) N even.
EXAMPLE 1 The length of an FIR filter is 7. If this filter has a linear phase, show that
is satisfied
Solution: The length of the filter is 7. Therefore, for linear phase,
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.
Rectangular Window
The weighting function (window function) for an N-point rectangular window is given by
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.
Because of these characteristics, the triangular window is not usually a good choice
The raised cosine window multiplies the central Fourier coefficients by approximately unity
and smoothly truncates the Fourier coefficients toward the ends of the filter. The smoother
ends and broader middle section produces less distortion of hd(n) around n = 0. It is also
called generalized Hamming window.
The window sequence is of the form:
Hanning W i ndow
The Hanning window function is given by
The width of main lobe is 8 /N, i.e., 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 filter 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
In the magnitude response for N = 31, the magnitude of the first side lobe is down about 41dB
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 filter designed using Hamming window, the first side lobe peak is –51 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
In the magnitude response, the width of the main lobe is 12π /N, which is highest among
windows. The peak of the first side lobe is at –58 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 increasing 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.
EXAMPLE 3
Design an ideal low-pass filter with N = 11 with a frequency response
We have