Sie sind auf Seite 1von 4

A

digital filter is a basic


building block in any Digital
Signal Processing (DSP) sys-
tem. The frequency response
of the filter depends on the value of its
coefficients, or taps. Many software
programs can compute the values of the
coefficients based on the desired fre-
FIR and IIR
quency response. These values are typi-
cally floating point numbers and they
are represented with a fairly high
degree of precision.
digital
However, when a digital filter is imple-
mented in hardware, the designer wants
to represent the coefficients (and also
filters
the data) with the smallest number of
bits that still gives acceptable resolution
for the numbers. This is because repre-
senting a number with excess bits
increases the size of the registers, buses,
adders, multipliers and other hardware
used to process that signal. The bigger
sizes result in a chip with a larger die
size, which translates into increased
power consumption and a higher chip
©Digital Vision Ltd./PhotoDisc Composite: D. Cantillo

price. Thus, the bit precisions used to


represent numbers are important in the
performance of real-world signal pro-
cessing designs.
FIR digital filters
A Finite Impulse Response (FIR)
digital filter is one whose impulse
response is of finite duration. This can The effects of finite
be stated mathematically as
bit precision
h(n) = {0, n ≤ τ 1 − ∞ < τ 1 < τ 2 < +∞
{0, n ≥ τ 2 (1)

where h(n) denotes the impulse


response of the digital filter, n is the Louis Litwin
discrete time index, and τ1 and τ2 are
constants. A difference equation is the
discrete time equivalent of a continuous impulse ripples through the tapped FIR filters also have a low sensitivity
time differential equation. The general delay line of the filter, and the output at to filter coefficient quantization errors.
difference equation for a FIR digital fil- time k (for k = 0 to M-1) is the value of This is an important property to have
ter is the k-th tap. (The function is defined as when implementing a filter on a DSP
δ(n)=1 for n=0, and δ(n)=0 for n ≠ 0.) processor or on an integrated circuit.
y(n) = Σb k x(n − k ) (2) Once the impulse passes through the
tapped delay line, the output of the filter IIR digital filters
where y(n) is the filter output at discrete is zero. This is because the tapped delay Another type of digital filter is the
time instance n, bk is the k-th feedfor- is (and remains) filled with zeros. Infinite Impulse Response (IIR) filter.
ward tap, or filter coefficient, and x(n- As you may have guessed, the impulse
k) is the filter input delayed by k Advantages of FIR filters response of an IIR filter is of infinite
samples. The Σ denotes summation FIR filters are simple to design and duration. Mathematically speaking, this
from k = 0 to k = M -1 where M is the they are guaranteed to be bounded means that either τ1 or τ2 in (1) is equal
number of feedforward taps in the FIR input-bounded output (BIBO) stable. to ∞. The general difference equation
filter. Note that the FIR filter output By designing the filter taps to be sym- for an IIR digital filter is
depends only on the previous M inputs. metrical about the center tap position, a
This feature is why the impulse FIR filter can be guaranteed to have lin- y(n) = − Σ a k y(n − k ) + Σ b k x(n − k ) (3)
response for a FIR filter is finite. ear phase. This is a desirable property
When the input to a FIR filter is the for many applications such as music where ak is the k-th feedback tap. The
Kronecker delta function δ(n), the and video processing. left Σ denotes summation from k = 1 to

28 0278-6648/00/$10.00 © 2000 IEEE IEEE POTENTIALS


k = N -1 where N is the number of feed- responsible for the infinite duration of back tap a1 in (3) and b1 = 1 is the value
back taps in the IIR filter. The right Σ the impulse response. of the single feedforward tap. The input
denotes summation from k = 0 to k = M How do we show that an IIR filter to the filter is δ(n) and the output of the
-1 where M is the number of feedfor- can have an infinite duration impulse filter at various times is shown in Table
ward taps. response? The easiest way is to consider 1. Note that although the input to the fil-
Note that, unlike the FIR filter, the a simple two-tap IIR filter with the fol- ter had only one non-zero value (at time
output of an IIR filter depends on both lowing difference equation n = 0), the output of the filter is non-
the previous M inputs and the previous zero for all time 0 ≤ n ≤ ∞. This is due
N outputs. This feedback mechanism is to the feedback nature of the IIR filter.
inherent in any IIR structure. (Feedback y(n) = α y(n − 1) + x(n) (4) From a mathematical standpoint, this
occurs when a scaled version of the out- impulse response takes on non-zero val-
put is fed back into the input.) It is where α is the value of the single feed- ues for an infinite duration. However,
the response of this IIR filter when real-
ized in practice will eventually die out.
Magnitude Of Floating Point FIR Filter Magnitude Response Of Floating Point IIR Filter This happens when the numbers
0 0 become too small to be represented with
-20 the finite precision of the filter.
-50
|H(w)| (dB)

|H(w)| (dB)

-40
-100
Advantages of IIR filters
-60 IIR filters are useful for high-speed
-150 designs because they typically require a
-80
lower number of multiplies compared to
-100
0 0.1 0.2 0.3 0.4 0.5
-200
0 0.1 0.2 0.3 0.4 0.5
FIR filters. IIR filters can also be
Digital Frequency (Hz) Digital Frequency (Hz) designed to have a frequency response
Pole-Zero Plot Of Floating Point FIR Filter Pole-Zero Plot Of Floating Point IIR Filter that is a discrete version of the frequen-
1.5 1.5 cy response of an analog filter.
1 1 Unfortunately, IIR filters do not have
Imaginary Axis

Imaginary Axis

0.5 0.5 linear phase and they can be unstable if


0 0
not designed properly. IIR filters also
are very sensitive to filter coefficient
-0.5 -0.5
quantization errors that occur due to
-1 -1 using a finite number of bits to repre-
-1.5 -1.5 sent the filter coefficients. One way to
-1 0 1 -1 0 1
Real Axis Real Axis reduce this sensitivity is to use a cascad-
ed design. That is, the IIR filter is
Fig. 1 Results for floating point FIR and IIR filters implemented as a series of lower-order
IIR filters as opposed to one high-order
section. The effect of this implementa-
Magnitude Responses Of Bit Accurate FIR Filters Pole-Zero Plots Of Bit Accurate FIR Filters
tion will be shown later in this article.
0
Imaginary Axis

1
Poles and zeros
|H(w)| (dB)

-50 0 A detailed discussion of what poles


Float and zeros are is beyond the scope of this
4 Bit -1 article. The interested reader can find
-100 out more by looking in any DSP book.
0 0.1 0.2 0.3 0.4 0.5 -1 0 1
Digital Frequency (Hz) Real Axis (See Read more about it for some possi-
0 ble sources.) Only a very brief descrip-
Imaginary Axis

1
tion will be given here.
|H(w)| (dB)

0
Suppose that a filter has the follow-
-50
Float ing transfer function
10 Bit
-100
-1
H( z ) =
( z − z )( z − z )( z − z )
1 2 3
0 0.1 0.2 0.3 0.4
Digital Frequency (Hz)
0.5 -1 0
Real Axis
1
( z − p )( z − p )( z − p )
1 2 3 (5)
0
Imaginary Axis

1 where zn and pn are values on the com-


|H(w)| (dB)

plex plane (z-domain). The zeros of the


-50 0 function are the values of z for which
Float
16 Bit
H(z) equals zero. Hence, the zeros of
-1
this function are at z = {z1, z2, z3}.
-100
0 0.1 0.2 0.3 0.4 0.5 -1 0 1 Similarly, the poles of the function
Digital Frequency (Hz) Real Axis are those values of z for which H(z)
equals infinity. Thus, the poles of this
Fig. 2 Results for bit accurate FIR filters function are at z = {p 1, p 2, and p 3}.

OCTOBER/NOVEMBER 2000 0278-6648/00/$10.00 © 2000 IEEE 29


When plotting the pole-zero plot of a on various user-defined parameters. The bits can be used to represent the digital
function, a circle (o) is used to denote filter design software usually computes filter coefficients. This reduction in
the location of a zero, and a cross (x) is and displays the filter coefficients with each coefficient’s precision causes the
used to denote a pole. a high degree of precision. If the digital frequency response of the filter to differ
filter can be implemented using that from the “ideal” response due to coeffi-
Implementation same degree of precision, then the filter cient quantization errors.
Implementing a digital filter in prac- will behave as predicted by the filter When using Bcoeff bits to represent
tice typically involves using software to design software. the filter coefficients, the total number
determine the filter coefficients based In practice, only a finite number of of possible values that the filter coeffi-
cients can take on is 2 Bcoeff . Thus,
instead of having an infinite range of
Magnitude Responses Of Bit Accurate IIR Filters Pole-Zero Plots Of Bit Accurate IIR Filters
values for the coefficients, they are
0 instead constrained to one of the 2Bcoeff

Imaginary Axis
1 levels. The location of the poles and
|H(w)| (dB)

-50
zeros of the filter are also quantized.
-100 0
Float This is because they depend on the
-150 10 Bit value of the filter coefficients.
-1
-200
0 0.1 0.2 0.3 0.4 0.5 1 0 1
The quantization of the pole and zero
Digital Frequency (Hz) Real Axis locations will typically move the poles
0 and zeros of the filter to locations that
Imaginary Axis
1
|H(w)| (dB)

-50 are different from the “ideal” setting.


-100 0 This can have drastic effects on the per-
Float formance of the filter.
-150 15 Bit -1 For example, suppose a pole is to be
-200
0 0.1 0.2 0.3 0.4 0.5 -1 0 1 located at a distance of 0.999 from the
Digital Frequency (Hz) Real Axis
0 origin. However, the quantization of
Imaginary Axis

1 that pole’s location can cause the pole


|H(w)| (dB)

-50
to be moved to a location that is at a dis-
-100 0
Float
tance of 1 from the origin (since
-150 20 Bit -1 Q{0.999} = 1 for certain bit precisions
-200 where Q{.} denotes quantization). Since
0 0.1 0.2 0.3 0.4 0.5 -1 0 1
Digital Frequency (Hz) Real Axis filters with poles on the unit circle are
unstable, quantization can cause stable
Fig. 3 Results for bit accurate IIR filters filter designs to become unstable when
actually implemented. Because of the
effects of filter coefficient quantization,
Magnitude Responses Of Bit Pole-Zero Plots Of Bit
Accurate Cascaded IIR Filters Accurate Cascaded IIR Filters
the number of bits to assign to the filter
0
coefficients (and for the data as well)
1 must be carefully chosen.
Imaginary Axis

-50
|H(w)| (dB)

-100 0
Fixed point arithmetic
Float Fixed point arithmetic is a typical for-
-150 10 Bit mat used to implement digital filters on
-1
-200 both DSP processors and in VLSI imple-
0 0.1 0.2 0.3 0.4 0.5 -1 0 1
Digital Frequency (Hz) Real Axis
mentations. (Another popular format is
0 floating point arithmetic in which num-
1 bers are represented using two parts:
Imaginary Axis

-50
mantissa and exponent.) A very popular
|H(w)| (dB)

-100 0 form of fixed point arithmetic is the


Float two’s complement fixed point format.
-150 15 Bit -1 In this format, a B-bit number’s most
-200 significant bit (MSB) represents the sign
0 0.1 0.2 0.3 0.4 0.5 -1 0 1
Digital Frequency (Hz) Real Axis of the number. The lower B-1 bits repre-
0 sent the magnitude. Using this format, a
1 B-bit number can represent signed num-
Imaginary Axis

-50
|H(w)| (dB)

bers in the range from -2B-1 to 2B-1-1.


-100 0 In two’s complement arithmetic, the
Float negative of a binary number is formed by
-150 20 Bit -1 inverting each bit of the number. We then
-200
0 0.1 0.2 0.3 0.4 0.5 -1 0 1
add a 1 to the least significant bit (LSB).
Digital Frequency (Hz) Real Axis Table 2 shows all the numbers that can be
represented with 3 bits using the two’s
Fig. 4 Results for bit accurate cascaded IIR filters complement fixed point format.

30 IEEE POTENTIALS
Simulation results Table 1 Output of example IIR filter Table 2 Two’s complement fixed
for an input of δ(n) point format for 3 bit numbers
Two ninth-order lowpass filters were
Discrete time Filter input Filter output Decimal format Fixed point format
designed to demonstrate the effects of instance x(n) y(n) 0 000
using finite bit precisions to represent 1 001
digital filter coefficients. The first filter 0 1 1
2 010
is a FIR filter, and the second one is an 1 0 α 3 011
IIR filter. Both were designed by plac- 2 0 α2 -4 100
ing the poles and zeros to get a filter -3 101
3 0 α3
with a lowpass response. -2 110
Figure 1 shows the frequency n 0 αn -1 111
response and the pole-zero plots for
these filters. These filters are referred to
as the floating point filters: The coeffi- shifted upward even more. can be reduced using the IIR filter with
cients for these filters are represented in Note that the bit accurate FIR filter’s a cascaded structure.
floating point format with the full preci- response matches the floating point
sion of the computer. The frequency response when using 16 bits. Also, there Acknowledgments
responses shown in Fig. 1 represent the is only a slight degradation in the per- The author would like to thank Dr.
desired response. The other figures show formance when using 10 bits. However, Tom “Fear & Loathing” Endres and Dr.
how using a reduced precision adversely for the IIR filter, 20 bits matches the Samir Hulyalkar (Sarnoff Digital Com-
affects the filter’s response. These filters floating point response, but dropping munications) for first getting the author
are referred to as bit accurate. the precision to 15 bits causes the fre- interested in the wonderful world of
The coefficients for these filters are quency response to change. finite bit precisions. Thanks also to
represented using the two’s complement These plots demonstrate that IIR fil- Tom Krauss (Purdue University) for
fixed point format with a finite number ters are particularly susceptible to finite numerous discussions on finite bit pre-
of bits. Three different bit precisions are bit precision effects. This is due to the cisions, cascaded filters, and the finan-
used for each bit accurate filter to show feedback nature of the IIR structure. It cial implications of the Year 2000 bug.
the performance for different precisions. causes the filter quantization effects to
Figure 2 shows the results for the bit magnify. One way to reduce this sensi- Read more about it
accurate FIR filters. The three plots on tivity is to implement the IIR filter as a • Ifeachor, E., and Jervis, B., Digital
the left show the frequency response for cascaded series of lower-order filters Signal Processing: A Practical
the floating point filter in blue and for instead of one higher-order filter. Approach, Addison-Wesley, 1995.
the bit accurate filters in red. The bit For the plots shown in Fig. 3, the IIR • Litwin, L., Endres, T., Hulyalkar,
precisions for each bit accurate filter are filter was implemented as one ninth- S., and Zoltowski, M., “The Effects Of
shown on the plot’s legend. order filter. Figure 4 shows the results Finite Bit Precision For A Fixed Point
The three plots on the right show the from implementing the same filter (same VLSI Implementation Of The Constant
pole-zero plots for the various FIR fil- zero and pole locations) as a cascade of Modulus Algorithm,” International
ters. Again, the blue corresponds to the four second-order filters and one first- Conference on Acoustics, Speech, and
locations for the floating point filter and order filter. The bit accurate frequency Signal Processing, Phoenix, AZ, Vol. 4,
the red corresponds to the locations for responses match the response of the pp. 2013-2016, March 1999.
the bit accurate filters. floating point filter at precisions of 20 • Lyons, R., Understanding Digital
At 16 bits, the bit accurate response and 15 bits (contrast this to the plots in Signal Processing, Addison-Wesley, ’97.
matches that of the floating point filter. Fig. 3). Dropping the precision to 10 bits • Proakis, J., and Manolakis, D., Digital
When the precision drops to 10 bits, the shows a slight movement in the location Signal Processing: Principles, Algorithms,
location of the zeros changes. The fre- of some poles and zeros. But the effect and Applications, Prentice-Hall, ’96.
quency response is altered slightly. on the frequency response is negligible.
Using only 4 bits for the filter coeffi- From these results, we see that the About the author
cients has a drastic effect on the loca- cascaded implementation requires a Louis Litwin is a Member of the Tech-
tion of the zeros. (Some are moved into lower bit precision when compared with nical Staff in the Corporate Research
different quadrants and even outside of the precision needed for implementing department at Thomson Multimedia where
the unit circle.) The frequency response the IIR filter as a single ninth-order fil- he works on wireless digital home net-
flattens out considerably. ter. The differences in the results shown working technology. Mr. Litwin received
The results for the IIR filters are in Figs. 3 and 4 highlight the effect that his M.S. degree in Electrical Engineering
shown in Fig. 3. As the bottom plot implementing a filter with different from Purdue University in ’99 and his B.S.
shows, 20 bits gives a frequency structures can have on its performance. degree in Electrical Engineering with dis-
response that matches the floating point tinction from Drexel University in ’97. He
filter’s response. At 15 bits there is a Conclusions was named by Eta Kappa Nu as the Alton
change in the position of some of the The simulation results presented B. Zerby and Carl T. Koerner Outstanding
poles. The frequency response is shifted show how finite bit precisions can affect Electrical Engineering Student for ’97. His
upward. Using 10 bits leads to a slight the performance of a digital filter. IIR interests include digital signal processing
change in the position of a few zeros filters were shown to be even more sus- and digital VLSI design. He often annoys
and significant changes in the positions ceptible to finite bit precision effects the IRS by computing his income taxes
of the poles. The frequency response is than FIR filters. However, these effects using only 3 bits of precision.

OCTOBER/NOVEMBER 2000 31

Das könnte Ihnen auch gefallen