Вы находитесь на странице: 1из 32

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
response sequence of the filter

are the desired impulse

The z-transform of the sequence is given by :

(2)
(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.075
-0.045

- 0.159

-0.225

=h(5) = 0.75 , .

+ 0. 75

-0.225

-0.159

(9)

Design of FIR filters using windows


The desired frequency response
of a filter is periodic in
frequency and can be expanded in a Fourier series. The resultant series
is given by

Where

and known as Fourier coefficients having infinite length. One possible


way 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 and
stopband. These oscillations are due to slow convergence of the Fourier
series and this effect is known as the Gibbs phenomenon. To reduce
these oscillations, the Fourier coefficients of the filter are modified by
multiplying the infinite impulse with a finite weighing sequence
called a window where
for
= 0 for

After multiplying window sequence


with
, we get a finite
duration sequence
that satisfies the desired magnitude response
for
= 0 for

The

frequency

convolution of

of

response
and

the

filter

can

be

obtained

by


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) Log


magnitude 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 in


Fig.5 and Fig.6 respectively. The main lobe width of Hanning window is
twice that of the rectangular window, which results in a doubling of the
transition 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 smaller
ripples in both passband and stopband of the lowpass filter designed using
Hanning window. The minimum stopband attenuation of the filter is 44 dB
which is 23dB lower than the filter designed using rectangular window. At
higher 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


are shown in Fig.10 and
The window sequence and its magnitude response
Fig.11 respectively. The peak side lobe level is down about 41dB from the main lobe
peak, an improvement of 10dB relative to the Hanning window. The magnitude and
log magnitude response of lowpass filter designed using Hamming window are
shown in Fig.13 and Fig.14 respectively. The first side lobe peak is -53dB; an
improvement of 9dB with respect to Hanning window filter. However, at higher
frequencies the stopband attenuation is low when compared to that of Hanning
window.

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 down
about 57dB from the main lobe peak, an improvement of 16 dB relative to the
Hamming window. From Fig.19 we can observe that the side lobe attenuation of a
lowpass 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

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 (N2)/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