Digital Filters
Digital Filters
4.1 Introduction
where the bl coefficients are directly related to the system impulse response, that is,
bl = h(l). Due to the finite length of their impulse responses, nonrecursive filters
are also referred to as finite-duration impulse-response (FIR) filters. We can rewrite
equation (4.1) as
M
y(n) = h(l)x(n − l) (4.2)
l=0
Applying the z transform to equation (4.2), we end up with the following input–output
relationship
M M
Y (z)
−l
H (z) = = bl z = h(l)z −l (4.3)
X (z) l=0 l=0
148
149 4.2 Basic structures of nonrecursive digital filters
–1 –1
X (z) z z X (z)
x(n) x(n – 1)
(a)
mj
x(n) ✕ m j x(n)
(b)
x1(n)
+
x2(n)
x1(n) + x2(n) + ... + xj (n)
xj (n)
(c)
Figure 4.1 Classic representation of basic elements of digital filters: (a) delay; (b) multiplier;
(c) adder.
In practical terms, equation (4.3) can be implemented in several distinct forms, using
as basic elements the delay, the multiplier, and the adder blocks. These basic elements
of digital filters and their corresponding standard symbols are depicted in Figure 4.1.
An alternative way of representing such elements is the so-called signal flowgraph
shown in Figure 4.2. These two sets of symbolisms representing the delay, multiplier,
and adder elements, are used throughout this book interchangeably.
The simplest realization of an FIR digital filter is derived from equation (4.3). The
resulting structure, seen in Figure 4.3, is called the direct-form realization, as the
multiplier coefficients are obtained directly from the filter transfer function. Such a
structure is also referred to as the canonic direct form, where for a canonic form
we understand any structure that realizes a given transfer function with the minimum
number of delays, multipliers, and adders. More specifically, a structure that utilizes
the minimum number of delays is said to be canonic with respect to the delay element,
and so on.
150 Digital filters
–1
z
x(n) x(n – 1)
(a)
mj
x(n) mj x(n)
(b)
x1(n)
x2(n)
xj (n)
(c)
Figure 4.2 Signal-flowgraph representation of basic elements of digital filters: (a) delay;
(b) multiplier; (c) adder.
x(n) z
–1 –1
z ………… –1
z
–1
z
y (n )
An alternative canonic direct form for equation (4.3) can be derived by expressing
H (z) as
M
H (z) = h(l)z −l = h(0) + z −1 h(1) + z −1 (h(2) + · · · + h(M)) + · · · (4.4)
l=0
y(n)
–1
z + z
–1
+ –1
z + –1
z +
x(n)
…
Figure 4.4 Alternative direct form for FIR digital filters.
x(n) y( n )
✕ + ✕ + … ✕ +
γ01 γ02 γ0N
–1 –1 –1
z z z
✕ ✕ ✕
γ11 γ12 γ1N
–1 –1 –1
z z z
✕ ✕ ✕
γ21 γ22 γ2N
where if M is the filter order, then N = M/2 when M is even, and N = (M + 1)/2
when M is odd. In the latter case, one of the γ2k becomes zero.
where B(ω) is real, and τ and φ are constant. Hence, the impulse response h(n) of
linear-phase filters satisfies
∞
1
h(n) = H (e jω )e jωn dω
2π −∞
∞
1
= B(ω)e− jωτ + jφ e jωn dω
2π −∞
e jφ ∞
= B(ω)e jω(n−τ ) dω
2π −∞
= e jφ b(n − τ ) (4.7)
We can then deduce that for a filter to be linear phase with group delay τ , its impulse
response must satisfy
and then
We now proceed to show that linear-phase FIR filters present impulse responses of
very particular forms. In fact, equation (4.11) implies that h(0) = e2 jφ h ∗ (2τ ). Hence,
if h(n) is causal and of finite duration, for 0 ≤ n ≤ M, we must necessarily have that
M
τ= (4.12)
2
and then, equation (4.11) becomes
h(n) = e2 jφ h ∗ (M − n) (4.13)
This is the general equation that the coefficients of a linear-phase FIR filter must
satisfy.
153 4.2 Basic structures of nonrecursive digital filters
In the common case where all the filter coefficients are real, then h(n) = h ∗ (n), and
equation (4.13) implies that e2 jφ must be real. Thus
kπ
φ= , k∈Z (4.14)
2
and equation (4.13) becomes
That is, the filter impulse response must be either symmetric or antisymmetric.
From equation (4.6), the frequency response of linear-phase FIR filters with real
coefficients becomes
M kπ
H (e jω ) = B(ω)e− jω 2 + j 2 (4.16)
For all practical purposes, we only need to consider the cases when k = 0, 1, 2, 3, as
all other values of k will be equivalent to one of these four cases. Furthermore, as B(ω)
can be either positive or negative, the cases k = 2 and k = 3 are obtained from cases
k = 0 and k = 1 respectively, by making B(ω) ← −B(ω).
Therefore, we consider solely the four distinct cases described by equations (4.13)
and (4.16). They are referred to as follows:
We now proceed to demonstrate that h(n) = (−1)k h(M −n) is a sufficient condition
for an FIR filter with real coefficients to have a linear phase. The four types above are
considered separately.
• Type I: k = 0 implies that the filter has symmetric impulse response, that is, h(M −
n) = h(n). Since the filter order M is even, equation (4.3) may be rewritten as
M
2 −1 M
−n M −M
H (z) = h(n)z +h z 2 + h(n)z −n
n=0
2
n= M
2 +1
M
2 −1
−n −(M−n)
M M
= h(n) z +z +h z− 2 (4.17)
n=0
2
Evaluating this equation over the unit circle, that is, using the variable transforma-
tion z → e jω , one obtains
154 Digital filters
M
2 −1
jω
− jωn (− jωM+ jωn)
M M
H (e ) = h(n) e +e +h e− jω 2
n=0
2
M
2 −1
M
M M
= e− jω 2 h + 2h(n) cos ω n − (4.18)
2 n=0
2
M
2
M M M
H (e jω ) = e− jω 2 h + 2h − m cos(ωm)
2 m=1
2
M
2
M
= e− jω 2 a(m) cos(ωm) (4.19)
m=0
M−1
2
M
−n
H (z) = h(n)z + h(n)z −n
n=0 n= M+1
2
M−1
2
= h(n)[z −n + z −(M−n) ] (4.20)
n=0
M−1
2
jω − jωn (− jωM+ jωn)
H (e ) = h(n) e +e
n=0
M−1
2
− jω M M M
=e 2 h(n) e− jω(n− 2 ) + e jω(n− 2 )
n=0
M−1
2
− jω M
M
=e 2 2h(n) cos ω n − (4.21)
n=0
2
155 4.2 Basic structures of nonrecursive digital filters
M+1
2
jω − jω M
M +1 1
H (e ) = e 2 2h − m cos ω m −
m=1
2 2
M+1
2
− jω M
1
=e 2 b(m) cos ω m − (4.22)
m=1
2
M
2 −1
M
−n
H (z) = h(n)z − h(n)z −n
n=0 n= M
2 +1
M
2 −1
= h(n) z −n − z −(M−n) (4.23)
n=0
M
2 −1
H (e jω ) = h(n) e− jωn − e(− jωM+ jωn)
n=0
M
2 −1
− jω M − jω(n− M jω(n− M
=e 2 h(n) e 2 ) −e 2 )
n=0
M
2 −1
− jω M
M
=e 2 −2jh(n) sin ω n −
n=0
2
M
2 −1
− j(ω M π M
=e 2 −2) −2h(n) sin ω n − (4.24)
n=0
2
156 Digital filters
Substituting n by ( M2 − m)
M
2
jω − j(ω M π M
H (e ) = e 2 −2) −2h − m sin[ω(−m)]
m=1
2
M
2
− j(ω M π
=e 2 −2) c(m) sin(ωm) (4.25)
m=1
M−1
2
M
−n
H (z) = h(n)z − h(n)z −n
n=0 n= M+1
2
M−1
2
= h(n) z −n − z −(M−n) (4.26)
n=0
M−1
2
H (e jω ) = h(n) e− jωn − e(− jωM+ jωn)
n=0
M−1
2
− jω M − jω(n− M jω(n− M
=e 2 h(n) e 2 ) −e 2 )
n=0
M−1
2
− jω M
M
=e 2 −2jh(n) sin ω n −
n=0
2
M−1
2
− j(ω M π M
=e 2 −2) −2h(n) sin ω n − (4.27)
n=0
2
157 4.2 Basic structures of nonrecursive digital filters
Table 4.1. Main characteristics of linear-phase FIR filters: order, impulse response, frequency
response, phase response, and group delay.
M
2
M π M π M
III Even Antisymmetric e− j(ω 2 − 2 ) c(m) sin(ωm) −ω +
m=1
2 2 2
c(m) = 2h M
2 −m
M+1
2
M π M π M
IV Odd Antisymmetric e− j(ω 2 − 2 ) d(m) sin ω m − 12 −ω +
m=1
2 2 2
d(m) = 2h M+1
2 −m
Substituting n by ( M+1
2 − m)
M+1
2
jω − j(ω M π M +1 1
H (e ) = e 2 −2) −2h − m sin ω −m
m=1
2 2
M+1
2
− j(ω M π 1
=e 2 −2) d(m) sin ω m − (4.28)
m=1
2
Typical impulse responses of the four cases of linear-phase FIR digital filters are
depicted in Figure 4.6. The properties of all four cases are summarized in Table 4.1.
158 Digital filters
h(n)
h(n)
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 11
n n
(a) (b)
h(n)
h(n)
6 7 8 9 10 11
6 7 8 9 10 0 1 2 3 4 5
0 1 2 3 4 5
n
n
(c) (d)
Figure 4.6 Example of impulse responses of linear-phase FIR digital filters: (a) Type I; (b) Type II;
(c) Type III; (d) Type IV.
where the f k coefficients are derived from the filter’s impulse response h(n), and K =
M M−1
2 , if M is even; or K = 2 , if M is odd. From equation (4.29), it is easy to observe
that, if z γ is a zero of H (z), so is z γ−1 . This implies that all zeros of H (z) occur in
reciprocal pairs. Considering that if the coefficients h(n) are real, all complex zeros
occur in conjugate pairs, and then one can infer that the zeros of H (z) must satisfy the
following relationships:
• All complex zeros which are not on the unit circle occur in conjugate and reciprocal
quadruples. In other words, if z γ is complex, then z γ−1 , z γ∗ , and (z γ−1 )∗ are also zeros
of H (z).
• There can be any given number of zeros over the unit circle, in conjugate pairs,
since in this case we automatically have that z γ−1 = z γ∗ .
• All real zeros outside the unit circle occur in reciprocal pairs.
159 4.3 Basic structures of recursive digital filters
Z plane
• There can be any given number of zeros at z = z γ = ±1, since in this case we
necessarily have that z γ−1 = ±1.
A typical zero plot for a linear-phase lowpass FIR filter is shown in Figure 4.7.
An interesting property of linear-phase FIR digital filters is that they can be real-
ized with efficient structures that exploit their symmetric or antisymmetric impulse-
response characteristics. In fact, when M is even, these efficient structures require
M M+1
2 + 1 multiplications, while when M is odd, only 2 multiplications are necessary.
Figure 4.8 depicts two of these efficient structures for linear-phase FIR filters when the
impulse response is symmetric.
x(n) –1 –1 –1 –1
z z z z
+ + + +
–1 –1 –1 –1
z z z z
+
y(n)
(a)
x(n) –1 –1 –1 –1
z z z z
+ + + + +
–1
z
–1 –1 –1 –1
z z z z
+
y(n)
(b)
Figure 4.8 Realizations of linear-phase filters with symmetric impulse response: (a) even order;
(b) odd order.
Since, in most cases, such transfer functions give rise to filters with impulse responses
having infinite durations, recursive filters are also referred to as infinite-duration
impulse-response (IIR) filters.1
We can consider that H (z) as above results from the cascading of two separate filters
1
of transfer functions N (z) and D(z) . The N (z) polynomial can be realized with the FIR
1 It is important to notice that in the cases where D(z) divides N (z), the filter H (z) turns out to have a
finite-duration impulse response, and is actually an FIR filter.
161 4.3 Basic structures of recursive digital filters
x(n) + y(n)
–1
z
FIR
filter
1 .
Figure 4.9 Block diagram realization of D(z)
x(n) + y(n)
–1
z
–a 1
✕
–1
z
–a 2
✕
–1
z
–aN
✕
1 .
Figure 4.10 Detailed realization of D(z)
1
direct form, as shown in the previous section. The realization of D(z) can be performed
as depicted in Figure 4.9, where the FIR filter shown will be an (N − 1)th-order filter
with transfer function
N
D (z) = z(1 − D(z)) = −z ai z −i (4.31)
i=1
1
which can be realized as in Figure 4.3. The direct form for realizing D(z) is then shown
in Figure 4.10.
1
The complete realization of H (z), as a cascade of N (z) and D(z) , is shown in
Figure 4.11. Such a structure is not canonic with respect to the delays, since for a
(M, N )th-order filter, with N ≥ M in practice, this realization requires (N + M)
delays.
162 Digital filters
b0
x(n) ✕ + y(n)
–1 –1
z z
b1 –a 1
✕ ✕
–1 –1
z z
b2 –a 2
✕ ✕
…
–1 –1
z z
bM –aN
✕ ✕
Figure 4.11 Noncanonic IIR direct-form realization.
Clearly, in the general case we can change the order in which we cascade the two
1 1
separate filters, that is, H (z) can be realized as N (z) × D(z) or D(z) × N (z). In
the second option, all delays employed start from the same node, which allows us
to eliminate the consequent redundant delays. In that manner, the resulting structure,
usually referred to as the Type 1 canonic direct form, is the one depicted in Figure 4.12,
for the special case when N = M.
An alternative structure, the so-called Type 2 canonic direct form, is shown in
Figure 4.13. Such a realization is generated from the nonrecursive form in Figure 4.4.
The majority of IIR filter transfer functions used in practice present a numerator
degree, M, smaller than or equal to the denominator degree, N . In general, one can
consider, without much loss of generality, that M = N . In the case where M < N , we
just make the coefficients b M+1 , . . ., b N in Figures 4.12 and 4.13 equal to zero.
In the same way as their FIR counterparts, the IIR digital filters present a large
variety of possible alternative realizations. An important one, referred to as the cascade
realization, is depicted in Figure 4.14a, where the basic blocks represent simple
transfer functions of orders 2 or 1. In fact, the cascade form, based on second-order
163 4.3 Basic structures of recursive digital filters
b0
x(n) + ✕ + y(n)
–1
z
–a1 b1
✕ ✕
–1
z
–a2 b2
…
…
✕ ✕
–1
z
–aN bM
✕ ✕
Figure 4.12 Type 1 canonic direct form for IIR filters.
m
γ0k + γ1k z −1 + γ2k z −2
H (z) =
k=1
1 + m 1k z −1 + m 2k z −2
m
γ0k z 2 + γ1k z + γ2k
=
k=1
z 2 + m 1k z + m 2k
m
z 2 + γ1k
z + γ
2k
= H0 2
(4.32)
k=1
z + m 1k z + m 2k
Another important realization for recursive digital filters is the parallel form
represented in Figure 4.14b. Using second-order blocks, which are the most
commonly used in practice, the parallel realization corresponds to the following
transfer function decomposition:
164 Digital filters
b0
x( n) ✕ + y( n)
–1
z
b1 –a1
✕ + ✕
–1
z
b2 –a2
✕ + ✕
…
…
…
–1
z
bM –aN
✕ + ✕
Figure 4.13 Type 2 canonic direct form for IIR filters.
m p p p
γ z2 + γ z + γ
0k 1k 2k
H (z) =
k=1
z 2 + m 1k z + m 2k
m p p
γ1k z + γ2k
= h0 + 2
k=1
z + m 1k z + m 2k
p p
m
γ0k z 2 + γ1k z
= h 0 + (4.33)
k=1
z 2 + m 1k z + m 2k
also known as the partial-fraction decomposition. This equation indicates three alter-
native forms of the parallel realization, where the last two are canonic with respect to
the number of multiplier elements.
It should be mentioned that each second-order block in the cascade and parallel
forms can be realized by any of the existing distinct structures, as, for instance, one of
the direct forms shown in Figure 4.15.
As it will be seen in future chapters, all these digital filter realizations present differ-
ent properties when one considers practical finite-precision implementations, that is,
the quantization of the coefficients and the finite precision of the arithmetic operations,
165 4.4 Digital network analysis
(a)
H1(z)
Hm(z)
(b)
Figure 4.14 Block diagrams of: (a) cascade form; (b) parallel form.
such as additions and multiplications (Jackson, 1969; Oppenheim & Schafer, 1975;
Antoniou, 1993; Jackson, 1996). In fact, the analysis of the finite-precision effects in
the distinct realizations is a fundamental step in the overall process of designing any
digital filter, as will be discussed in detail in Chapter 7.