Beruflich Dokumente
Kultur Dokumente
Digital Filters
of the continuous amplitude samples generate digital signals and converts the level of these samples into a numeric
tailored to be processed by digital machines. representation that can be used by a digital filter.
A digital filter is one of the basic building blocks in digital • Digital filter: The digital filter uses the discrete-time
signal processing systems. Digital filtering consists of mapping numeric representation obtained by the A/D converter
a discrete-time sequence into another discrete-time sequence to perform arithmetic operations that will lead to the
that highlights the desired information while reducing the filtered output signal.
importance of the undesired information. • Digital-to-analog (D/A) converter: The D/A converter
Digital filters are present in various digital signal processing converts the digital filter output into analog samples
applications related to speech, audio, image, video, and multi- that are equally spaced in time.
rate processing systems as well as in communication systems, • Low-pass filter: The low-pass filter converts the analog
CD players, digital radio, television, and control systems. samples of the digital filter output into a continuous-time
Digital filters can have either fixed (Antoniou, 1993; Jackson, signal.
1996; Oppenheim and Schafer, 1989; Mitra, 2001; Diniz, 2002)
or adaptive coefficients (Diniz, 2002).
In this chapter, we will describe: 2.3 Sampling of Analog Signals
• The most widely used types of digital filter transfer func-
Figure 2.2 shows the mechanism behind sampling of continu-
tions;
ous time signals and its effect on the frequency representation.
• How to design these transfer functions (i.e., how to
Figure 2.2(A) shows that a continuous signal x(t) is multiplied
calculate coefficients of digital filter transfer functions);
in the time domain by a train of unitary impulses xi(t). The
• How to map a transfer function into a digital filter struc-
resulting signal from the multiplication operation is x*(t),
ture;
which contains samples of x(t). Figure 2.2(B) shows the fre-
• The main concerns in the actual implementation in a
quency representation of the original signal x(t) before sam-
finite precision digital machine; and
piing. Figure 2.2(C) shows the spectrum of the impulse train
• The current trends in the hardware and software imple-
xi(t). Finally, Figure 2.3 shows the spectrum of the sampled
mentations of digital filters
signal x* (t). According to the convolution theorem, the Fou-
In particular, we focus on digital filters that implement rier transform of the sampled signal x*(t) should be the convo-
linear systems represented by difference equations. We will lution, in the frequency domain, of the Fourier transform of
show how to design digital filters based on magnitude specifi- the impulse train and the Fourier transform of the original
cations. In addition, we present efficient digital filter structures signal before sampling. Therefore, it can be shown that:
that are often required for implementation with minimal cost,
taking into consideration that real-time implementation leads
to nonlinear distortions caused by the finite word length x,~(d'°) = ~ x jT +j~-)
l=--o0
representations of internal signals and coefficients. Finally, (2.1)
the mostly widely used approaches to implement a digital filter 1
z - -
From the above equation and from Figure 2.2, it can be seen
2.2 Digital Signal Processing Systems that the spectrum of the sampled signal will be repeated at
every ~0s = 2 ~ / T interval. An important consequence of the
A typical digital signal processing (DSP) system comprises the
spectrum repetition is the sampling theorem shown next.
following modules, shown in Figure 2.1.
• Analog-to-digital (A/D) converter: Assuming that the
2.3.1 S a m p l i n g T h e o r e m
input signal is band-limited to frequency components
below half of the sampling frequency, the A/D converter If a continuous signal is ban&limited (i.e., X(jtOa)= 0
obtains signal samples at equally spaced time intervals for to, > We), x(t) can be reconstructed from XD(n) for
A/D converter
FIGURE 2.1 Architecture of a Complete DSP System Used to Filter an Analog Signal
2 Digital Filters 841
/ \ ma
h(t) --
T sin (tOLpt)
"fit
(2.2)
-(% mc
(B) Signal Spectrum In equation 2.2, mLp is the cutoff frequency of the designed
low-pass filter. The mLp shall be chosen to guarantee no alias-
Xi(Jma) ing (i.e., mc < mLp ~ (Os/2). The impulse response in the
above equation is depicted in Figure 2.5. It is easy to verify
that a causal filter with this exact impulse response cannot be
implemented. In practice, it is possible to design analog filters
that are good approximations for the frequency response in
i
-2ms
I
-ms 0
" ms
I t
2ms O)a
Figure 2.5.
x* (jo,~)
lIT
, \,/ , \,/--- , \,/,.
-m c
3ms ms -ms__ mc ms ms 3ms 2ms ma
2 2 2 2
37
' X (j~)
-C0 c 0 O)c (%
' XD(eJ~a)
1/T
\ / m
,V----V,
-2% -(% -~s 0 e)s ~s 2°s o
2- -°c= 2
I Xo(eJ~)
1/T
, ×--
X I
-2% 0
,X
--03s --0 s O)s --(Ds 2% (0
2 2
(C) Sampled Signal Spectrum C0c>O~s/2
l Xo(eJ~)
--\
I I I -~c o' ~c I
, \ ,/ I L
-2c0s --(I) 8
--~s 03s
0s 2c0s o
2 2
(D) Sampled Signal Spectrum Oc< o
2.4.1 Linear Time-Invariant Systems for all integers n and no. A causal digital filter is one whose
response does not anticipate the behavior of the excitation
The main classes of digital filters are the linear, time-invariant
signal. Therefore, for any two input sequences xl(n) and
(LTI) and causal filters. A linear digital filter responds to a
x2 (n) such that xl (n) = x2 (n) for n _< no, the correspond-
weighted sum of input signals with the same weighted sum of
ing responses of the digital filter are identical for n _< no;
the corresponding individual responses; that is:
that is:
F[~Xlxl(n) + o~2x2(n)] = ~xl!T[Xl(n)] + ~XzY[xz(n)], (2.4)
f{xl(n)] = f[x2(n)], for n _< no. (2.6)
for any sequences xx(n) and xz(n) and for any arbitrary con-
stants O~l and cx2. A digital filter is said to be time-invariant An initially relaxed linear-time invariant digital filter is
when its response to an input sequence remains the same, characterized by its response to the unit sample or impulse
irrespective of the time instant that the input is applied to sequence 8(n). The filter response when excited by such a
the filter. That is, 5r[x(n)] = y(n), and then: sequence is denoted by h(n), and it is referred to as impulse
response of the digital filter. Observe that if the digital filter is
F[x(n - no)] = y ( n - no), (2.5) causal, then h(n) = 0 for n < 0. An arbitrary input sequence
2 DigitalFilters 843
H (jC0a) x(n)
-O3Lp OJLp (%
l"
, h(t)
n= oo n= oo k = - o o
and the response of an LTI digital filter to x(n) can then be
expressed by: and substituting variables (l = n - k):
y(n)=F [- ~
k=-oo
x(k)6(n-k) ] n=-oo
Y(n)z-n= ~
k=-cx~
h(k)z-k ~
l=-oc
x(1)z-l. (2.13)
= ~_, x(k)T[6(n- k)] The following relation among the z-transforms of the output
k=--oo (2.8) Y(z), of the input X(z), and of the impulse response H(z) of a
digital filter is obtained as:
= ~ x(k)h(n- k)
k=-oo
Y(z) = H(z)X(z). (2.14)
= x ( n ) * h(n).
Hence, the transfer function of an LTI digital filter is the
The summation in the last two lines of the above expression, z-transform of its impulse response.
called the convolution sum, relates the output sequence of a
digital filter to its impulse response h(n) and to the input 2.4.2 Difference Equation
sequence x(n). Equation 2.8 can be rewritten as:
A general digital filter can be described according to the
following difference equation:
y(n) = ~ h(k)x(n- k). (2.9)
k= oo N M
Most digital filters can be described by difference equations Let us consider in detail a particular case of linear-phase FIR
that are suitable for implementation in digital machines. It is filters:
important to guarantee that the difference equation represents For M even:
a system that is linear, time-invariant, and causal. This is
guaranteed if the auxiliary conditions for the underlying dif-
ference equation correspond to its initial conditions, and the H(z) = h(nlz-" + h z-M/2 + Z h(nlz-"
system is initially relaxed. n=0 n=M/2+l
Nonrecursive digital filters are a function of past input
samples. In general, they can be described by equation 2.15 if Z h(n)(z-~ + z-(M ~1) + h z M/2.
a0 = 1 and ai = 0 for i = 1. . . . . N: rt=O
(2.19)
M
y(n) = Z b l x ( n - 1). (2.16) At unity circle:
I=0 Evaluating equation 2.19 (M even) at z = d °~, we have:
It can be easily shown that these filters have finite impulse M/2-1 (M) M
response and are known as FIR filters. For a0 = 1, equation H(eJ~°) = Z h(n)e-J~" + h e-j~M/2 -1- ~_. h(n)e -)°~".
2.15 can be rewritten as: n=O n=M/2+l
N M Considering the case of symmetric impulse response (i.e.,
y(n) = - Z aiy(n - i) + Z b;x(n - l). (2.17) h(n) = h(M - n) for n = 0, 1. . . . . M/2), we have:
i=1 l=0
L t • 6 10
n
P
2.6 Infinite Impulse Response Filters FIGURE 2.7 Linear-Phase FIR Filter: Typical Impulse Response
bo bo
x(n) < y(n) x(n) = t, y(n)
1
E -a 1
E
bl ? -al
-a 2
E
E bM -a N
' _82
,@--
FIGURE 2.11 Recursive Structure in Direct Form
bo
x( n ) .d) . .(g>--<?) . y(n) FIGURE 2.13 Alternative Direct-Form Structure for N = M
P x(n) o .
(A) Cascade
o n,
a2 b2
i
aN bM
x(n)c = o y(n)
,®
FIGURE 2.12 Direct Form Structure for N = M
'Yo
2.8.1 W i n d o w M e t h o d
x(n) c , o y(n) The window method starts by obtaining the impulse response
of ideal prototype filters. These responses for standard filters
are shown in Figure 2.16. In general, the impulse response is
calculated according to:
, I IP
2n ~o
(A) Low Pass
71 -ml
IH(eJco)l
~'2 t -m2
.C>-G--@.
I I.
(B) Type 2 ~cl ~c2 /'~ 2n m
3 The WLS-Chebyshevmethod is also known as the peakconstrained method. FIGURE 2.16 Ideal Frequency Responses
2 Digital Filters 849
In the case of a band-pass filter, the prototype filter can be 1 + cos (2"rr/M + 1)
(2.31)
described by following transfer function: Y = 1 + c o s ( 2 [ 3 ~ / M + 1)"
0 for 0 < ]col < Ocl. In the above equation, [3 is a variable parameter that adjusts
IH(eJ~°) I = 1 for cocl< Iml < tOc2. (2.27) the Sar~imaki window main lobe width given by 413~/M + 1.
0 for O c 2 < Iol _< 7 . In the special case of [3 = 1, the Sar~imaki window becomes
identical to the rectangular window.
Using the inverse Fourier transform, the impulse response of The desired normalized window function is as written here:
the filter with the response in equation 2.27 can be obtained as
follows: w(n) = fv(n)/fv(O), (2.32)
M/2
= ~1 Jill cl 2 cos (on)do 1 (2.28)
cl w(n) = vo(n) + 2 Z vk(n), (2.33)
k=l
1
= - - [ sin (oc2n) - sin (Ocl n)],
,n'n
where vk(n) can be calculated according to the recursive equa-
tions below:
for n # 0, for n = 0, h(0) = 1 (Oc2 - Ocl).
Different window sequences can be multiplied to h(n) to 1 n = 0. (2.34)
limit its length, generating the impulse response for the Vo(n) = 0, otherwise.
10
-10
-20
l
1
m' -30
g -40
¢-
O')
-50
-60
-70
-80
-900 lO'OO 20'00 3o'0o 4o'o0 50bo 6o.00 7o.00 8o.00 90'00 10,000
Frequency [Hz]
20
-201
\
rn
-40
"O
-I
¢-
-60
-80
-100
desired characteristics without directly considering the error specifications in terms of the maximum deviation the pass-
energy. On the other hand, the least squares approach aims to band and in part of the stopband, while minimizing the energy
minimize the error energy. As can be observed in Figure 2.18, in the stopband frequency range. This type of approximation is
there are solutions between these two extremal types of object- very useful in modern DSP systems involving subsystems with
ive functions that provide good trade-off between peak error different sampling periods. The approximation method dis-
and error energy. In this section, we present a very flexible cussed here includes the least squares and minimax approaches
approach to designing FIR digital filters satisfying prescribed as special cases.
2 Digital Filters 851
M
where:
H(z) = Z h(n)z-n' (2.38)
n=0 e = [E(~ol)E(to2) ... E(toL(M+I))]g. (2.46)
W= diag[W(tol)W(to2)... W(toL(M+l))]. (2.47)
assuming that co, = 2-rr. The frequency response of such filter
is then given by: d = [D(tol)D(to2) ... D(~oL(v+l))] r. (2.48)
. lfIm[H(eJ'°)]]
0(to) = tan ~ . ~ j~. (2.40) In these equations, L < L because the transition frequencies
were discarded.
/:/(to) = Im(d~°) I. (2.41) A low-pass filter specification includes 8p as the passband
maximum ripple and 8r as the stopband minimum attenu-
Assume that the phase response ®(to) is linear on to, that M ation, with top and tot being the passband and stopband edges,
is even, and that h(n) is symmetrical. The cases of M odd and/ respectively.
or h(n) antisymmetrical can be easily derived based on the Based on these values, the following can be defined:
proposed formulation. The frequency response of such filter
1 +Sp
thus becomes: DBp= 20 lOglo ( ~ ) [dB ] . (2.51)
D(o3) = ~1' 0<o3<o3p. (2.53) 2.9.4 Minimax Filter Design Employing WLS
( 0, o3r < o3 _< "rr. This section describes a scheme that performs Chebyshev
1, 0 < o3 < o3p. approximation as a limit of a special sequence of weighted
W(o3) = 8p/Sr, o3r < ~ < "rr.
(2.54)
least-squares approximations. The algorithm is implemented
by a series of WLS approximations using a varying weight
Other types of transfer functions can be similarly defined. matrix W k , whose elements are calculated by:
]]E(o3)]]oo = min max [W(o3)lD(o3) -/4(re)I]. (2.55) This approach entails increasing the weight where the error is
b 0<m<'rr
smaller.
Using equations 2.46 to 2.50, the Chebyshev method attempts The convergence of this algorithm is slow because usually 10
to minimize: to 15 WLS designs are required in practice to approximate the
Chebyshev solution. An efficiently accelerated algorithm was
]]E(o3)][~ ~ min max [ W l d - Ub]], (2.56) presented by Lim et al. (1992) that is characterized by the
b 0<_toi_<~r weight matrix W k whose elements are recurrently updated by:
at the discrete set of frequencies. The Chebyshev method w~+1(o3) = w~(o3)&(o3), (2.64)
minimizes:
where/)k(o3) is the envelope function of Bk(o3) formed by a set
DB~ = 20 log10 (8)[dB], (2.57) of piecewise linear segments that start and end at consecutive
extremes of Bk(o3). The band edges are considered extreme
where 8 = max [8/, 8r]. frequencies, and the edges from different bands are not con-
nected. By denoting the extreme frequencies at a particular
iteration k as o3~l,for l = 1, 2. . . . . the envelope function is
2.9.3 Weighted Least-Squares Method formed as:
The weighted least-squares (WLS) approach minimizes:
Bk(o3) = (o3 -- @)Bk(o3~l+l) + (@+1 -- o3)Bk(@) ' < to < '
(°".1 - o3'l) , o31 - - o3.1.
IIE(o3)l122=
[ [E(m)l2 do3 =
V 0
w2(o3)lD(o3)-- /-}(I.0)t2 do.
(2.58)
(2.65)
xl 0-3
1.6
1.4
1.2
0.8
i, 'i ii
ii~ 'i ii
i!f !i i ?
i! I 'i
0.6 i!i!~ I 't ii ,~ i !! ! ! i i
i
i! ' i !
i! ii , i ! i : L 'i ~i ~ ii i ~
ii ~i t i ' li ~ ii i i
0.4
ii i! i! i !i i! ! ' , ' i i i
~ i i i i ii i
ii i! i! I !i i' ~i i ~, ii
ii i! i! !i if ii i i i
0.2 ii i! i!
'f !i i 'i ~i i
!i i! i! " i' !i ' 'i ,i
i r
1000 2000 3000 4000 5000 6000 7000 8000 9000 10,000
Frequency [Hz]
FIGURE 2.19 Typical Absolute Error Function B(to) (Dash-Dotted Line) and Corresponding Envelope /~(~o) (Solid Curve). The [3(o))
corresponds to the WLS-Chebyshev method (darker dotted curve).
W#+l(O.) ) = W#(o.))~k(O.) ). (2.66) based algorithms comparable to the classic minimax approach
(Antoniou, 1993). The WLS-based methods, however, do have
For the algorithm of equation 2.65, [3k(O~) is given by: the additional advantage of being easily coded into computer
routines.
!
f 0 !< co < ~0L. (2.67)
Example
L mL<m_<~.
Design FIR using some WLS-Chebyshev filters by satisfy-
The coL is the Lth extreme value of the stopband of ing the following specifications: Ap = 0.02 dB, Ar = 32 dB,
B(~0) = [E(co)[. The passband values of B(eo) and /~(eo) are ~0p = 2w x 3400 rad/sec, tot = 2~r x 4600 rad/sec, O~s = 2w
left unchanged in equation 2.67 to preserve the equiripple x20,000 rad/sec. These are specifications established by in-
property of the minimax method, although it does not have dustry standards for prefiltering speech signals before these
to be that way. The parameter L is the single design parameter signals are subsampled to 8kHz.
for the proposed scheme. Choosing L = 1 makes the new
scheme similar to an equiripple-passband WLS design, Solution
whereas choosing L to be as large as possible (i.e., making This example applied to the functions seen in Figure 2.19
O-)L = w), we return to the original minimax algorithms. is depicted in Figure 2.20. The results are for the least-squares
The computational complexity of WLS-based algorithms, and minimax approaches and for the WLS-Chebyshev
like the algorithms here described, is of the order of filter where co~ was chosen as the fourth extreme in the
(M + 1) 3, where M + 1 is the length of the filter. This com- filter's stopband. The order of all filters is 40. Compared with
plexity can be greatly reduced by taking advantage of the the filters designed by the window methods, the WLS, WLS-
Toeplitz-plus-Hankel internal structure of the matrix Chebyshev, and the minimax filters are much more econom-
(uTw2u) in equation 2.60 and by using an efficient grid ical. The reader should note that the passband ripple specified
scheme to minimize the number of frequency values. These here is 10 times smaller than the value used in the window
simplifications make the computational complexity of WLS- example.
854 Marcio G. Siqueira and Paulo S.R. Diniz
10 , , ,
-10
-2O
7
m -30
2
(D
-0 t
= -40
¢-
03
, li i t !
! n ; i .,\lli'
z; -50
-80
lo;o 2o'oo 3o'oo 4o'oo sooo 6000 7000 '.80~0 000 10,000
Frequency [Hz]
;" •I i
FIGURE 2.20 Frequency Responses of the WLS, WLS (Dotted Line), WLS-Chebyshev(Dashes and Dotted Line), and the Minimax (Solid
Line) Filters
N
2.10 IIR Filter Approximations
Hal(z) = Z T rkz (2.69)
Z - - eP k T '
k=l
IIR filters are usually designed by using analog filter approxi-
mations that are easy to apply and are well established. IIR filters where rk and Pk are the zeros and poles of the analog transfer
can also be designed by using optimization methods. It is function approximation.
known, however, that simultaneous approximation of magni-
tude and phase is a difficult problem, and no reliable iterative Bilinear Transformation Method
design methods are available. The use of optimization methods
The b i l i n e a r t r a n s f o r m a t i o n m e t h o d is based on applying the
in IIR filter design is more common in equalization problems
transformation s = 2(z - 1)/T(z + 1) to the designed analog
when specifications for both magnitude and phase are given.
transfer function, so that:
There are two popular methods for designing digital filters As a consequence, the bilinear transformation maps the analog
starting from analog approximations: the i m p u l s e i n v a r i a n c e frequencies into the digital frequencies as follows:
m e t h o d and the bilinear t r a n s f o r m a t i o n m e t h o d . These
methods are discussed in the following sections. 2 toT
toa = ~ t a n (2.71)
1 2
Impulse Invariance Method
In the impulse invariance method, a digital filter is designed so Therefore, to design a digital filter with predefined specifica-
that its impulse response is close to the sampled analog im- tions, it is necessary to first design an analog transfer function
pulse response. This method is useful for low-pass and some with adjusted specifications (prewarped) according to the
band-pass filter approximations. In general: above equation.
Figure 2.21 (A) shows how the frequencies in the digital filter
ha(n) = Tha(nT), (2.68) are mapped into the designed analog filter frequencies. Figure
2.21(B) shows how the frequency response is affected by the
where ha(n) is the digital filter impulse response and ha(t) is bilinear transformation frequency mapping.
the analog filter impulse response with desired specifications. The prewarped specifications of the low-pass analog filter
The above equation implies: prototype are given by:
2 Digital Filters 855
2 H(s) - G - , sl (2.75)
2~a f_o aN-isi"
lOs
When the bilinear transformation in equation 2.70 is applied
1 to the transfer function shown above, the resulting transfer
function in the z-domain is shown below:
H ( z ) -- ~ m O bN-lZl
(2.76)
0.5 1.0 ZT o aN_jzi
2o)
IO s
It can be shown (Psenicka et al., 2002) that it is possible to
(A) Analog and Digital Frequencies create a transformation that maps the coefficients hi into ai
and bl into bl as shown below.
a = PN x a. (2.77)
b = PN x b. (2.78)
i. i
. . . . It
- i i The a and b are vectors for the coefficients ai and bl defined by:
.11 *lo
[Ha(jlo) l ',,, :
a = [aN aN 1 aN 2... a0] T.
i i i (2.79)
IH(ello)l i
,':~,'
i i
b = [bN bN 1 bN-2...b0]V.
~lo
The vectors h and b contain, respectively, the coefficients hi
and bl as follows:
(B) Bilinear Transformation Effects
= [3.9597 x 10 -26, 1.5498 x 10 -42, 1.1041 x 10 -25, • Round-off errors derived from internal signals that are
1.4569 x 10 -42, 6.8799 x 10 -26, 0] T. quantized before or after more down additions;
• Deviations in the filter response due to finite word length
b = 10-2310.0040 0.0169 0.0433 0.0868 0.0862 0.1000] r representation o f multiplier coefficients; and
• Errors due to representation of the input signal with a set
and the matrix P5 is as written here: of discrete levels.
10 , , ,
"0
OJ
,%
-10
-20
-30
-40
1
-50
-60
-70
-80
0 10'00 20'00 30'00 4000 5000 60'00 70'00 80'00 90'00 10,000
Frequency [Hz]
FIGURE 2.22 Magnitude Response of the Designed Low-Pass Elliptic Digital Filter
2 Digital Filters 857
u(n) y(n)
Linear network
where bo is the sign bit and where bl b2b3 . . . bb represent the Py(z) = ~Y2e ~ Gi(z)Gi(z-1) , (2.87)
modulus using a binary code. For digital filtering, the most i=1
widely used binary code is the two's complement representa-
tion, where for positive numbers b0 = 0 and for negative
numbers b0 = 1. The fractionary part of the number, called ei(n)
x2 here, is represented as:
x( n) o ,, , o y(n)
x if bo = O. (2.85)
x2 = 2 -[x] if bo = 1. FIGURE 2.24 Model for the Noise Generated after a Multiplication
858 Marcio G. Siqueira and Paulo S.R. Diniz
Overflow nonlinearities influence the most significant bits of which means that:
the signal and cause severe distortion. An overflow can give
rise to self-sustained, high-amplitude oscillations known as IlFf(d~)llp < 1, forllX(~a~°)ll q < Mmax, (2.92)
overflow limit cycles. Digital filters, which are free of zero-
input limit cycles, are also free of overflow oscillations if the The K is the number of multipliers in the filter.
overflow nonlinearities are implemented with saturation arith- The norm p is usually chosen to be infinity or 2. The L~
metic, that is, by replacing the number in overflow by a norm is used for input signals that have some dominating
number with the same sign and with maximum magnitude frequency component, whereas the L2 norm is more suitable
that fits the available wordlength. for a random input signal. Scaling coefficients can be imple-
When there is an input signal applied to a digital filter, mented by simple shift operations provided they satisfy the
overflow might occur. As a result, input signal scaling is re- overflow constraints.
quired to reduce the probability of overflow to an acceptable In case of modular realizations, such as cascade or parallel
level. Ideally, signal scaling should be applied to ensure that the realizations of digital filters, optimum scaling is accomplished
probability of overflow is the same at each internal node of the by applying one scaling multiplier per section.
digital filter. This way, the signal-to-noise ratio is maximized in As an illustration, we present the equation to compute the
fixed-point implementations. scaling factor for the cascade realization with direct-form
In two's complement arithmetic, the addition of more than second-order sections:
two numbers will be correct independently of the order in
1
which they are added even if overflow occurs in a partial
summation as long as the overall sum is within the available xi = II I1~{ Hj(z)Fi(z)tl~ (2.93)
range to represent the numbers. As a result, a simplified scaling
technique can be used where only the multiplier inputs require where:
scaling. To perform scaling, a multiplier is used at the input of
1
the filter section as illustrated in Figure 2.25. z
Fi(Z) Z2 ÷ mliz ÷ m2i
It is possible to show that the signal at the multiplier input is
given by: The noise power spectral density is computed as:
whereas the output noise variance is given by: 2.12 Real-Time Implementation
of Digital Filters
2 2 [ 3+
3 1 2II I Si(d~°)l[22+5 ~-~ csll
1 /H_~
j Si(eJ~)ll
"22]
0"° = O'e ~11 i=1 j=2 )kj There are many distinct means to implement a digital filter.
The detailed description of these implementation methods is
(2.95)
beyond the scope of this chapter. The interested reader can
refer to Wanhammar (1990) and Diniz (2002) and the refer-
As a design rule, the pairing of poles and zeros is performed
as explained here: poles closer to the unit circle pair with closer ences therein.
zeros to themselves, such that IIHi(z) llp is minimized for p = 2 The most straightforward way to implement digital filters
o r p ~-- oo.
relies on general purpose computers by programming their
For ordering, we define the following: central processing units (CPUs) to execute the operations
related to a particular digital filter structure. This type of
implementation is very flexible because it consists of writing
p~_ [IHi(z)ll~ (2.96) software, allowing fast prototyping and testing. This solution,
IIHi(z)ll2 however, might not be acceptable in applications requiring
high-processing speed, fast data input/output interfaces, or
For L2 scaling, we order the section such that Pi is decreasing.
large-scale production.
For L~ scaling, Pi should be increasing.
Efficient software implementations of digital filters are
usually based on special-purpose CPUs known as Digital
2.11.4 GranularityLimit Cycles Signal Processors (DSPs). These processors are capable of
implementing a sum of product operations, also referred to
The quantization noise signals become highly correlated from
as multiply-and-accumulate (MAC) operations, in a very effi-
sample to sample and from source to source when signal levels
cient manner.
in a digital filter become constant or very low, at least for short
Another implementation alternative is to employ program-
periods of time. This correlation can cause autonomous oscil-
mable logic devices (PLD) that include a large number of logic
lations called granularity limit cycles.
functions on a single chip. An advanced version of PLD is the
In recursive digital filters implemented with rounding, mag-
field-programmable gate array (FPGA). An FPGA is an array of
nitude truncation, 4 and other types of quantization, limit-
logic macro-cells that are interconnected through a number of
cycles oscillations might occur.
communication channels configured in horizontal and vertical
In many applications, the presence of limit cycles can be
directions. The FPGAs allow the system designer to configure
harmful. Therefore, it is desirable to eliminate limit cycles or to
very complex digital logic that can implement digital signal
keep their amplitude bounds low.
processing tasks at low cost with reduced power consumption.
If magnitude truncation is used to quantize particular
Usually, high-level software tools are available for the design of
signals in some filter structures, it can be shown that it
digital systems using FPGAs.
is possible to eliminate zero-input limit cycles. As a conse-
Special purpose hardware is also possible for implementing
quence, these digital filters are free of overflow limit cycles
a digital filter. Hardware implementations consist of designing
when overflow nonlinearities, such as saturation arithmetic,
and possibly integrating a digital circuit with logical gates to
are used.
perform the basic operating blocks inherent to any digital filter
In general, the referred methodology can be applied to the
structure, namely multiplications, additions, and storage
following class of structures:
elements. Multiplications and additions can be implemented
• State-space structures: Cascade and parallel realization of using bit-serial or bit-parallel architectures. In general, hard-
second-order state-space structures includes design con- ware implementations of digital filters are less flexible than
straints to control nonlinear oscillations (Diniz and Anto- software (CPU-based) implementations. Special purpose hard-
niou, 1986). ware, however, is usually necessary when high cost of develop-
• Wave digital filters: These filters emulate doubly termin- ment is offset by a large production and a DSP-based solution
ated lossless filters and have inherent stability under is too expensive or is incapable of meeting sampling frequency
linear conditions as well as in the nonlinear case where specifications.
the signals are subjected to quantization (Fettweis, 1986). Consider a heuristic related to the computational complex-
• Lattice realization: Modular structures allowing easy limit ity of digital filters in a full custom design (Dempster, 1995).
cycles elimination (Gray and Markel, 1975). Figure 2.26 shows an intuitive plot of complexity as a function
of filter order for all digital filter implementations meant to
4 Truncation here refers to the magnitude of the number is reduced, which satisfy a given set of specifications. The complexity of a digital
leads to the decrease of its energy. filter is measured in terms of number of bits used in the
860 Marcio G. Siqueira and Paulo S.R. Diniz
Complexity These filters are very important building blocks for signal
processing systems implemented in discrete-time domain. In
particular, the widely available digital technology allows the
implementation of very fast and sophisticated filters in a cheap
!
J ~ t i n g spec / and reliable manner. As a result, the digital tilers are found in
j will be in this region J
numerous commercial products such as audio systems, bio-
medical equipment, digital radio, and TV just to mention a few.
References
Antoniou, A. (1993). Digital filters: Analysis, design, and applications.
(2d ed). New York: McGraw-Hill.
Min. ............... Slopeis minimum Dempster, A. ( 1995). Digital filter design for low-complexity implemen-
cost .......... feasible tation. Ph.D. Thesis. University of Cambridge, Cambridge, UK.
.......!'"' word length
Diniz, P.S.R. (2002). Adaptive filtering: Algorithms and practical imple-
m mentation. (2d Ed.). Boston, MA: Kluwer Academic.
NO N1 Order Diniz, P.S.R., and Antoniou, A. (1986). More economical state-space
digital filter structures which are free of constant-input limit cycles.
FIGURE 2.26 Complexity of a Digital Filter IEEE Transactions on Acoustic Speech Signal Processing ASSP-34,
807-815.
Diniz, ES.R., da Silva, E.A.B., and Netto, S.L. (2002). Digital signal
coefficients and number of multiplier operations, s For a pre- processing: System analysis and design. Cambridge, UK: Cambridge
scribed set of frequency specifications and a particular filter University.
structure, a certain order No may be capable of meeting the Diniz, P.S.R., and Netto, S.L. (1999). On WLS-Chebyshev FIR digital
specifications with infinite precision. For filters with an order filters. Journal of Circuits, Systems, and Computers 9, 155-168.
lower than No, it is not possible to meet the prescribed specifi- Fettweis, A. (1986). Wave digital filters: Theory and practice. Proceed-
cations. Infinite precision is translated as very high complexity ings of the 1EEE 74, 270-327.
because an infinite number of bits is required. If higher order is Gray, A.H. Jr., and Markel, J.D. (1975). A normalized digital filter
structure. IEEE Transactions on Acoustic Speech Signal Processing
used, the number of bits necessary for multiplier coefficients
ASSP-23, 268-277.
may be reduced, implying lower complexity. An order N1 in
Jackson, L.B. (1996). Digital filters and signal processing. (3rd ed.).
Figure 2.26 is the order of the implementation with the lowest Boston, MA: Kluwer Academic.
possible complexity. Orders higher than N1 will necessarily Lim, Y.C., Lee, J.H., Chen, C.K., and Yang, R.H. (1992). A weight
imply higher complexity. The heuristic introduced here, least-squares algorithm for quasi-equiripple FIR and IIR digital
when applied to the case of FIR filter designs using direct- filter design. IEEE Transactions on Signal Processing 40, 551-558.
form realizations, leads to complexity curves that are very flat Mitra, S.K., (2001). Digital signal processing: A computer-based
around their m i n i m u m point, indicating that almost min- approach. (2d ed). New York: McGraw-Hill.
i m u m complexity can be achieved for a wide range of values Oppenheim, A.V., and Schafer, R.W. (1989). Schafer, Discrete-time
for the filter order. On the other hand, for IIR filters, the signal processing. Englewood Cliffs, NJ: Prentice Hall.
complexity curve is rather sharp, implying that a more careful P~eni~ka, B., Garcia-Ugalde, E, and Herrera-Camacho, A. (2002).
The bilinear Z transform by Pascal matrix and its application in
choice for the filter order should be made.
the design of digital filters. IEEE Signal Processing Letters 9,
368-370.
Sar~imaki, T. (1992). Finite-impulse response filter design. In S.K.
2.13 Conclusion Mitra and J.E Kaiser, (Eds.) Handbook of digital signal processing.
New York: John Wiley & Sons.
In this chapter the main steps for the design and implementa- Wanhamman, L. (1999). DSP integrated circuits. New York: Academic
tion of linear and time-invariant digital filters are introduced. Press.