Sunteți pe pagina 1din 16

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Structures For Discrete-Time Systems

Realization (implementation) of digital filters


Structures of IIR and FIR filters, their advantages and disadvantages efficiency and error

Given H ( z ) =

Example:

b0 + b1 z 1
1 az 1

z>a

h[n ] = b0 a n u[n ] + b1 a n 1u[n 1]

IIR

It is not possible to implement the system by discrete convolution!


y[n ] = ay[n 1] + b0 x[n ] + b1 x[n 1]
Actually, an unlimited variety of computational structures result in the same relation between y[n] and x[n]!
When the numerical precision is limited
different structures may have vastly different behavior.
(i) Finite-precision representation of the system coefficients
(ii) Truncation or rounding of intermediate computations.

Block Diagram and Signal Flow Graph


Three elements in LTI discrete-time systems:
Block diagram

x1

Scalar (Multiplication by

Adder

Signal flow graph

x1
x2

x2

x[n 1]

x[n]

z 1

x[n 1]

a constant)
Unit delay

x[n]

Nodes and branches are keys in a signal flow graph


Source node: No entering branches
Sink node: Only entering branches

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Basic Structures for IIR Systems


Direct Forms
(1) Direct Form I
M

H (z ) =

bk z k

k =0
N

1 a k z k

k =1

k =0

y[n] a k y[n k ] = bk x[n k ]

k =1

H ( z ) = H 2 ( z )H 1 ( z ) =

H (z )
Y (z )
= H 2 ( z )V ( z ) 1
X (z )
V (z )

Y ( z ) = H 2 ( z )V ( z ) y[n] ak y (n k ) = v[n]
X ( z ) = V ( z ) H1 ( z )

V ( z ) = H1 ( z ) X ( z ) v[n] = bk x[n k ]
V ( z ) = bk X (k )z k
Y ( z ) akY ( z )z k = V ( z )
Y ( z ) = V ( z ) + akY ( z )z k

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

(2) Direct Form II (Canonic form)

-- Interchange 1st and 2nd segments and merge the delay lines ( z

-- Number of delay = max(N,M) Canonic

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Cascade Form
-- Serial connection of 1st order and 2nd order factors
bok + b1k z 1 + b2 k z 2
1
2
k =1 1 a1k z a2 k z
Nx

H (z ) =

Remark: Each factor is a Direct Form II.

If there are NS second-order sections


(NS!)2 different pairings and orderings!

bok + b1k z 1 + b2 k z 2 needs 5 constant multipliers for each section.


1
a2k z 2
k =1
1k z
~
~
Nx
1 + b1k z 1 + b2 k z 2 needs 4 constant multipliers for each section.
b0
1
a2 k z 2
k =1 1 a1k z
Nx

1 a

The 5-multiplier sections are commonly used when implemented with fix-point arithmetic.

Parallel Form
-- Parallel connection of 1st order and 2nd order factors
H (z ) =

Np

k =0

NCTU EE

eok + e1k z 1
1
a2 k z 2
k =1 1 a1k z
Ns

Ck z k +

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Feedback in IIR Systems


-- Basic formula of a feedback system (negative feedback)

F ( z)
1 + F ( z ) B( z )
-- If a system has poles, a corresponding block diagram or signal flow graph will have
feedback loops.
(BUT neither poles in the system function nor loops in the network are sufficient for
the impulse response to be infinitely long.)
-- A delay element is necessary in the feedback loop; otherwise, it is noncomputable.
(The structure should be modified to eliminate the noncompuable loops.)
H ( z) =

Transpose Forms
-- Transposition of a flow graph is reversing the directions of all branches in the network
while keeping the branch transmittances (as they were) and reversing the roles of the
input and output (so that source nodes become sink nodes and vice versa).
-- Flow Graph Reversal Theorem
For single-input, single-output systems, the transposed flow graph has the same system function as the original graph if the input nodes and output nodes are interchanged.

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Basic Structures for FIR Systems


Direct Form
-- Transversal filter or tapped delay line

y[n] =

bk x[n k ]

-- convolution

k =0

Cascade Form
-- Serial connection of 1st order and 2nd order factors
Ms

H ( z ) = bok + b1k z 1 + b2 k z 2
k =1

Remark: Each factor is a Direct Form.

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Linear Phase FIR Filters


Take the advantage of the symmetry property of the impulse response
h[M n] = h[n]

h[M n] = h[n]
y[n] =

h[k ]x[n k ]

k =0

Type I or III: M even (order odd)


y[n] =

M 1
2

M
M
h[k ]x[n k ] + h 2 x n 2 + h[k ]x[n k ]

k =0

M
1
2

h[k ](x[n k ] x[n M

k =0

k=

M
+1
2

M
M
= k ]) + k x n
2
2

Type II or IV: M odd (order even)


y[n] =

M 1
2

h[k ](x[n k ] x[n M + k ])

k =0

Linear-phase FIR filters can also be implemented as a cascade of 1st-order, 2nd-order, and
4th-order real-coefficient systems. (The 4th-order system is formed by grouping the
conjugate and the conjugate reciprocal zeros together.)

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Finite-precision Numerical Effects

Due to finite-precision (finite-word length) of computational and/or storage devices.


-- Parameter quanitization
-- Round-off error
-- Limit cycle (IIR) zero input!

Number Representation -- Twos complement number representation


B

)
x = X m b0 + bi 2 i
i =1
1442
443
)
x B = bo b1b2 ... bB

