Beruflich Dokumente
Kultur Dokumente
Fixed-point-IIR-filter
challenges
IIR FILTERS CAN MEET HIGHLY SELECTIVE MAGNITUDEFREQUENCY-RESPONSE SPECIFICATIONS WITH A LOW-ORDER
APPROACH. AS SUCH, AN IIR IS OFTEN THE TECHNOLOGY
OF CHOICE IN REALIZING FREQUENCY-SELECTIVE TONE DETECTORS, NARROWBAND SPECTRAL FILTERS, NOISE REJECTERS,
AND DIGITAL CONTROLLERS. THEIR DESIGN, HOWEVER, ENTAILS
SOME UNIQUE CHALLENGES.
FIGURE 1functions. You use the first four deterministic filhe historic roleSTEVE
of IIR EDN061109MS4214
(infinite-impulse-re- Walker-AR
sponse)-filter-design software is to translate a set ter classes to synthesize a classic fixed-coefficient filter based
of frequency-domain design specifications into a on user-specified passband-critical frequencies and maximum
transfer function that is based on recognized IIR- attenuation and stopband-critical frequencies and minimum
filter models. You can use any of dozens of com- attenuation. The last three design methods synthesize AR,
mercially available software packages to synthe- fixed-coefficient, feedback-only IIR filters in terms of measize a transfer function from a set of user specifications. The sured or desired input/output spectral responses.
SPT (signal-processing toolbox) and FDATool (filter-design
The choice of which filter model to use is generally not the
and -analysis tool) in The Mathworks (www.mathworks. issue. Often, the designer specifies or selects the IIR type from
com) Matlab, for example, contain many of the objects you a restricted list. For performance and cost reasons, designers
need to synthesize an IIR-transfer function. These functions generally prefer fixed-point approaches over floating-point
include Matlabs Butterworth, Chebyshev I, Chebyshev II, el- instantiations. Unfortunately, fixed-point designs are highly
liptic, Burg-AR (autoregressive), covariance-AR, and Yule- susceptible to a range of degrading finite-word-length effects,
F
FIXED-POINT
EXTERNAL GAIN
F0
y(n)Cx(n)Du(n)
x(n1)Ax(n)Bu(n)
F
EXTERNAL-GAIN
FIXED-POINT SS FILTER
F0
V
+
OUT
u
_
ABS
TO
FLOAT
y(n)Cx(n)Du(n)
x(n1)Ax(n)Bu(n)
NPG
F
FIXED-POINT
UNITY GAIN
F0
1
y(n)Cx(n)Du(n)
x(n1)Ax(n)Bu(n)
F
UNITY-GAIN
FIXED-POINT SS FILTER
F0
SQRT
SQRT
FLOATING-POINT
EXTERNAL-GAIN
EXTERNAL GAIN FLOATING-POINT SS FILTER
F0
F0
INPUT
RUNNING
VARIANCE
V
+
OUT
F
TO
FLOAT
u
_
RUNNING
VARIANCE
SQRT
ln
LOG
(ANS)
ln
LOG()
ln
K
NONUNITYDIVIDE COMPUTED
PRECISION
BY
LOG2
K
PREDICTED
DIVIDE PRECISION
BY
LOG2
K
UNITYDIVIDE COMPUTED
PRECISION
BY
LOG2
y(n)Cx(n)Du(n)
x(n1)Ax(n)Bu(n)
FLOATING-POINT
UNITY-GAIN
UNITY GAIN
FLOATING-POINT SS FILTER
F0
F0
Figure 1 A Simulink simulator tests the behavior of a 16-bit filter for fractional precisions ranging from FE[0,15].
IIR-FILTER ARCHITECTURES
You define the physical implementation of a digital filter
d
in terms of its architecture. Architecture refers to how
a designer builds a filter using primitive building-block
elements, such as shift registers, memory, multipliers,
x[k]
x[k1]
u[k]
y[k]
and adders. Many DSP-system engineers are generally
b
T
cT
aware of only one or two possible filter architectures.
However, many architectural choices exist, each carrying
relative advantages and disadvantages. Some architecA
STATE
OUTPUT
tural choices are application-specific, and others have
MODEL
MODEL
general-purpose implications. Some provide better control of finite-word-length effects, and others emphasize
Figure A Understanding the relationship between the state
reduced complexity and increased speed. The more commodel and a given architecture is important.
mon architectures are Direct I, Direct II, cascade, parallel,
normal cascade, normal parallel, lattice/ladder, wave, and
architecture, includes state variables. You use the statebiquadratic.
variable model to audit the information entering, exiting,
The two most popular architectural choices are Direct II
and residing within a digital filter. Equation A illustrates a
and cascade. However, all can implement a given transstate-variable model of a single-input, single-output, Nthfer function, H(z). If you build an IIR (infinite-impulseorder IIR (Figure A). The state-model is x[k1]Ax[k1]
response) filter using floating-point arithmetic, then all
x[k]+bu[k], and the output model is [yk]cT x[k]du[k],
architectures would have identical input/output behavior.
where x[k] is the N-dimension state vector of state variThis behavior is not the case when you implement deables, u[k] is the input, and y[k] is the output. The other
signs using fixed-point arithmetic. Fixed-point arithmetic
elements of the state-variable model are an NN feedgives rise to finite-word-length effects that can degrade
back matrix A, a 1N input vector b, an N1 output veca filters performance. The choice of architecture, in turn,
strongly influences the severity of these errors. It is there- tor c, and a scalar-direct input/output-path gain d. The
filters N registers store x[k] and x[k1] on the next clock
fore essential that fixed-point-IIR-filter developers know
cycle. Because state-variable models model the internal
how to exercise control over the design environment and
behavior of digital filters and this information is critical in
minimize the impact of these errors on the outcome.
managing register overflow, understanding the relationAn IIR filters transfer function, H(z), which you produce
ship between the state model and a given architecture is
using The Mathworks Matlab or another commercial
important.
software tool, quantifies only an IIR filters input/outThe Direct II architecture is a common IIR form. It is
put behavior. A transfer function, unfortunately, does
based on interpreting an Nth-order IIR transfer function,
not quantify the filters internal workings in which errors
H(z), as the following equation shows:
emerge and accumulate. The filters internal structure, or
d0=2
c1=21
b1=1
T
x1[k]
10
1
0
0
0
0
1
0
10
0
0
1
mike
T
x4[k]
a12=0
edn061109ms4214figb
x4[k1]
x3[k]
1
1
21
0
0
2
; b=
; c=
; d0=2.
0
0
16
0
0
1
c4=1
T
x2[k]
a11=10
A=
x3[k1]
y[k]
c3=16
x2[k1]
c2=2
x1[k1]
u[k]
a13=10
a14=1
1
K d0 C( z )
.
D( z )
A
0
0
Equation A
Equations for sidebar MS4214
u[k]
w[k]
y1,[k]
wQ,[k]
N(z) b0 +b1z1
+1 bNzN N
b
c
z
c
z
H(z)=K
=
11
N
K a0 +a z
D(z)
+
1 a zN N
a 00 a10 +a1z + N +aNz
b
(b b a / a )z1 (bNb0aN / a 0 )zN
K 0 1 0 1 10 1
N
.
aK0 d0 C( z ) Da(0z+a
) 1z + +aNz
1
N
b0
c1z cNz
K
1
N
a 0 a 0 +a1z + +aNz
(B)
A
; b .
0 1
0
0
0
0 0
1
0
1 0
a1 aN2 aN1 aN
element
between
state
The (i,j)
1 of
0 A defines
0 the path
0 gain 0
x [k1], b is the path gain between
the input
xj[k]
and
A i i
; b .
and xi[k1],
ci is the
between
0
0 and
the out1 path gain
0
0 xi[k]
C of the direct input/output
0Equation
put, and
d0 isthe gain
0 path.
0
1
0
One caveat you should know about is that Matlab statevariable programs make state assignments in a reverse
order to what you generally find in signal-processing literature and textbooks.
Equation
C
2
You
can
convert
2 z1 the
2ztransfer
4 z3function
z4 H(z) into a Direct
H( z )using
II form
the1Matlab
functions
TF2SS
or ZP2SS. The
4
1 10 z 0z2
10
z3zfunction,
function TF2SS converts
a
transfer
H(z)KN(z)/
1
2
3 4
H( z )
2z 16z z
21z
1
1 10z
2
3
4
0z 10 z z
x1[k1]
u[k]
Q
1=1
HEquation
( z ) bK
H( z )
HDi( z)..
H( z ) K Hi( z )..
(D)
i 1
b
b
b
1
a
a
E
H(z). Yousos
define
02
12Equation
22 subfilters
12 by combining
22
second-order
,
b0L
b1L
b2L
d0=2
a1L a2L
b1=1
x2[k]
x1[k]
y[k]
1 a11 a21
1 a12 a22
,
x3[k1]
1 a1L a2L
c1=23
x3[k1]
a11=0
,
1 10z1 0z210 z3z4
Equation E
T
x1[k]
i 1
(C)
21z1 2z216z3z4
which you factor using Equation A. From this factorization, you can construct a
database
4
2 z1 for
2z2a Direct
4 z3 II
zfilter.
H( z )
Specifically, [A,B,C,D]tf2ss([2
1
2
4
1],[1
10
0
10
Equation D 1 10 z1 0z210z3z4
1]).
1
z(Direct
2z2II).
16z3z4
A10 0 10 1 1 0 0 0 0
1
0200 021
10
,
1
2
1 10z 0z 10 z3z4
B1 0 0 0.
C21 2 16 1.
Q
D2.
H( z ) K Hi( z )..
Figure B graphically
interprets this Direct II state fouri 1
tuple S[A,b,c,d] and itsEquation
inducedDarchitecture.
Figure C shows another important IIR form, the cascade architecture. You use the basic cascade architecture
to implement a transfer function of the form:
c2=2
x2[k1]
2
1 10 z 0z 10z z
3 4
21z1 2z216zc=21
z
D
1
2 Equation
,
1
2
3 4
1 10z 0z 10 z z
1
0
.
0
0