You are on page 1of 68

1

Chapter 9 Implementation of
Discrete-Time Systems
Digital Signal Processing
Introduction.
Structures for FIR Systems.
Structures for IIR Systems.
2
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 has different design strategies.
Implementation of Discrete-Time Systems
Digital Signal Processing
9
9.1. Introduction
3
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)
x2(n)
x1(n)+x2(n)
x(n) ax(n)
a
x(n) x(n-1)
1/z
Implementation of Discrete-Time Systems
Digital Signal Processing
9
Introduction
4
Two digital filter structures are defined
to be equivalent if they have the same
transfer function
We describe next a number of methods
for the generation of equivalent
structures
However, a fairly simple way to
generate an equivalent structure from a
given realization is via the transpose
operation
Equivalent structures 9
Transpose Operation
(1) Reverse all paths
(2) Replace pick-off nodes by adders,
and vice versa
(3) Interchange the input and output
nodes
All other methods for developing
equivalent structures are based on a
specific algorithm for each structure
Equivalent structures 9
There are literally an infinite number of
equivalent structures realizing the
same transfer function
It is thus impossible to develop all
equivalent realizations
In this course we restrict our attention
to a discussion of some commonly
used structures
Equivalent structures
9
Under infinite precision arithmetic any
given realization of a digital filter
behaves identically to any other
equivalent structure
However, in practice, due to the finite
wordlength limitations, a specific
realization behaves totally differently
from its other equivalent realizations
Equivalent structures
9
Hence, it is important to choose a
structure that has the least
quantization effects when
implemented using finite precision
arithmetic
One way to arrive at such a structure
is to determine a large number of
equivalent structures, analyze the
finite wordlength effects in each
case, and select the one showing the
least effects
Equivalent structures
9
Why do we use the Different
type of structures?
Computational complexity
arithmetic operation
fetching cycle
comperision
Memory requirement
to store the data
Finite word length effect
limitation of computer
11
Implementation of Discrete-Time Systems