(- 1 x) B < 1)

)
Xm x < Xm
= X m 2 B

x = QB [ x] : quantized value of x

x B : normalized quantized value of x; normalized value of x


: quantization stepsize
b0 : sign bit; b0 =0, if x is non-negative; b0 =1, if x is negative.

Quantization error
(1)

e = QB [ x] x

Overflow: if x > X m . This can be a serious problem if, for example, 01111000,
and we dont check it first. (This is natural overflow.) We first clip the input. It
becomes saturation.

(2)

-- Rounding: nearest integer < e


2
2
-- Truncation: smaller integer

NCTU EE

<e0

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Quantization in implementing systems

H ( z) =

1
1 az 1

Fig 6.39

NCTU EE

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Effects of Coefficient Quantization


Coefficient Quantization in IIR Systems
-- depends on the filter structure
Direct form
M

H (z ) =

b z
k =0
N

b z

1 ak z
k =1
142
43

)
H (z ) =

k =0
N

)
1 a k z k
k =1

A( z )

Note: a k = a k + a k ; bk = bk + bk
Effect on pole locations
( affect frequency response and stability)
N
N
Compare A( z ) = 1 a k z k = (1 z j z 1 )

k =1
j =1

)
A) ( z ) = 1 a) z k =
k
1 z j z 1

)
z j = z j + z j , j = 1,..., N

The change of pole location:

z k

is affected by all {a k } .

N z
z i i
k =1 a k

a k ,

i = 1,2,..., N

Remark: This formula is approximately true when

a k

and

z k are small.

Note that if z i is large, then a small a k leads to a large z k . If so, this is a sena k

sitive system. (Undesirable)

One step further, z i


=
a k

zi

N k

(zi z j )
N

j =1, j i

A( z )
z i A( z )

=
a k z = z
z i z = zi a k
i

(1 zi

i j

zj

z i k

That is, if ( z i z j ) is small, then z i is large; for example, narrow bandwidth


ak

lowpass and bandpass filters which have clustered poles.


Remark: The preceding analysis can be applied to zeros.

NCTU EE

10

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Parallel and cascade forms


-- consists of 1st-order and 2nd-order sections.
Errors in a particular pole pairs (section) are independent of the other poles (sections).
This is also true for zeros in cascade form. In general, both the cascade form

and the parallel form are less sensitive to coefficient quantization (because zeros
are often widely distributed the unit circle).
Example: Bandpass IIR elliptic filter
0.99 H ( e jw ) 1.01

0.3 0.4

H ( e ) 0.01 ( - 40dB )

0.29

H ( e jw ) 0.01 ( - 40dB )

0.41

jw

NCTU EE

11

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Second-order Section
(1) Direct form

Poles: (re j , re j )
1
1
=
j 1
1 re z 1 re z
1 2r cos z 1 + r 2 z 2

NCTU EE

)(

12

DSP (Spring, 2007)

Structures for Discrete-Time Systems

(2) Coupled form


Poles: (re j , re j )
Y1 = X + r cos z 1Y1 r sin z 1Y

Y = r sin z 1Y1 + r cos z 1Y

Y1 = z r sin z 1Y 1 r cos z 1

(r sin )z
Y
=
X 1 2r cos z 1 + r 2 z 2
1

The pole location distribution is even.


The price: The number of multiplications is doubled!

NCTU EE

13

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Coefficient Quantization in FIR Systems


Direct form
M
)
)
H (z ) = h[n ]z n H (z ) = h [n ]z n
n =0

= H ( z ) + H (z )
123
h [n ] z n
M

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

Effect on the zero locations


The sensitivity function of this form is similar to that of the direct form I IIR filter. That
is, if the zeros are tightly clustered, their locations will then be highly sensitive to
quantization errors. However, for most linear phase FIR systems, the zeros are
more or less uniformly spread in the z-plane.
Effect on H (e j )
After scaling, each h[n] is represented by (B+1) bits 2s complement number; i.e.,
2 ( B +1) < h[n] 2 ( B +1) .
H (e j ) = h[n ]e jn
M

n =0

H (e

) = h[n]e
M

jn

n =0

h[n ] e jn
n =0

( B +1)
(M4+21)4

2 4
14
3
worst case!

Effect on linear phase


Not affect the linear phase property as long as h[n] = h[M n] .

Example: Linear Phase Lowpass Filter


0.99 H ( e jw ) 1.01

0 0.4

H ( e ) 0.001 ( - 60dB )

0.6

jw

NCTU EE

14

DSP (Spring, 2007)

NCTU EE

Structures for Discrete-Time Systems

15

DSP (Spring, 2007)

Structures for Discrete-Time Systems

Cascade form
-- less sensitive because it isolate the quantization errors from the other sections.
-- To preserve linear phase each section is linear phase.
(a)
Conjugate 2nd-order sections for conjugate zero pairs on the unit circle.

(b)
(c)
(d)

NCTU EE

(1 + az 1 + z 2 )
Real zero 2nd-order sections for a real zero inside the unit circle and its reciprocal (outside the unit circle).
Zeros at 1.
4th-order sections for conjugate zero pairs inside the unit circle and their associated reciprocals (outside the unit circle).

16

S-ar putea să vă placă și