Filter Realization
Filter Realization
Rajini M
Dept. of Elect. & Comm. Engineering,
PES University;
UE18EC253: DSP
DSP: Unit V — FIR Filters
Overview
1 Introduction
Digital Filters
Digital Filters
Depending on the structure of H(z), we have two types of
digital filter:
1 FIR filters: All zero systems (also called as moving average
system).
M
X
y (n) = bk x(n − k)
k=1
N
X
H(z) = 1 + ak z −k
k=1
2 IIR filters: All pole systems (also called as autoregressive
system).
N
X
y (n) = − ak y (n − k) + b0 x(n)
k=1
1
H(z) = PN
1+ −k
k=1 ak z
DSP: Unit V — FIR Filters
Structures for Realization of Discrete-Time Systems
Filter Structures
IIR Filters
Direct-form I
DSP: Unit V — FIR Filters
IIR Filter Structures
Direct-form II
DSP: Unit V — FIR Filters
IIR Filter Structures
Cascade form
DSP: Unit V — FIR Filters
IIR Filter Structures
FIR Filters
DSP: Unit V — FIR Filters
FIR Filter Structures
Direct-form structure
1 1 2
H(z) = 1 − z −1 + z −2 + z −3 + z −4
3 6 5
Y (z) 1 −1 1 −2 2
H(z) = = 1 − z + z + z −3 + z −4
X (z) 3 6 5
1 1 2
Y (z) = X (z) − z −1 X (z) + z −2 X (z) + z −3 X (z) + z −4 X (z)
3 6 5
1 1 2
y (n) = x(n) − x(n − 1) + x(n − 2) + x(n − 3) + + x(n − 4)
3 6 5
DSP: Unit V — FIR Filters
FIR Filter Structures
Direct-form structure
with b0 = 1, b1 = − 13 , b2 = 16 , b3 = 1, b4 = 2
5
DSP: Unit V — FIR Filters
FIR Filter Structures
Direct-form structure
with b0 = 1, b1 = − 13 , b2 = 16 , b3 = 1, b4 = 2
5
DSP: Unit V — FIR Filters
FIR Filter Structures
Cascade-form structure
(M−1)/2
Y
(1 + B1k z −1 + B2k z −2 )
b0 M odd
k=1
H(z) =
(M−2)/2
Y
(1 + B1k z −1 + B2k z −2 ) M even
b (1 + b10 z −1 )
0
k=1
DSP: Unit V — FIR Filters
FIR Filter Structures
Cascade-form structure
Cascade-form structure
and A0 (z) = 1.
By comparing the coefficients of Hm (z) and Am (z), we have
1. hm (0) = 1 = αm (0).
2. hm (k) = αm (k), k = 1, 2, · · · , m
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
f0 (n) = g0 (n) = 1
fm (n) = fm−1 (n) + Km gm−1 (n − 1), m = 0, 1, 2, · · · , M − 1
gm (n) = Km fm−1 (n) + gm−1 (n − 1), m = 0, 1, 2, · · · , M − 1
Then the output of (M − 1)th -stage
filter corresponds to the
output of (M − 1) order FIR filter, y (n) = fM−1 (n).
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
The top branch gives the filter output, which is the output of an
FIR filter of order m, that is
m
X
y (n) = fm (n) = αm (k)x(n − k), αm (0) = 1
k=0
Equivalently,
Fm (z) Fm (z)
Am (z) = =
X (z) F0 (z)
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
Consequently, the filter coefficients are {α2 (2), α2 (1), 1}, whereas
the coefficients for the filter that produces output f2 (n) are
{1, α2 (1), α2 (2)}. Hence the two sets of filter coefficients are in
reverse order.
Define,
m
X m
X
gm (n) = αm (m − k)x(n − k) = βm (k)x(n − k)
k=0 k=0
Gm (z) Gm (z)
Bm (z) = =
X (z) G0 (z)
where, Bm (z) represents the system function of the FIR filter with
coefficients {βm },
m
X
Bm (z) = βm (k)z −k
k=0
m
X
Bm (z) = αm (m − k)z −k
k=0
Xm
= αm (l)z l−m
l=0
m
X
= z −m αm (l)z l
l=0
−m
= z Am (z −1 )
Fm (z) Fm (z)
Am (z) = =
X (z) F0 (z)
Gm (z) Gm (z)
Bm (z) = =
X (z) G0 (z)
Bm (z) = z −m Am (z −1 )
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
f0 (n) = g0 (n) = 1
A0 (z) = B0 (z) = 1
A0 (z) = B0 (z) = 1
B1 (z) = 1/4 + z −1
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
Now, m = 2
A2 (z) = A1 (z) + K2 z −1 B1 (z)
= 1 + 3/8z −1 + 1/2z −2
= α2 (0) + α2 (1)z −1 + α2 (2)z −2
Also,
B2 (z) = 1/2 + 3/8z −1 + z −2
Finally, the addition of third stage
A3 (z) = A2 (z) + K3 z −1 B2 (z)
= 1 + 13/24z −1 + 5/8z −2 + 1/3z −3
= α3 (0) + α3 (1)z −1 + α3 (2)z −2 + α3 (3)z −3
The desired direct-form FIR filter is characterized by the
coefficients,
α3 (0) = 1, α3 (1) = 13/24, α3 (2) = 5/8, α3 (3) = 1/3
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
B2 (z) = 2 + 3z −1 + z −2
For m = 1,
A2 (z) − K2 B2 (z)
A1 (z) = = 1 + z −1 = α1 (1) + α1 (1)z −1
1 − K22
Hence, K1 = α1 (1) = 1.
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
DSP: Unit V — FIR Filters
FIR Filter Structures
Lattice structure
For m = 2,
A2 (z) − K2 B2 (z)
A1 (z) = 2
= 1 − 0.7013z −1 = α1 (1) + α1 (1)z −1
1 − K2
or, equivalently
N
X
y (n) = x(n) + aN (k)x(n − k) (12)
k=1
We observe that
Eq.(12) describes an FIR system having the system function
H(z) = AN (z).
Eq.(11) represents an IIR system with the system function
H(z) = AN1(z) .
One system can be obtained from the other by interchanging
the roles of input and output.
DSP: Unit V — FIR Filters
Lattice structure (IIR)
FIR IIR
x(n) = f0 (n) = g0 (n) x(n) = f1 (n)
y (n) = f1 (n) y (n) = f0 (n) = g0 (n)
Therefore, in IIR filter given the input fN (n) = x(n), we must
successively find fN−1 (n), fN−1 (n), · · · , f0 (n). Rearranging FIR
filter fm (n) equation, we get,
fm−1 (n) = fm (n) − Km gm−1 (n − 1)
The equation for gm (n) remains unchanged.
DSP: Unit V — FIR Filters
Lattice structure (IIR)
fN (n) = x(n)
x(n) = f1 (n)
f0 (n) = f1 (n) − K1 g0 (n − 1)
g1 (n) = K1 f0 (n) + g0 (n − 1)
y (n) = f0 (n) = x(n) − K1 y (n − 1)
DSP: Unit V — FIR Filters
Lattice structure (IIR)
x(n) = f2 (n)
g2 (n) = K2 y (n) + K1 (1 + K2 )y (n − 1) + y (n − 2)
Clearly, the above difference equation represents a two pole IIR
system.
DSP: Unit V — FIR Filters
Lattice structure (IIR)
Taking z-transform,
Y (z) 1 1
= H(z) = =
X (z) A2 (z) 1 + K1 (1 + K2 )z −1 − K2 z −2
Gm (z)
= B2 (z) = K2 + K1 (1 + K2 )z −1 + z −2
Y (z)
It must be noted that coefficients of A2 (z) and B2 (z) are in
reverse order and B2 (z) = z −2 A2 (z)
DSP: Unit V — FIR Filters
Lattice structure (IIR)
Y (z) F0 (z) 1
= =
X (z) FN (z) AN (z)
Similarly,
GN (z) GN (z)
= = BN (z) = z −N AN (z)
Y (z) G0 (z)
|Km | < 1 m = 1, 2, · · · , N
DSP: Unit V — FIR Filters
Lattice structure (IIR)
With m = 2,
A3 (z) − K3 B3 (z)
A2 (z) = = 1 + 3/8z −1 + 1/2z −2
1 − K32
Hence, K2 = 1/2
B2 (z) = 1/2 + 3/8z −1 + z −2
With m = 1,
A2 (z) − K2 B2 (z)
A1 (z) = = 1 + 1/4z −1
1 − K22
Hence, K1 = 1/4. Since all the reflection coefficients satisfy
|Km | < 1, the given system is stable.
DSP: Unit V — FIR Filters
Lattice structure (IIR)
Similarly,
Thank you