5
Design and Implementation
of FIR Filters
A filter is a system that is designed to alter the spectral content of input signals in
a specified manner. Common filtering objectives include improving signal quality,
extracting information from signals, or separating signal components that have been
previously combined. A digital filter is a mathematical algorithm implemented in hard-
ware, firmware, and/or software that operates on a digital input signal to produce a
digital output signal for achieving filtering objectives. A digital filter can be classified
as being linear or nonlinear, time invariant or varying. This chapter is focused on the
design and implementation of linear, time-invariant (LTI) finite impulse response
(FIR) filters. The time-invariant infinite impulse response (IIR) filters will be discussed
in Chapter 6, and the time-varying adaptive filters are introduced in Chapter 8.
The process of deriving the digital filter transfer function H(z) that satisfies the
given set of specifications is called digital filter design. Although many applications
require only simple filters, the design of more complicated filters requires the use of
sophisticated techniques. A number of computer-aided design tools (such as MATLAB)
are available for designing digital filters. Even though such tools are widely available,
we should understand the basic characteristics of digital filters and familiar with
techniques used for implementing digital filters. Many DSP books devote substantial
efforts to the theory of designing digital filters, especially approximation methods,
reflecting the considerable work that has been done for calculating and optimizing filter
coefficients.
5.1 Introduction to Digital Filters
As discussed in previous chapters, filters can be divided into two categories: analog
filters and digital filters. Similar specifications are used for both analog and digital
filters. In this chapter, we will discuss digital filters exclusively. The digital filters
are assumed to have a single input x(n), and a single output y(n). Analog filters are
used as design prototypes for digital IIR filters, and will be briefly introduced in
Chapter 6.
Real-Time Digital Signal Processing. Sen M Kuo, Bob H Lee
2
n are the filter outputs due to
the application of the inputs x
1
n and x
2
n, respectively. The important property of
linearity is that in the computation of y(n) due to x(n), we may decompose x(n) into a
summation of simpler components x
i
n. We then compute the response y
i
n due to
input x
i
n. The summation of y
i
n will be equal to the output y(n). This property is
also called the superposition.
A time-invariant system is a system that remains unchanged over time. A digital filter
is time-invariant if the output due to the application of delayed input xn À m is equal
to the delayed output yn À m, where m is a positive integer. It means that if the input
signal is the same, the output signal will always be the same no matter what instant the
input signal is applied. It also implies that the characteristics of a time-invariant filter
will not change over time.
A digital filter is causal if the output of the filter at time n
0
does not depend on the
input applied after n
0
in a signal through the system and attenuates other frequency components. The range of
frequencies that is allowed to pass through the filter is called the passband, and the
range of frequencies that is attenuated by the filter is called the stopband. If a filter is
defined in terms of its magnitude response, there are four different types of filters:
lowpass, highpass, bandpass, and bandstop filters. Each ideal filter is characterized by a
passband over which frequencies are passed unchanged (except with a delay) and a
stopband over which frequencies are rejected completely. The two-level shape of the
magnitude response gives these filters the name brickwall. Ideal filters help in analyzing
and visualizing the processing of actual filters employed in signal processing. Achieving
an ideal brickwall characteristic is not feasible, but ideal filters are useful for concep-
tualizing the impact of filters on signals.
As discussed in Chapter 3, there are two basic types of digital filters: FIR filters and
IIR filters. An FIR filter of length L can be represented with its impulse response h(n)
that has only L non-zero samples. That is, hn0 for all n ! L. An FIR filter is also
called a transversal filter. Some advantages and disadvantages of FIR filters are sum-
marized as follows:
1. Because there is no feedback of past outputs as defined in (3.1.16), the FIR filters
are always stable. That is, a bounded input results in a bounded output. This
inherent stability is also manifested in the absence of poles in the transfer function
as defined in (4.3.8), except possibly at the origin.
2. The filter has finite memory because it `forgets' all inputs before the L À 1th
previous one.
3. The design of linear phase filters can be guaranteed. In applications such as audio
signal processing and data transmission, linear phase filters are preferred since they
avoid phase distortion.
4. The finite-precision errors (discussed in Chapter 3) are less severe in FIR filters than
in IIR filters.
5. FIR filters can be easily implemented on most DSP processors such as the
TMS320C55x introduced in Chapter 2.
6. A relatively higher order FIR filter is required to obtain the same characteristics as
c
. Lowpass filters are generally used when the signal
components of interest are in the range of DC to the cut-off frequency, but other higher
frequency components (or noise) are present.
The magnitude response of an ideal highpass filter is illustrated in Figure 5.1(b). The
regions ! ! !
c
and 0 !<!
c
are referred to as the passband and stopband, respec-
tively. A highpass filter passes all high-frequency components above the cut-off fre-
quency !
c
and attenuates all low-frequency components below !
c
. As discussed in
Chapter 1, highpass filters can be used to eliminate DC offset, 60 Hz hum, and other
low frequency noises.
The magnitude response of an ideal bandpass filter is illustrated in Figure 5.1(c). The
regions !<!
a
and !>!
b
are referred to as the stopband. The frequencies !
a
and !
b
are called the lower cut-off frequency and the upper cut-off frequency, respectively. The
H(w) H(w)
H(w) H(w)
(d) bandstop
184
DESIGN AND IMPLEMENTATION OF FIR FILTERS
region !
a
! !
b
is called the passband. A bandpass filter passes all frequency
components between the two cut-off frequencies !
a
and !
b
, and attenuates all fre-
quency components below the frequency !
a
and above the frequency !
b
. If the passband
is narrow, it is more common to specify the center frequency and the bandwidth of the
passband. A narrow bandpass filter may be called a resonator (or peaking) filter.
The magnitude response of an ideal bandstop (or band-reject) filter is illustrated
in Figure 5.1(d). The regions ! !
a
and ! ! !
b
are referred to as the passband.
The region !
a
<!<!
b
well as specify a transition band between the passband and stopband. The design is
based on magnitude response specifications only, so the phase response of the filter is
not controlled. Whether this is important depends on the application. Realizable filters
do not exhibit the flat passband or the perfect linear phase characteristic. The deviation
of jH!j from unity (0 dB) in the passband is called magnitude distortion, and the
deviation from the linear phase of the phase response H! is called phase distortion.
The characteristics of digital filters are often specified in the frequency domain. For
frequency-selective filters, the magnitude response specifications of a digital filter are
often given in the form of tolerance (or ripple) schemes. In addition, a transition band is
specified between the passband and the stopband to permit the magnitude drop off
smoothly. A typical magnitude response of lowpass filter is shown in Figure 5.2. The
dotted horizontal lines in the figure indicate the tolerance limits. In the passband, the
magnitude response has a peak deviation d
p
and in the stopband, it has a maximum
deviation d
s
. The frequencies !
p
and !
s
are the passband edge (cut-off) frequency and
the stopband edge frequency, respectively.
INTRODUCTION TO DIGITAL FILTERS
185
Passband
A
p
A
s
p
. That is,
1 À d
p
jH!j 1 d
p
,0 ! !
p
: 5:1:4
The passband ripple, d
p
, is a measure of the allowed variation in magnitude response in
the passband of the filter. Note that the gain of the magnitude response is normalized to
1 (0 dB). In practical applications, it is easy to scale the filter output by multiplying the
output by a constant, which is equivalent to multiplying the whole magnitude response
by the same constant gain.
In the stopband, the magnitude approximates 0 with an error d
s
. That is,
jH!j d
s
, !
s
! p: 5:1:5
The stopband ripple (or attenuation) describes the maximum gain (or minimum
attenuation) for signal components above the !
s
.
Passband and stopband deviations may be expressed in decibels. The peak passband
ripple, d
p
=20
À 1
10
A
p
=20
1
5:1:8
and
d
s
10
ÀA
s
=20
: 5:1:9
Example 5.1: Consider a filter specified as having a magnitude response in the
passband within Æ0:01. That is, d
p
0:01. From (5.1.6), we have
A
p
20 log
10
1:01
0:99
0:1737 dB:
When the minimum stopband attenuation is given as d
!
m
!
a
!
b
p
, 5:1:10a
H(w)
w
1
2
1
w
a
w
m
w
b
Figure 5.3 Magnitude response of bandpass filter with narrow bandwidth
INTRODUCTION TO DIGITAL FILTERS
187
where !
a
and !
b
are the lower and upper cut-off frequencies, respectively. The
bandwidth is the difference between the two cut-off frequencies for a bandpass filter.
T
d
!
Àdf!
d!
, 5:1:13
where f! is the phase response of the filter.
A filter is said to have a linear phase if its phase response satisfies
f!Àa!, À p ! p 5:1:14
or
f!b À a!, À p ! p 5:1:15
These equations show that for a filter with a linear phase, the group delay T
d
! given in
(5.1.13) is a constant a for all frequencies. This filter avoids phase distortion because all
sinusoidal components in the input are delayed by the same amount. A filter with a
nonlinear phase will cause a phase distortion in the signal that passes through it. This is
because the frequency components in the signal will each be delayed by a different
amount, thereby altering their harmonic relationships. Linear phase is important in data
communications, audio, and other applications where the temporal relationships
between different frequency components are critical.
The specifications on the magnitude and phase (or group delay) of H! are based on
the steady-state response of the filter. Therefore they are called the steady-state speci-
fications. The speed of the response concerns the rate at which the filter reaches the
steady-state response. The transient performance is defined for the response right after
188
DESIGN AND IMPLEMENTATION OF FIR FILTERS
the application of an input signal. A well-designed filter should have a fast response, a
small rise time, a small settling time, and a small overshoot.
In theory, both the steady-state and transient performance should be considered in
1
z
À1
ÁÁÁb
LÀ1
z
ÀLÀ1
LÀ1
l0
b
l
z
Àl
: 5:2:2
5.2.1 Linear Convolution
As discussed in Section 3.2.2, the output of the linear system defined by the impulse
response h(n) for an input signal x(n) can be expressed as
ynxnÃhn
I
lÀI
hlxn À l: 5:2:3
Thus the output of the LTI system at any given time is the sum of the input samples
convoluted by the impulse response coefficients of the system. The output at time n
0
is
given as
yn
.
Repeat steps 2±4 in computing the output of the system at other time instants n
0
.
This general procedure of computing convolution sums can be applied to (5.2.1) for
calculating the FIR filter output y(n). As defined in (3.2.15), the impulse response of the
FIR filter is
hl
0, l < 0
b
l
,0 l < L
0, l ! L.
@
5:2:5
If the input signal is causal, the general linear convolution equation defined in (5.2.3)
can be simplified to (5.2.1). Note that the convolution of the length M input with the
length L impulse response results in length L M À 1 output.
Example 5.2: Consider an FIR filter that consists of four coefficients b
0
, b
1
, b
2
,
and b
3
. From (5.2.1), we have
yn
In general, we have
ynb
0
xnb
1
xn À 1b
2
xn À 2b
3
xn À 3, n ! 3:
The graphical interpretation is illustrated in Figure 5.4.
As shown in Figure 5.4, the input sequence is flipped around (folding) and then
shifted to the right over the filter coefficients. At each time instant, the output value is
the sum of products of overlapped coefficients with the corresponding input data
190
DESIGN AND IMPLEMENTATION OF FIR FILTERS
aligned below it. This flip-and-slide form of linear convolution can be illustrated in
Figure 5.5. Note that shifting xÀl to the right is equivalent to shift b
l
to the left one
unit at each sampling period.
As shown in Figure 5.5, the input sequence is extended by padding L À 1 zeros to its
right. At time n 0, the only non-zero product comes from b
0
and x(0) which are time
aligned. It takes the filter L À 1 iterations before it is completely overlapped with the
input sequence. The first L À 1 outputs correspond to the transient behavior of the FIR
filter. For n ! L À 1, the filter aligns over the non-zero portion of the input sequence.
That is, the signal buffer of FIR filter is full and the filter is in the steady state. If the
input is a finite-length sequence of M samples, there are L M À 1 output samples and
x(n−2)
b
3
x(n−3)
b
0
b
1
b
2
b
3
n = 0:
n = 1:
n = 2:
n ≥ 3:
x(0)
x(0)
x(0)
x(1)
x(1)
x(2)
x(n)
Figure 5.4 Graphical interpretation of linear convolution, L 4
b
0
b
0
b
1
L
À 1
z
L
: 5:2:7
Thus the comb filter has L poles at the origin (trivial poles) and L zeros equally spaced
on the unit circle at
z
l
e
j2p=Ll
, l 0, 1, ..., L À 1: 5:2:8
Example 5.3: The zeros and the frequency response of a comb filter can be
computed and plotted using the following MATLAB script for L 8:
b [10000000À1];
zplane(b, 1)
freqz(b, 1, 128);
The zeros on the z-plane are shown in Figure 5.6(a) and the characteristic of comb
shape is shown in Figure 5.6(b). The center of the passband lies halfway between
the zeros of the response, that is at frequencies
2l 1p
L
, l 0, 1, ..., L À 1.
Because there is not a large attenuation in the stopband, the comb filter can
only be used as a crude bandstop filter to remove harmonics at frequencies
!
l
2pl=L , l 0, 1, ..., L À 1: 5:2:9
Comb filters are useful for passing or eliminating specific frequencies and their
harmonics. Periodic signals have harmonics and using comb filters are more efficient
0
−5
−10
−15
0.1 0.2 0.3 0.4 0.5
Magnitude (dB)
Normalized Frequency (ϫp rad/sample)
0.6 0.7 0.8 0.9 1
0
100
50
0
−50
−100
0.1 0.2 0.3 0.4 0.5
Phase (degrees)
Normalized Frequency (ϫp rad/sample)
0.6 0.7 0.8 0.9 1
Figure 5.6 Zeros of a simple comb filter L 8 and its frequency response: (a) zeros, and
(b) magnitude (top) and phase (bottom) responses
Hz
1 À z
ÀL
1 À z
À1
: 5:2:10
This is a lowpass filter with passband centered at z 1, where the pole±zero cancella-
tion occurs. Since the pole at z 1 is canceled by the zero at z 1, the system defined
by (5.2.10) is still the FIR filter. Note that canceling the zero at z 1 produces a
lowpass filter, canceling the zeros at z Æj produces a bandpass filter, and canceling
rate f
s
, and the stopband attenuation is fixed by L.
Example 5.4: Consider a simple moving-average filter
yn
1
2
xnxn À 1, n ! 0:
The transfer function of the filter can be expressed as
Hz
1
2
1 z
À1
ÀÁ
,
which has a single zero at z À1 and the frequency response is given by
H!
1
2
1 e
Àj!
ÀÁ
1
2
e
Àj!=2
e
j!=2
If L is an odd number, we define M L À 1=2. If we define h
l
b
lM
, then (5.2.1)
can be written as
194
DESIGN AND IMPLEMENTATION OF FIR FILTERS
Bz
2M
l0
b
l
z
Àl
M
lÀM
b
lM
z
ÀlM
z
ÀM
M
lÀM
h
Àj!M
H!
e
Àj!M
M
lÀM
h
l
e
Àj!l
45
e
Àj!M
h
0
M
l1
h
l
e
j!l
e
Àj!l
ÀÁ
45
e
Àj!M
B!e
Àj!M
H!e
Àj!M
M
l1
h
l
e
j!l
e
Àj!l
ÀÁ
45
e
Àj!M
À2j
M
l1
h
l
sin!l
45
:
5:2:19
If h
l
is real, then H! is pure imaginary and the phase of B(z) is a linear function of !.
(b)
l
(c)
l
(d)
Center of
symmetry
Center of
symmetry
Center of
symmetry
Figure 5.7 Coefficients of the four types of linear phase FIR filters: (a) type I: L even L 8,
positive symmetry, (b) type II: L odd L 7, positive symmetry, (c) type III: L even L 8,
negative symmetry, and (d) type IV: L odd L 7, negative symmetry
196
DESIGN AND IMPLEMENTATION OF FIR FILTERS
(L even, positive symmetry) filter is always 0 at the Nyquist frequency. This type of filter
is unsuitable for a highpass filter. Type III (L even, negative symmetry) and IV (L odd,
negative symmetry) filters introduce a 908 phase shift, thus they are often used to design
Hilbert transformers. The frequency response is always 0 at DC frequency, making
them unsuitable for lowpass filters. In addition, type III response is always 0 at the
Nyquist frequency, also making it unsuitable for a highpass filter.
The symmetry (or anti-symmetry) property of a linear-phase FIR filter can be
exploited to reduce the total number of multiplications into almost half. Consider the
realization of FIR filter with an even length L and positive symmetric impulse response
as given in (5.2.20), Equation (5.2.2) can be combined as
Hzb
0
1 z
ÀL1
l
xn À lxn À L 1 l:
5:2:23
A realization of H(z) defined in (5.2.22) is illustrated in Figure 5.8. For an anti-
symmetric FIR filter, the addition of two signals is replaced by subtraction. That is,
yn
L=2À1
l0
b
l
xn À lÀxn À L 1 l: 5:2:24
As shown in (5.2.23) and Figure 5.8, the number of multiplications is cut in half by
adding the pair of samples, then multiplying the sum by the corresponding coefficient.
x(n)
y(n)
x(n−1) x(n−L/2+1)
x(n−L/2)
x(n−L+1)
x(n−L+2)
z
−1
z
−1
z
−1
z
−1
z
−1
b
l
xn À l5:2:25
and the transfer function
Hz
L
2
lÀL
1
b
l
z
Àl
: 5:2:26
Some typical applications of non-causal filters are the smoothing filters, the interpola-
tion filters, and the inverse filters. A simple example of a non-causal filter is a Hanning
filter with coefficients f0:25, 0:5, 0:25g for smoothing estimated pitch in speech pro-
cessing.
5.2.4 Realization of FIR Filters
An FIR filter can be realized to operate either on a block basis or a sample-by-sample
basis. In the block processing case, the input is segmented into multiple blocks. Filtering
is performed on one block at a time, and the resulting output blocks are recombined to
form the overall output. The filtering of each block can be implemented using the linear
convolution technique discussed in Section 5.2.1, or fast convolution using FFT, which
will be introduced in Chapter 7. The implementation of block-FIR filter with the
TMS320C55x will be introduced in Section 5.6. In the sample-by-sample case, the
input samples are processed at every sampling period after the current input x(n)is
available. This approach is useful in real-time applications and will be discussed in this
section.
Hzb
0
1 b
11
z
À1
b
12
z
À2
1 b
21
z
À1
b
22
z
À2
ÁÁÁ1 b
M1
z
À1
b
M2
z
À2
b
0
as tables illustrated in Figure 5.10. In order to compute the output at any time, we
simply have to multiply the corresponding values in each table and sum the results.
That is,
ynb
0
xnb
1
xn À 1ÁÁÁb
LÀ1
xn À L 1: 5:2:29
In FIR filtering, the coefficient values are constant, but the data in the signal buffer
changes every sampling period, T. That is, the x(n) value at time n becomes xn À 1 in
the next sampling period, then xn À 2, etc., until it simply drops off the end of the
delay chain.
x(n) y(n)
b
0
H
1
(z) H
2
(z) H
M
(z)
Input
Output
b
m2
b
m1
x(n − L + 2)x(n − L + 1)
...
x(n − L + 1)
Current
Time, n
Next
time, n+1
Discarded
Next data
Figure 5.11 Refreshing the signal buffer for FIR filtering
The signal buffer is refreshed in every sampling period in the fashion illustrated in
Figure 5.11, where the oldest sample xn À L 1 is discarded and other signals are
shifted one location to the right in the buffer. A new sample (from ADC in real-time
application) is inserted to the memory location labeled as x(n). The FIR filtering
operation that computes y(n) using (5.2.29) is then performed. The process of refreshing
the signal buffer shown in Figure 5.11 requires intensive processing time if the operation
is not implemented by the DSP hardware.
The most efficient method for handling a signal buffer is to load the signal samples
into a circular buffer, as illustrated in Figure 5.12(a). Instead of shifting the data
forward while holding the buffer addresses fixed, the data is kept fixed and the addresses
are shifted backwards (counterclockwise) in the circular buffer. The beginning of the
signal sample, x(n), is pointed at with a pointer and the previous samples are loaded
sequentially from that point in a clockwise direction. As we receive a new sample, it is
placed at the position x(n) and our filtering operation defined in (5.2.29) is performed.
After calculating the output y(n), the pointer is moved counterclockwise one position to
the point at xn À L 1 and we wait for the next input signal. The next input at time
n 1 is written to the xn À L 1 position, and is referred to as x(n) for the next
iteration. This is permitted because the old xn À L 1 signal dropped off the end of
our delay chain after the previous calculation as shown in Figure 5.11. The circular
buffer implementation of a signal buffer, or a tapped-delay-line is very efficient. The
(b)
Figure 5.12 Circular buffers for FIR filter: (a) circular buffer for holding the signals for FIR
filtering. The pointer to xn is updated in the counterclockwise direction, and (b) circular buffer for
FIR filter coefficients, the pointer always pointing to b
0
at the beginning of filtering
buffer. It is also used in sinewave generators and wavetable sound synthesis, where a
stored waveform can be generated periodically by cycling over the circular buffer.
Figure 5.12(b) shows a circular buffer for FIR filter coefficients. Circular buffer
allows the coefficient pointer to wrap around when it reaches to the end of the
coefficient buffer. That is, the pointer moves from b
LÀ1
to b
0
such that the filtering
will always start with the first coefficient.
5.3 Design of FIR Filters
The objective of FIR filter design is to determine a set of filter coefficients fb
l
,
l 0, 1, ..., L À 1g such that the filter performance is close to the given specifications.
A variety of techniques have been proposed for the design of FIR filters. In this section,
we discuss two direct design methods. The first method is based on truncating the
Fourier series representation of the desired frequency response. The second method is
based on specifying equally spaced frequency samples of the frequency response of the
desired filter.
5.3.1 Filter Design Procedure
The design of digital FIR filters involves five steps:
1. Specification of filter requirements.
2. Calculation and optimization of filter coefficients.
Àj!n
, 5:3:1
where
hn
1
2p
p
Àp
H!e
j!n
d!, ÀI n I: 5:3:2
This equation shows that the impulse response h(n) is double-sided and has infinite
length. If H! is an even function in the interval j!j p, we can show that (see exercise
problem)
hn
1
p
p
0
H! cos!nd!, n ! 0 5:3:3
and the impulse response is symmetric about n 0. That is,
hÀnhn, n ! 0: 5:3:4
202
DESIGN AND IMPLEMENTATION OF FIR FILTERS
For a given desired frequency response H!, the corresponding impulse response
(filter coefficients) h(n) can be calculated for a non-recursive filter if the integral (5.3.2)
or (5.3.3) can be evaluated. However, in practice there are two problems with this simple
design technique. First, the impulse response for a filter with any sharpness to its
: 5:3:6
It is clear that this filter is not physically realizable in real time since the filter must
produce an output that is advanced in time with respect to the input.
A causal FIR filter can be derived by delaying the h
H
n sequence by M samples.
That is, by shifting the time origin to the left of the vector and re-indexing the
coefficients as
b
H
l
h
H
l À M, l 0, 1, ...,2M: 5:3:7
The transfer function of this causal FIR filter is
B
H
z
LÀ1
l0
b
H
l
z
Àl
: 5:3:8
This FIR filter has L 2M 1 coefficients b
H
l
H
!j: 5:3:11
This causal filter has the same magnitude response as that of the non-causal filter. If h(n)
is real, then H
H
! is a real function of ! (see exercise problem). As discussed in Section
5.2.3, if H
H
!!0, then the phase of B
H
! is equal to ÀM!.IfH
H
! < 0, then the
phase of B
H
! is equal to p À M!. Therefore the phase of B
H
! is a linear function of !
and thus the transfer function B
H
z has a constant group delay.
Example 5.5: The ideal lowpass filter of Figure 5.1(a) has frequency response
H!
1, j!j !
c
0, otherwise.
&
5:3:12
The corresponding impulse response can be computed using (5.3.2) as
hn
1
2p
e
j!
c
n
À e
Àj!
c
n
jn
!
sin!
c
n
pn
!
c
p
sinc
!
c
n
p
,
5:3:13a
is referred to as sinc function, where a commonly used precise form for the sinc
p
=6pg. By shifting M units to the right, we obtain a causal FIR filter of finite-
length L 2M 1 with coefficients
b
H
l
!
c
p
sinc
!
c
l À M
p
!
,0 l L À 1
0, otherwise.
V
`
X
5:3:15
Example 5.6: Design a lowpass FIR filter with the frequency response
H f
1, 0 f 1 kHz
0, 1 kHz < f 4 kHz
&
204
DESIGN AND IMPLEMENTATION OF FIR FILTERS
when the sampling rate is 8 kHz. The duration of the impulse response is limited to
0:4p with filter
length L 41 and L 61.
When L 41, M L À 1=2 20. From (5.3.15), the designed impulse
response is given by
b
H
l
0:4 sinc
0:4pl À 20
p
, l 0, 1, ...,40:
When L 61, M L À 1=2 30. The impulse response becomes
b
H
l
0:4 sinc
0:4pl À 30
p
, l 0, 1, ...,60:
The magnitude responses are computed and plotted in Figure 5.13 using the
MATLAB script exam5_7.m given in the software package.
5.3.3 Gibbs Phenomenon
As shown in Figure 5.13, the causal FIR filter obtained by simply truncating the
impulse response coefficients of the desired filter exhibits an oscillatory behavior
(or ripples) in its magnitude response. As the length of the filter is increased, the number
of ripples in both passband and stopband increases, and the width of the ripples
decrease. The ripple becomes narrower, but its height remains almost constant. The
largest ripple occurs near the transition discontinuity and their amplitude is independent