University of Tripoli - Faculty of Engineering
Electrical and Electronic Department
Fall 2020
EE423 Active Networks
Lecture 15 - Introduction to Digital Filters
Dr. Ali Ganoun
3/05/2021
System Structure
• Development of software (that is, a program) that
implements the system on a general purpose
computer or a special purpose digital signal processor.
• Design and implementation of a hardware architecture
that can be used to implement the system using
discrete components or VLSI technology.
2
BASIC STRUCTURE FOR
SYSTEM/FILTER
The Transfer Function of LTI system can be
connected in 2 ways :
a. Parallel Connection :
The overall transfer function,
H(z) = H1(z) + H2(z) + … + HL(z)
1-3
BASIC STRUCTURE FOR
SYSTEM/FILTER
b. Cascade connection :
The overall transfer function :
H(z) = H1(z).H2(z). … HL(z)
1-4
Digital Filters
5
6
Block diagrams and signal flow graphs
first-order IIR system
Structure for the first-order IIR system
block diagram signal flow graph 7
Representing by signal-flow graph
1-8
IIR Filter Structures
The system of an IIR filter is given by
M
B( z ) k
b z k
b0 b1 z 1 .. bM z M
H ( z) k 0
1 N
; a0 1
N
1 a1 z .. aN z
k
A( z ) k
a z
k 0
The order of the filter is N if aN0.
The difference equation representation is
M N
yk bm xk m am yk m
m0 m0
1-9
IIR Filter Structures
Direct form
◦ Direct form I
◦ Direct form II
Cascade form
Parallel form
1-10
Direct form I structure for implementation of an N th order IIR system
with N =M= 2.
cascade connection of two systems.
11
Assume M=N=4:
yk b0 xk b1 xk 1 b2 xk 2 b3 xk 3 b4 xk 4
a1 yk 1 a2 yk 2 a3 yk 3 a4 yk 4
xk b0
yk
z-1 z-1
b1 -a1
z-1 z-1
b2 -a2
z-1 z-1
b3 -a3
z-1 z-1
b4 -a4
Direct form I structure
1-12
Direct form II
Direct form II structure for implementation of an Nth order system.
13
Direct form II
14
Example:
15
Example:
16
Example:
1 2 z 1
H ( z)
1 1.5 z 1 0.9 z 2
Direct form I implementation Direct form II implementation
1-17
Example:
1 2 z 1 z 2
H ( z)
1 0.75 z 1 0.125 z 2
xk(n) yk
z-1
0.75
2
z-1
-0.125
Direct form II implementation
1-18
Cascade form
◦ The system function H(z) is factored into smaller second
order sections with real coefficients, called biquads.
◦ The system function is then represented as a product of
these biquads.
◦ Each biquads is implemented in a direct form.
◦ The entire system function is implemented as a cascade of
biquad sections.
◦ Each numerator and denominator is factoring into their
respective roots and then combining the roots into second
order polynomials.
1-19
20
Cascade form structure for N=4
Biquad section structure
21
Example
1 2 z 1 3z 2 1 z 1 z 2
H ( z)
1 0.75 z 1 0.125 z 2 1 0.5 z 1 0.1z 2
x(n) y(n)
z-1 z-1
-0.75 -2 -0.5 -1
z-1 z-1
-0.125 3 0.1
Cascade form structure
1-22
Example:
23
Cascade form structure
24
Example:
1 2 z 1 z 2 (1 z 1 )(1 z 1 )
H ( z) 1 2
1 0.75z 0.125z (1 0.5 z 1 )(1 0.25z 1 )
Cascade structure: direct form I implementation
Cascade structure: direct form II implementation
1-25
Parallel form
◦ This is similar to the cascade form.
◦ After factorization, a partial fraction expansion is used to
represent H(z) as a sum of smaller second order sections.
◦ Each section is a gain implemented in a direct form.
◦ The entire system function is implemented as a parallel
network of sections.
1-26
27
Parallel form
structure for
M=N=4 C0
B1,0
z-1
-A1,1 B1,1
xk z-1 yk
-A1,2
B2,0
z-1
-A2,1 B2,1
z-1
-A2,2
1-28
Example:
1 2 z 1 z 2 7 8 z 1
H ( z) 1 2
8
1 0.75z 0.125z 1 0.75z 1 0.125z 2
1-29
another alternation of the same system
1 2 z 1 z 2 18 25
H ( z) 8
1 0.75z 1 0.125z 2 1 0.5 z 1 1 0.25z 1
1-30
1 2 z 1 3z 2 1 z 1 z 2
Example H ( z) 1 2
1 0.75 z 0.125 z 1 0.5 z 1 0.1z 2
z-1
-0.5 -1
x(n) z-1 y(n)
0.1
z-1
-0.75 -2
z-1
-0.125 3
Parallel form structure
1-31
1-32
33
FIR Filter Structures
A finite-duration impulse response filter has a system function
of the form
M 1
1 2
H ( z ) h0 h1 z h2 z .. hM 1 z 1 M
hk z k
k 0
The impulse response hk is
hk 0 k M 1
hk
0 else
The difference equation representation is
yk h0 xk h1 xk 1 h2 xk 2 ... hM 1uk M 1
1-34
The order of the filter is M-1
The length of the filter is M (equal num of
coefficients).
The FIR filter structures are always stable.
They are relatively simple compared to IIR
structures.
1-35
FIR Filter Structures
Direct form
Cascade form
1-36
BASIC STRUCTURE FOR FIR FILTER
An FIR filter of order 4: yk h0 xk h1 xk 1 h2 xk 2 h3 xk 3 h4uk 4
xk z-1 z-1 z-1 z-1
h0 h1 h2 h3 h4
+ + +
+ yk
xk z-1 z-1 z-1 z-1
h0 h1 h2 h3 h4 yk
1-37
Cascade form
◦ The system function H(z) is converted into products of
second order sections with real coefficients.
◦ Transfer function H(z) of a causal FIR filter of order M-1
M 1
H ( z ) hk z k h0 1 hh10 z 1 .. hMh01 z M 1
k 0
◦ Factorized form
k
H ( z ) h0 (1 k ,1 z 1 k ,2 z 2 )
k 1
Where K = (M-1)/2 and βk,1 , βk,2, are real numbers
representing the coefficients of second order sections
1-38
Cascade form structure for realization of a 6th-order FIR
system.
1-39
Example:
An FIR is given by the system function
H ( z) 1 16 161 z 4 z 8
Determine and draw the direct and cascade structures
1-40
a- Direct form
The difference equation is given by
yk xk 16.0625 xk 4 xk 8
xk z-4 z-4
16.0625
yk
1-41
b- Cascade form
xk yk
z-1 z-1 z-1 z-1
2.8284 0.7071 -0.7071 -2.8284
z-1 z-1 z-1 z-1
4.0 0.25 0.25 4.0
1-42
Example
FIR direct and cascade form structures
43
Normal direct form
The structure require nine multiplications
44
[sos,G] = tf2sos(b,a)
Normal cascade form
requires nine multiplications 45
Structure conversion,
simulation and verification
Structure conversion
Usually, filter design packages provide the impulse
response of an FIR filter or the coefficients of second-
order sections for IIR filters. However, on several
occasions, the structure specified by the design software
is different from the structure chosen for implementation
of the filter. Hence, it is important to be able to convert
between different structures.
46
47
Simulation and verification
After obtaining the coefficients of a given structure,
the next task is to simulate and verify that a
system with these coefficients works correctly
Verification of the converted structure can be obtained in many different
ways. The simplest is to
(a) convert the given structure to direct form I,
(b) use the filter function to implement this structure,
(c) excite the structure in (b) and the structure to be tested with the
same input and compare the corresponding outputs.
Typical test inputs include the unit step, sinusoidal sequences, or
random sequences.
48
the cascade structure
b = [1,-3,11,-27,18]; a = [16,12,2,-4,-1]
[sos,G] = tf2sos(b,a)
49
To verify that the above structure is the correct
one we will compute impulse response from
two structures and compare them
The two structures are equivalent.
50