= + + + =
1
0
1
1
1
1 0
) (
M
n
n
n
M
M
z b z b z b b z H
) 1 ( ) 1 ( ) ( ) (
1 1 0
+ + + + =

M n x b n x b n x b n y
M

Digital Signal Processing


Structures for FIR Systems
| |

=
=
M-1
k
k
k n x b n y
0
] [
Or, equivalently by the
Difference Equation:
Furthermore, the Impulse Response of the FIR
system is identical to the coefficients {b
k
}, that is,
A finite-duration impulse response (FIR) filter has a Transfer
Function of the form:



s s
=
else
M n b
n
n h
0
1 0
) (
The order of the filter is M-1, while the length of the filter is M.
Which is a linear convolution of finite support.
9
12
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for FIR Systems
Three different structures can be used to implement an FIR filter:
Direct Form.
Linear Phase Form.
Cascade Form.
Frequency Sampling Form.
Lattice Form.
9
A causal FIR filter of order N is
characterized by a transfer function H(z)
given by

which is a polynomial in
In the time-domain the input-output
relation of the above FIR filter is given by

=
N
n
n
z n h z H
0
] [ ) (
1
z

=
=
N
k
k n x k h n y
0
] [ ] [ ] [
Basic FIR Digital Filter Structures
9
An FIR filter of order N is characterized by
N +1 coefficients and, in general, require
N+1 multipliers and N two-input adders
Structures in which the multiplier
coefficients are precisely the coefficients
of the transfer function are called direct
form structures
Basic FIR Digital Filter Structures
9
A direct form realization of an FIR filter
can be readily developed from the
convolution sum description as indicated
below for N = 4
Basic FIR Digital Filter Structures
9
An analysis of this structure yields


which is precisely of the form of the
convolution sum description
The direct form structure shown on the
previous slide is also known as a tapped
delay line or a transversal filter
] [ ] [ ] [ ] [ 4 4 3 3 + + n x h n x h
] [ ] [ ] [ ] [ ] [ ] [ ] [ 2 2 1 1 0 + + = n x h n x h n x h n y
Basic FIR Digital Filter Structures
9
The transpose of the direct form structure
shown earlier is indicated below




Basic FIR Digital Filter Structures
9
18
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for FIR Systems
For an FIR filter with a real-valued impulse response of length M, a
sufficient condition for this filter to have generalized linear phase is
that the h(n) be whether symmetric or anti symmetric.
For a causal FIR filter with M Length and impulse over [0,M-1]
interval, the linear-phase conditions
1
0
( ) ( )
M
j j k
k
H e h k e
e e

=
=

1
0
( ) ( ) ( )
M
k
y n h k x n k

=
=

1 0 ); 1 ( ) (
1 0 ); 1 ( ) (
s s =
s s =
M n n M h n h
M n n M h n h
The length of the impulse response of the FIR filter (M) can be even or odd.
Linear Phase System :
9
19
Implementation of Discrete-Time Systems
Digital Signal Processing
Linear phase filters may be classified into 4 types, depending upon
whether h(n) is symmetric or anti symmetric and whether M is even
or odd.
Linear Phase System :
1. Type I Linear Phase: Symmetrical and M even
2. Type II Linear Phase: Symmetrical and M odd
3. Type III Linear Phase: Anti-symmetrical and M even
4. Type IV Linear Phase: Anti-symmetrical and M odd
9
20
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for FIR Systems
16 M =
h(1)=h(14)
( ) h n
n
h(0)=h(15)
h(2)=h(13)
h(7)=h(8)
Type I Linear Phase:
Symmetric and M even
1
1
2
2
0
1
( ) 2 ( )cos
2
M
M
j
j
k
M
H e e h k k
e
e
e

| |
=
|
\ .

Symmetrical Impulse Response, M: Even


9
21
Implementation of Discrete-Time Systems
Digital Signal Processing
Symmetrical Impulse Response, M: Odd
( ) h n
n
15 M =
h(0)=h(14)
h(7)=h(7)
h(1)=h(13)
h(6)=h(8)
Type II Linear Phase:
Symmetric and M odd
H(e
jw
)
9
22
Implementation of Discrete-Time Systems
Digital Signal Processing
Antisymmetrical Impulse Response, M: Even 16 M =
( ) h n
n
h(0)=-h(15)
h(7)=-h(8)
h(1)=-h(14)
Type III Linear Phase:
Anti Symmetric and M even
H(e
jw
)
9
23
Antisymmetrical Impulse Response, M: Odd
n
( ) h n
17 M =
h(0)=-h(16)
h(1)=-h(15)
h(8)=-h(8)=0
h(7)=-h(9)
!
Implementation of Discrete-Time Systems
Digital Signal Processing
Type IV Linear Phase:
Anti Symmetric and M odd
H(e
jw
)
9
The symmetry (or antisymmetry) property
of a linear-phase FIR filter can be
exploited to reduce the number of
multipliers into almost half of that in the
direct form implementations
Consider a length-7 Type 1 FIR transfer
function with a symmetric impulse
response:
3 2 1
3 2 1 0

+ + + = z h z h z h h z H ] [ ] [ ] [ ] [ ) (
6 5 4
0 1 2

+ + + z h z h z h ] [ ] [ ] [
Linear-Phase FIR Structures
9
Rewriting H(z) in the form


we obtain the realization shown below
) ]( [ ) ]( [ ) (
5 1 6
1 1 0

+ + + = z z h z h z H
3 4 2
3 2

+ + + z h z z h ] [ ) ]( [
Linear-Phase FIR Structures
9
A similar decomposition can be applied to
a Type 2 FIR transfer function
For example, a length-8 Type 2 FIR
transfer function can be expressed as


The corresponding realization is shown on
the next slide
) ]( [ ) ]( [ ) (
6 1 7
1 1 0

+ + + = z z h z h z H
) ]( [ ) ]( [
4 3 5 2
3 2

+ + + + z z h z z h
Linear-Phase FIR Structures
9




Note: The Type 1 linear-phase structure
for a length-7 FIR filter requires 4
multipliers, whereas a direct form
realization requires 7 multipliers
Linear-Phase FIR Structures 9
Note: The Type 2 linear-phase structure
for a length-8 FIR filter requires 4
multipliers, whereas a direct form
realization requires 8 multipliers
Similar savings occurs in the
realization of Type 3 and Type 4 linear-
phase FIR filters with antisymmetric
impulse responses
Linear-Phase FIR Structures 9
29
Implementation of Discrete-Time Systems

+ + + + + + =
+ + + + + + =
)] 2 ( ) 1 ( [ )] 1 ( ) ( [
) 1 ( ) 2 ( ) 1 ( ) ( ) (
1 0
0 1 1 0
M n x n x b M n x n x b
M n x b M n x b n x b n x b n y
Digital Signal Processing
Linear Phase Form :
Consider the difference equation with a symmetric impulse response.
The linear-phase structure is essentially a direct form draw
differently to save on multiplications.
For M
odd
9
A higher-order FIR transfer function can
also be realized as a cascade of
second-order FIR sections and possibly
a first-order section
To this end we express H(z) as

where if N is even, and
if N is odd, with
[
=

+ + =
K
k
k k
z z h z H
1
2
2
1
1
1 0 ) ( ] [ ) ( | |
2
N
K =
2
1 +
=
N
K
0
2
=
K
|
Cascade Form FIR Digital Filter Structures
9
31
Cascade Form FIR Digital Filter Structures
9
A cascade realization for N = 6 is shown
below




Each second-order section in the above
structure can also be realized in the
transposed direct form
Cascade Form FIR Digital Filter Structures
9

33

34

35
36
37
38

39
DIRECT FORM I
H1(Z)
DIRECT FORM II H2(Z)
y(n)
Direct form I
Direct form II

40
41
42
43
LATTICE STRUCTURE
Lattice structure
44
Lattice coefficient ---------> Direct FIR structure coefficents
Lattice coefficient <--------- Direct FIR structure coefficents
45
Implementation of Discrete-Time Systems
Digital Signal Processing
Three different structures can be used to implement an IIR filter:
Direct Form:
In this form, there are two parts to this filter, the moving average part and
the recursive part (or the numerator and denominator parts)
Two version: direct form I and direct form II
Cascade Form:
The system function H(z) is factored into smaller second-order sections,
called biquads. H(z) is then represented as a product of these biquads.
Each biquad is implemented in a direct form, and the entire system
function is implemented as a cascade of biquad sections.
Parallel Form:
H(z) is represented as a sum of smaller second-order sections.
Each section is again implemented in a direct form.
The entire system function is implemented as a parallel network of
sections.
Structures for IIR Systems
9
46
Implementation of Discrete-Time Systems
Digital Signal Processing
Signal Flow Graph Representation
A network of directed
branches connected at
nodes.
Example representation of
a difference equation
9
47
Implementation of Discrete-Time Systems
Digital Signal Processing
Signal Flow Graph Representation
Example:
Representation of Direct
Form II with signal flow
graphs
| | | | | |
| | | |
| | | | | |
| | | |
| | | | n w n y
1 n w n w
n w b n w b n w
n w n w
n x n aw n w
3
2 4
4 1 2 0 3
1 2
4 1
=
=
+ =
=
+ =
| | | | | |
| | | | | | 1 n w b n w b n y
n x 1 n aw n w
1 1 1 0
1 1
+ =
+ =
9
48
Implementation of Discrete-Time Systems
| | | | | |
| | | |
| | | | | |
| | | |
| | | | | | n w n w n y
1 n w n w
n x n w n w
n w n w
n x n w n w
4 2
3 4
2 3
1 2
4 1
+ =
=
+ =
o =
=
Digital Signal Processing
Find impulse response from the following flow graph
( ) ( ) ( )
( ) ( )
( ) ( ) ( )
( ) ( )
( ) ( ) ( ) z W z W z Y
z z W z W
z X z W z W
z W z W
z X z W z W
4 2
1
3 4
2 3
1 2
4 1
+ =
=
+ =
o =
=

( )
( )( )
( )
( ) ( )
( ) ( ) ( ) z W z W z Y
z 1
1 z z X
z W
z 1
1 z z X
z W
4 2
1
1
4
1
1
2
+ =
o
o
=
o
o
=

( )
( )
( )
| | | | | | n u 1 n u n h
z 1
z
z X
z Y
z H
1 n 1 n
1
1
+

o o =
o
o
= =
Signal Flow Graph Representation
Example:
9
49
Implementation of Discrete-Time Systems
1 ;
1 ) (
) (
) (
0
1
1
1
1 0
0
0
=
+ + +
+ + +
= = =


=

a
z a z a
z b z b b
z a
z b
z A
z B
z H
N
N
M
M
N
n
n
n
M
n
n
n

Digital Signal Processing


9
The system function of an IIR filter is given by
The difference equation representation of an IIR filter is
expressed as

= =
=
M
m
N
m
m m
m n y a m n x b n y
0 1
) ( ) ( ) (
Structures for IIR Systems
50
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for IIR Systems
Direct Form I Structure:
Consists of the zeros of H(z)
Consists of the poles of H(z)

= =
=
M
k
N
k
k k
k n y a k n x b n y
0 1
) ( ) ( ) (
9
51
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for IIR Systems
Direct Form I Structure:
Direct Form I Structure
9
52
Implementation of Discrete-Time Systems
) 2 ( ) 1 ( ) 2 ( ) 1 ( ) ( ) (
2 1 2 1 0
+ + = n y a n y a n x b n x b n x b n y
Digital Signal Processing
Direct Form I Structure:
As the name suggests, the difference equation is implemented
as given using delays, multipliers, and adders.
For the purpose of illustration, Let M = N = 2,
x(n) y(n) b0
b1
b2
-a1
-a2
1/z
1/z
1/z
1/z
H1(z) H2(z)
Direct Form I structure
Structures for IIR Systems
9
53
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for IIR Systems
) 1 ( ) ( ) 1 ( ) (
1 0 1
+ + = n x b n x b n y a n y
Given a LTI system with a rational transfer function H(z)
LCCDE
1
1
1
1 0
1
) (

+
+
=
z a
z b b
z H
Direct Form I
structure
9
54
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for IIR Systems
We can implement the system
with the following pair of
coupled difference equations: ) 1 ( ) ( ) (
) ( ) 1 ( ) (
1 0
1
+ =
+ =
n w b n w b n y
n x n w a n w
The
commutative
law of the
convolution
9
55
Implementation of Discrete-Time Systems
Digital Signal Processing
Direct Form II Structure:
Structures for IIR Systems
Direct Form II Structure (M = N)
9
56
Implementation of Discrete-Time Systems
Digital Signal Processing
Direct Form II Structure:
x(n) y(n)
H1(z)
-a1
-a2
1/z
1/z
H2(z)
b0
b1
b2
1/z
1/z
x(n) y(n)
H(z)
-a1
-a2
1/z
1/z
b0
b1
b2
Direct Form II structure
The
commutative
law of the
convolution
Structures for IIR Systems
9
57
Implementation of Discrete-Time Systems
Digital Signal Processing
Cascade Form:
In this form the system function H(z) is written as
a product of second-order section with real
coefficients.
This is done by factoring the numerator and
denominator polynomials into their respective
roots and then combining either a complex
conjugate root pair or any two real roots into
second-order polynomials.
Structures for IIR Systems
9
58
Implementation of Discrete-Time Systems
Digital Signal Processing
We assume that N is an even integer. Then
Cascade Form:
2
2 ,
1
1 ,
2
2 ,
1
1 ,
1
0
1
1
1
0
1
1
1
1 0
1
1
1
1
1
) (
0 0
1


=




+ +
+ +
H =
+ + +
+ + +
=
+ + +
+ + +
=
z A z A
z B z B
b
z a z a
z z
b
z a z a
z b z b b
z H
k k
k k
K
k
N
N
N
b
b
b
b
N
N
N
N
N

Where, K is equal
to N/2, and B
k,1,
B
k,2,
A
k,1,
A
k,2
are
real numbers
representing the
coefficients of
second-order
section.

Structures for IIR Systems
9
59
Implementation of Discrete-Time Systems
) ( ) ( ); ( ) (
, , 2 , 1 ,
1
1
) (
) (
) (
1 0 1
2
2 ,
1
1 ,
2
2 ,
1
1 ,
1
z Y z Y z X b z Y with
K k
z A z A
z B z B
z Y
z Y
z H
K
k k
k k
k
k
k
= =
=
+ +
+ +
= =
+


+

Digital Signal Processing
Biquad Section:
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.
Y
k
(n)=X
K+1
(n)
Y
k+1
(n)
-A
k,1
-A
k,2
1/z
1/z
B
k,1
B
k,2
Structures for IIR Systems
9
60
Implementation of Discrete-Time Systems
Digital Signal Processing
Example:
x(n)
y(n)
-A
1,1
-A
1,2
1/z
1/z
B
1,1
B
1,2
-A
2,1
-A
2,2
1/z
1/z
B
2,1
B
2,2
b
0
Cascade form structure for N=4
Structures for IIR Systems
9
61
Implementation of Discrete-Time Systems
Digital Signal Processing
Example:
Structures for IIR Systems
Determine the cascade
structure the following
transfer function:
9
62
Implementation of Discrete-Time Systems
( )
( )( )
( )( )
( )
( )
( )
( )
1
1
1
1
1 1
1 1
2 1
2 1
z 25 . 0 1
z 1
z 5 . 0 1
z 1

z 25 . 0 1 z 5 . 0 1
z 1 z 1
z 125 . 0 z 75 . 0 1
z z 2 1
z H

+
=

+ +
=
+
+ +
=
Digital Signal Processing
Structures for IIR Systems
Example:
Cascade of Direct Form I
Cascade of Direct Form II
Determine the cascade
structure the following
transfer function:
9
63
Implementation of Discrete-Time Systems
Digital Signal Processing
Parallel Form:
In this form the system function H(z) is written as a sum of
second-order section using partial fraction expansion.

N M if only
N M
k
k
k
K
k
k k
k k
N M if only
N M
k
k
k
N
N
N
M
N
N
M
M
z C
z A z A
z B B
z C
z a z a
z b z b b
z a z a
z b z b b
z A
z B
z H
>

>

+
+ +
+
=
+
+ + +
+ + +
=
+ + +
+ + +
= =
0 1
2
2 ,
1
1 ,
1
1 , 0 ,
0
1
1
1
1 0
1
1
1
1 0
1
1

1 ) (
) (
) (
K=N/2, and
B,A are real
numbers
Structures for IIR Systems
9
64
Implementation of Discrete-Time Systems
Digital Signal Processing
The second-order Section:

< = =
=
+ +
+
= =

+
N M z Y z Y z X z H z Y with
K k
z A z A
z B B
z Y
z Y
z H
k k k
k k
k k
k
k
k
), ( ) ( ), ( ) ( ) (
, , 2 , 1 ,
1 ) (
) (
) (
2
2 ,
1
1 ,
1
1 , 0 ,
1

Is the k-th proper rational biquad section.


The filter input is available to all biquad section as well as
to the polynomial section if M>=N (which is an FIR part)
The output from these sections is summed to form the
filter output.
Each biquad section can be implemented in direct form II.
Structures for IIR Systems
9
65
Implementation of Discrete-Time Systems
Digital Signal Processing
Parallel form structure for N=4 (M=N=4)
C
0
B
1,0
-A
1,1
-A
1,2
B
1,1
B
2,0
-A
2,1
-A
2,2
B
2,1
x(n) y(n)
1/z
1/z
1/z
1/z
Structures for IIR Systems
9
66
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for IIR Systems
Example:
Determine the parallel
structure the following
transfer function:
H(z) must be expanded in partial fractions:
9
67
Implementation of Discrete-Time Systems
Digital Signal Processing
Structures for IIR Systems
Example: (Cont.)
9
68
Implementation of Discrete-Time Systems
Digital Signal Processing
for IIR Systems
Example:
Determine the parallel
structure the following
transfer function:
( )
( ) ( )
1 1 2 1
2 1
z 25 . 0 1
25
z 5 . 0 1
18
8
z 125 . 0 z 75 . 0 1
z z 2 1
z H

+ =
+
+ +
=
( )
2 1
1
z 125 . 0 z 75 . 0 1
z 8 7
8 z H

+
+
+ =
9

You might also like