Finite Impulse Response Filters

>
« back to results for ""
Below is a cache of http://ecow.engr.wisc.edu/cgi-bin/get/bme/463/tompkins/biomedical/chapter5.pdf. It's a snapshot of the page taken as our search engine crawled the Web.
The web site itself may have changed. You can check the current page or check for previous versions at the Internet Archive. Yahoo! is not affiliated with the authors of this page or responsible for its content.
Finite Impulse Response Filters 100
5
Finite Impulse Response Filters
Jesse D. Olson
A finite impulse response (FIR) filter has a unit impulse response that has a limited
number of terms, as opposed to an infinite impulse response (IIR) filter which
produces an infinite number of output terms when a unit impulse is applied to its
input. FIR filters are generally realized nonrecursively, which means that there is
no feedback involved in computation of the output data. The output of the filter
depends only on the present and past inputs. This quality has several important
implications for digital filter design and applications. This chapter discusses
several FIR filters typically used for real-time ECG processing, and also gives an
overview of some general FIR design techniques.
5.1 CHARACTERISTICS OF FIR FILTERS
5.1.1 Finite impulse response
Finite impulse response implies that the effect of transients or initial conditions on
the filter output will eventually die away. Figure 5.1 shows a signal-flow graph
(SFG) of a FIR filter realized nonrecursively. The filter is merely a set of tap
weights of the delay stages. The unit impulse response is equal to the tap weights,
so the filter has a difference equation given by Eq. (5.1), and a transfer function
equation given by Eq. (5.2).
y(nT) = k = 0
N
b
k
x(nT kT)
(5.1)
H(z) = b
0
+ b
1
z
1
+ b
2
z
2
+ + b
N
z
N
(5.2) Finite Impulse Response Filters
101
X (z)
Y (z)
z
-1 b
1
b
2
b
3
b
N b
0
z
-1
z
-1
z
-1
Figure 5.1
The output of a FIR filter of order N is the weighted sum of the values in the storage
registers of the delay line.
5.1.2 Linear phase
In many biomedical signal processing applications, it is important to preserve
certain characteristics of a signal throughout the filtering operation, such as the
height and duration of the QRS pulse. A filter with linear phase has a pure time
delay as its phase response, so phase distortion is minimized. A filter has linear
phase if its frequency response H(e
j
)
can be expressed as
H(e
j
)
= H
1
(
)
e
j(

+

)
(5.3)
where H
1
( ) is a real and even function, since the phase of H(e
j
)
is H(e
j
)
=
{ ; H
1
( ) > 0 ; H
1
( ) < 0

(5.4)
FIR filters can easily be designed to have a linear phase characteristic. Linear
phase can be obtained in four ways, as combinations of even or odd symmetry
(defined as follows) with even or odd length.
h(N 1 k) = h(k), even symmetry
h(N 1 k) = h(k), odd symmetry
}
for 0 k N
(5.5)
5.1.3 Stability
Since a nonrecursive filter does not use feedback, it has no poles except those that
are located at z = 0. Thus there is no possibility for a pole to exist outside the unit
circle. This means that it is inherently stable. As long as the input to the filter is
bounded, the output of the filter will also be bounded. This contributes to ease of
design, and makes FIR filters especially useful for adaptive filtering where filter
coefficients change as a function of the input data. Adaptive filters are discussed in
Chapter 8.
5.1.4 Desirable finite-length register effects 102
Biomedical Digital Signal Processing
When data are converted from analog form to digital form, some information is
lost due to the finite number of storage bits. Likewise, when coefficient values for
a filter are calculated, digital implementation can only approximate the desired
values. The limitations introduced by digital storage are termed finite-length
register effects. Although we will not treat this subject in detail in this book, finite-
length register effects can have significant negative impact on a filter design. These
effects include quantization error, roundoff noise, limit cycles, conditional
stability, and coefficient sensitivity. In FIR filters, these effects are much less
significant and easier to analyze than in IIR filters since the errors are not fed back
into the filter. See Appendix F for more details about finite-length register effects.
5.1.5 Ease of design
All of the above properties contribute to the ease in designing FIR filters. There are
many straightforward techniques for designing FIR filters to meet arbitrary fre-
quency and phase response specifications, such as window design or frequency
sampling. Many software packages exist that automate the FIR design process, of-
ten computing a filter realization that is in some sense optimal.
5.1.6 Realizations
There are three methods of realizing an FIR filter (Bogner and Constantinides,
1985). The most common method is direct convolution, in which the filters unit
impulse sequence is convolved with the present input and past inputs to compute
each new output value. FIR filters attenuate the signal very gradually outside the
passband (i.e., they have slow rolloff characteristics). Since they have significantly
slower rolloff than IIR filters of the same length, for applications that require sharp
rolloffs, the order of the FIR filter may be quite large. For higher-order filters the
direct convolution method becomes computationally inefficient.
For FIR filters of length greater than about 30, the fast convolution realization
offers a computational savings. This technique takes advantage of the fact that
time-domain multiplication, the frequency-domain dual of convolution, is compu-
tationally less intensive. Fast convolution involves taking the FFT of a block of
data, multiplying the result by the FFT of the unit impulse sequence, and finally
taking the inverse FFT. The process is repeated for subsequent blocks of data. This
method is discussed in detail in section 11.3.2.
The third method of realizing FIR filters is an advanced, recursive technique in-
volving a comb filter and a bank of parallel digital resonators (Rabiner and Rader,
1972). This method is advantageous for frequency sampling designs if a large
number of the coefficients in the desired frequency response are zero, and can be
used for filters with integer-valued coefficients, as discussed in Chapter 7. For the
remainder of this chapter, only the direct convolution method will be considered.
5.2 SMOOTHING FILTERS Finite Impulse Response Filters
103
One of the most common signal processing tasks is smoothing of the data to reduce
high-frequency noise. Some sources of high-frequency noise include 60-Hz,
movement artifacts, and quantization error. One simple method of reducing high-
frequency noise is to simply average several data points together. Such a filter is
referred to as a moving average filter.
5.2.1 Hanning filter
One of the simplest smoothing filters is the Hanning moving average filter. Figure
5.2 summarizes the details of this filter. As illustrated by its difference equation,
the Hanning filter computes a weighted moving average, since the central data
point has twice the weight of the other two:
y(nT) = 1
4
[
]
x(nT)
+

