Chapter 6. Digital Filter Structures: Gao Xinbo School of E.E., Xidian Univ
Chapter 6. Digital Filter Structures: Gao Xinbo School of E.E., Xidian Univ
Gao Xinbo
School of E.E., Xidian Univ.
[email protected]
[email protected]
http://see.xidian.edu.cn/teach/matlabdsp/
Introduction
In earlier chapters we studied the theory of discrete
systems in both the time and frequency domains.
We will now use this theory for the processing of
digital signals.
To process signals, we have to design and implement
systems called filters.
The filter design issue is influenced by such factors as
The type of the filter: IIR or FIR
The form of its implementation: structures
Different filter structures dictate different design strategies.
Introduction
IIR filters are characterized by infinite-duration
impulse response. Some of these impulse
responses can be modeled by
Rational system functions
Difference equations
ARMA or recursive filters
We will treat FIR filter separately from IIR
filters for both design and implementation
purposes.
Introduction
Since our filters are LTI systems, we need the
following three elements to describe digital filter
structures.
Adder
Multiplier (Gain)
Delay element (shift or memory)
x1(n)
a
x1(n)+x2(n) x(n) ax(n)
x2(n)
1/z
x(n) x(n-1)
IIR Filter Structures
The system function of an IIR filter is given by
M
B( z ) n
b z n
b0 b1 z 1 bM z M
H ( z) n 0
1 N
; a0 1
A( z ) N
1 a1 z a N z
n
a z n
n 0
H1(z) H2(z)
Direct Form II Structure
x(n) b0 y(n)
x(n) b0 y(n)
-a1 1/z
b1
-a2 1/z b2
H(z)
Is called the k-th biquad section. The input to the k-th biquad section is the
output from the (k-1)-th section, while the output from the k-th biquad is the
input to the (k+1)-th biquad. Each biquad section can be implemented in direct
form II.
Yk(n)=XK+1(n) Yk+1(n)
1/z
-Ak,1 Bk,1
-Ak,2 1/z
Bk,2
The entire filter is then implemented
as a cascade of biquads
x(n) b0 y(n)
1/z 1/z
-A1,1 B1,1 -A2,1 B2,1
Examples: 6.1
Parallel Form
In this form the system function H(z) is written as a sum
of second-order section using partial fraction
expansion.B( z ) b0 b1 z 1 bM z M
H ( z)
A( z ) 1 a1 z 1 a N z N
bˆ0 bˆ1 z 1 bˆM z N M N k
1 N
Ck z
1 a1 z a N z k 0
only if M N
K=N/2, and
K Bk , 0 Bk ,1 z 1 M N
1 2
k C z k
B,A are real
k 1 1 Ak ,1 z Ak , 2 z k 0 numbers
only if M N
The second-order section
Yk 1 ( z ) Bk , 0 Bk ,1 z 1
H k ( z) 1 2
, k 1,2, , K
Yk ( z ) 1 Ak ,1 z Ak , 2 z
with Yk ( z ) H k ( z ) X ( z ), Y ( z ) Yk ( z ), M N
Examples
FIR Filter Structure
A finite-duration impulse response filter has a system function of
the form: M 1
1 1 M
H ( z ) b0 b1 z bM 1 z bn z
n
n 0
Hence the impulse response h(n) is
bn 0 n M 1
h( n)
0 else
And the difference equation representation is
y (n) b0 x(n) b1 x(n 1) bM 1 x(n M 1)
Which is a linear convolution of finite support.
The order of the filter is M-1, while the length of the filter is M.
FIR Filter Structure
Direct form:
The difference equation is implemented as a
tapped delay line since there are no feedback paths.
Figure 6.10
Note that since the denominator is equal to unity,
there is only one direct form structure.
Matlab implementation
Function: y = filter(b,1,x)
FIR Filter Structure
Cascade form:
H ( z ) b0 b1 z 1 bM 1 z1 M
b1 1 bM 1 1 M
b0 1 z z
b0 b0
K
b0 (1 Bk ,1 z 1 Bk , 2 z 2 ); K M / 2
k 1
Figure 6.11
Matlab Implementation
Function: dir2cas, cas2dir
FIR Filter Structure
Linear-phase form
For frequency-selective filters (e.g., lowpass filters) it is
generally desirable to have a phase response that is a linear
function of frequency. That is
H (e jw ) w, w , 0 or 2
For a causal FIR filter with impulse over [0,M-1] interval,
the linear-phase conditions
h(n) h( M 1 n); 0, 0 n M 1
h(n) h( M 1 n); / 2, 0 n M 1
Symmetric impulse response vs. antisymmetric impulse response
Linear-phase form
Consider the difference equation with a symmetric
impulse response.
y (n) b0 x(n) b1 x(n 1) b1 x(n M 2) b0 x(n M 1)
b0 [ x(n) x(n M 1)] b1[ x(n 1) x(n M 2)]
K0 K1 K2 KM
x(n)
K1 K2 KM
1/z 1/z 1/z
g0(n) g1(n) g2(n) gM-1(n) gM(n)
Note that the above algorithm will fail if |Km|=1 for any m. Clearly, this
condition is satisfied by the linear-phase FIR filter.
Therefore, linear-phase FIR filter cannot be implemented using lattice
structure.
Matlab Implementation
Functions:
[K] = dir2latc(b)
[y] = latcfilt(K,x)
[b] = latc2dir(K)
Example 6.8
All-pole Lattice Filter
A lattice structure for an IIR filter is restricted to an all-pole
system unction.
It can be developed from an FIR lattice structure.
1 1
H ( z) N
1 a (m) z m AN ( z )
N
m 1
KN K2 K1
1/z 1/z 1/z
y(n)
gN(n) g0(n)
gN-1(n) g2(n) g1(n)
f N ( n) x ( n)
f m 1 (n) f m (n) K m g m 1 (n 1), m N , N 1,
g m (n) K m f m 1 (n) g m 1 (n 1), m N , N 1, ,1
y ( n) f 0 ( n) g 0 ( n)
Matlab Implementation
Function [K] = dir2latc(a)
Care must be taken to ignore the K0 coefficient
in the K array.
Function [a] = latc2dir(K)
K0=1
Lattice ladder Filters
A general IIR filter containing both poles and zeros can be
realized as a lattice-type structure by using an all-pole lattice
as the basic building block.
Consider an IIR filter with system function
M
M
b ( k ) z k
BM ( z )
H ( z) k 0
N
1 a N (k ) z k AN ( z )
k 0
Bm ( z ) Bm 1 ( z ) Cm J m ( z ); m 0,2, , M
M
Cm bm Ci i (i m); m M , M 1,,0
i m 1
Matlab Implementation
Function [K,C] = dir2ladr(b,a)
To use this function, N>=M. If M>N, then the numerator
AN(z) should be divided into the denominator BM(z) using
the deconv function to obtain a proper rational part and a
polynomial part. The proper rational part can be
implemented using the lattice-ladder structure, while the
polynomial part is implemented using the direct structure.
Function [b,a] ladr2dir(K,C)
Function [y] = ladrfilt(K,C,x)
Readings and exercises
Textbook : pp182~217
Chinese ref. Book: pp.128~137, 231~234
Exercises :
1. 6.2, 6.3 both except (e)
2. 6.2e, 6.3e, 6.8, 选 6.10