2<i>x(nT T)
+
x(nT 2<i>T)
(5.6)
As we saw in section 4.5, once we have the difference equation representing the
numerical algorithm for implementing a digital filter, we can quickly determine the
transfer equation that totally characterizes the performance of the filter by using
the analogy between discrete-time variables and z</i>-domain variables.
Recognizing that x(nT) and y(nT) are points in the input and output sequences
associated with the current sample time, they are analogous to the undelayed z-
domain variables, X(z) and Y(z) respectively. Similarly x(nT T), the input value
one sample point in the past, is analogous to the z</i>-domain input variable delayed
by one sample point, or X(z)z
1
. We can then write an equation for output Y(z) as a
function of input X(z):
Y(z) = 1
4 [X(z) + 2<i>X(z)z
1
+ X(z)z
2
]
(5.7)
The block diagram of Figure 5.2(a) is drawn using functional blocks to directly
implement the terms in this equation. Two delay blocks are required as designated
by the 2 exponent of z. Two multipliers are necessary to multiply by the factors 2
and 1/4, two summers are needed to combine the terms. The transfer function of
this equation is
H(z) = 1
4
[
]
1
+

2<i>z
1

+
z
2

(5.8)
This filter has two zeros, both located at z = 1, and two poles, both located at z =
0 (see section 4.6 to review how to find pole and zero locations). Figure 5.2(b)
shows the pole-zero plot. Note the poles are implicit; they are not drawn since they
influence all frequencies in the amplitude response equally. 104
Biomedical Digital Signal Processing
X (z)
Y (z)
z
-1
z
-1
2
1/4
z plane
(a)
(b