Professional Documents
Culture Documents
DSP-II
p. 1
Filter Design/Realization
Step-1 : define filter specs
(pass-band, stop-band, optimization criterion,)
p. 2
p. 3
(
bo x y[k] + + b1 x
(
b2 x
(
b3 x
(
b4 x
(
bo x y[k] + + b1 x
(
b2 x
(
b3
(
bo x y[k] + + b1 x b2 x
(
b3 x
(
b4 x
i.e.
(
b4 x x ~ y[k] y[k] + + b3 bo + + x
(
b2 x b1 + + x
(
b1 x b2 + + x x
(
bo b3 x x
b4
p. 10
b3 b1
b2 b2
b1 b3
b0 T u .? [ k ]...u[ k N ]A b4
(assume b0 { 0)
O 0 0 b'3 b'2 b'1 b'0 T u .? [k ]...u[ k N ]A 1 b'0 b'1 b'2 b'3 0 O 0 z 1 0 b'3 b'2 b'1 b'0 T u . . .? [ k ]...u[ k N 1]A 1 0 1 b'0 b'1 b'2 b'3 b1 O 0b3 b2 O 0b2 b3 O 0b1 b'1 ! , b'2 ! , b'3 ! 2 2 2 1 O0 1 O0 1 O0
p. 11
(
~ y[k] + x ko y[k] + x b3 x b2 x bo + + + + x
(
b1 x b1 + + x
(
bo x b2 x x b3
+ x
(
k1
+ x
(
k2 x
+ x
(
k3 x
with
~ ~ H ( z) :
~ 1 ~ ~ ~ H ( z ). H ( z ) H ( z ). H ( z ) ! 1
1
(*)
PS : interpretation ? (see next slide) PS : may have to scale H(z) to achieve this (why?) (scaling omitted here)
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 16
1
j[
H ( z ) z ! e j[
!1
~ j[ 2 ~ H (e ) H (e )
j[ 2
T
~ ~ H (z ) and H ( z ) are `power complementary i.e. (= form a 1-input/2-output `lossless system, see also below)
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 17
~ ~ H ( z ) computed ?
Note that if `a is a root of R(z), then `1/a is also a root of R(z). Hence can factorize R(z) as ~ ~ 1 ~ ~ ~ ~ 1 H ( z ).H ( z ) ! ( z ai )( z ai ) H ( z ) ! ( z 1 ai )
i i
Note that ais can be selected such that all of them lie inside the ~ ~ unit circle. Then H ( z ) is a minimum-phase FIR filter. This is referred to as spectral factorization,
ALARI/DSP Marc Moonen - Version 2011
~ ~ H (z)
=spectral factor.
p. 18
(
~ ~ b0 ~ ~ b1
(
~ ~ b2
(
~ ~ b3
(
x
~ ~ b4
x x ~ ~ y[k] y[k] + + bo
x x + + b1
x x + + b2
x x b4
x b3 + +
p. 19
(
~ ~ y[k]
cosU 0
(
x x x b1 + + + +
(
x x b2 x b3
x x
(
sinU 0 sinU 0
x bo + +
y[k] + x
cosU 0
Now shaded graph can again be proven to be power complementary system (Why ? Intuition? Hint: page 23).
~ ~ y[k]
cosU 0
cosU1
cosU 2
cosU3
cosU 4
x x
(
sinU 0
x x x
(
sinU1
x x x
(
sinU 2
x x x
(
sinU 3 sinU 3
y[k]
x + x
cosU 0
sinU 0
sinU1
sinU 2
x
cosU1
x
cosU 2
x
cosU 3
x
sin U 4
p. 22
i.e. forms a 2-input/2-output `lossless system. Overall system is realized as cascade of lossless sections, hence is itself also `lossless (see also next slides)
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 23
u[k]
+ +
x x x x
+ +
x x x x
verify!
!!
1 0 0 R T . R ! 0 1 0 0 0 1
hence
2 2 x1[ k ] ! x [ k ] u2[ k ]
- R is `realization matrix (A-B-C-D-matrix) for 1-input/2-output system - R is orthogonal ! Orthogonality implies `losslessness (see next slide)
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 24
!1
example :
o = original transfer function + = transfer function after 8-bit truncation of lattice filter parameters - = transfer function after 8-bit truncation of direct-form coefficients (bis)
~ ~ y[k] M=3 +
cosU1
cosU 2
U1 ,U 2
U 3 ,U 4
U 5 ,U 6
u[k]
(
x x x
sin U 2 sinU 2
~ y[k]
x x x
+
sinU1
sin U1 cosU 2
y[k] + x
cosU1
~ 1 ~ ~ ~ 1 ~ ~ explain/derive! H ( Marc Moonen - Version ( z ALARI/DSP z ).H ( z ) H ( z ).H 2011) H ( z ).H ( z ) ! 1 Lecture-4 : FIR and IIR Filter Realization
1
p. 27
Several possibilities exist 1. Direct form 2. Transposed direct form PS: Parallel and cascade realization 3. Lattice-ladder form 4. Lossless lattice PS: State space realizations
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 28
B ( z ) b0 b1 z 1 ... bN z N H ( z) ! ! A( z ) 1 a1 z 1 ... a N z N
u[k]
1 A( z )
bo x y[k]
ALARI/DSP Marc Moonen - Version 2011
b1 x +
b2 x +
b3 x +
b4 x
B (z )
p. 29
1 A( z )
b1 x +
b2 x +
b3 x +
b4 x
B(z )
PS : If all a_i=0 (i.e. H(z) is FIR), then this reduces to a direct form FIR
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 30
+
-a2
+
-a3 -a4
x1[k 1] a1 a2 a3 a3 x1[k ] 1 x [k 1] 1 0 0 0 x2 [k ] 0 .u[k ] 2 ! . x3[k 1] 0 1 0 0 x3 [k ] 0 x4 [k 1] 0 0 1 0 x4 [k ] 0 x1[k ] x [k ] y[k ] ! ?b1 a1.b0 b2 a2 .b0 b3 a3 .b0 b4 a4 .b0 A 2 b0 .u[k ] . x 3 [ k ] x4 [k ]
x
x1[k]
x
x2[k]
x
x3[k]
x
x4[k]
(
bo b1
(
b2
(
b3
(
b4
x +
x +
x +
x +
y[k]
b1
x + +
b2
x + +
b3
x + +
b4
B (z )
1 A( z )
p. 32
bo x +
b1 x +
b2 x +
b3 x +
b4 x
B(z )
1 A( z )
p. 33
B(z )
+ ( +
( +
( +
1 A( z )
PS : If all a_i=0 (i.e. H(z) is FIR), then this reduces to a transposed direct form FIR
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 34
u[k]
bo
b1
b2
b3
b4
x1[k] + ( -a1
-a2
-a3
-a4
A C
B A ! D Direct form C
y[k]
i.e. direct forms state space matrices are `transpose of each other (which justifies the name `transposed dir.form).
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 35
u[k]
+ +
similar for the case of multiple poles each term realized in, e.g., direct form transmission zeros are realized iff signals from different sections exactly cancel out. =Problem in finite word-length implementation
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization
y[k]
p. 36
u[k]
y[k]
similar for N odd each section realized in, e.g., direct form second-order sections are called `bi-quads
p. 37
``Pairing procedure :
y[k] - pairing of little importance in high-precision (e.g. floating point implementation), but important in fixed-point implementation (with short word-lengths) - principle = pair poles and zeros to produce a frequency response for each section that is as flat as possible (i.e. ratio of max. to min. magnitude response close to unity) - obtained by pairing each pole to a zero as close to it as possible - procedure : start with pole pair nearest to the unit circle, and pair this to nearest complex zeros. remove pole-zero pair, and repeat, etc.
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 38
- numerator polynomial is denominator polynomial with reversed coefficient vector (see also page 9) ~ - hence H ( z ) is an `all-pass (=`SISO lossless) filter :
z ! e j[ ALARI/DSP Marc Moonen - Version 2011 2 ~ H ( z)
~ 2 A( z )
A( z ) z !e j[
z ! e j[ 2
!1
Lecture-4 : FIR and IIR Filter Realization p. 39
u[k]
+ a1 x
+ a2 x
+ a3 x a4 x
a3 x a2 x a1 x 1 x x b1 x b2 x b0 x b3 x b4 + + + + + + +
p. 40
u[k]
x
cosU 0 sinU 0
+ a1 a 4.a3 1 a 4.a 4
+ x
a 2 a 4.a 2 1 a 4.a 4
+ x
a3 a 4.a1 1 a 4.a 4
x[k-1]
x
b0
sinU 0
(
a 2 a 4.a 2 1 a 4.a 4
(
x
a1 a 4.a3 1 a 4.a 4
(
x x +
a3 a 4.a1 1 a 4.a 4
1
b3 b0.a3 1 a 4.a 4
x x b4 b0.a4
1 a 4.a 4
x +
cosU 0
x b1 b0.a1
1 a 4.a 4
x b2 b0.a2
1 a 4.a 4
~ y[k] y[k] +
+ +
+ +
+
p. 41
a4 ( sin U 0 ! ! k0 1
u[k]
x +
cosU 0 sinU 0
x
bo
sinU 0
x x
x ~ y[k] y[k] + +
cosU 0
p. 42
verify!
!!
~
p. 44
- R is `realization matrix (A-B-C-D-matrix) for u[k] -> y[k] (SISO) - R is orthogonal (R^T.R=I), which implies `losslessness , i.e. 2 ~ (cfr. page 39) H ( z) !1
z ! e j[
in x out
x +
cosU 0
sinU 0 sinU 0
cosU 0
+ x
Lecture-4 : FIR and IIR Filter Realization p. 45
with...
~ C ( z ) c0 c1 z 1 ... c N .z N ~ H ( z) ! ! A( z ) 1 a1 z 1 ... a N z N
(p.17-18)
p. 46
u[k]
cos] 0
x +
cosU 0
sinU 0
+ ~ y[k] y[k]
x x x
sin] 0
sin] 0
x
cosU 0
cos] N sin] N
k0 ! sinU 0
x x
+ x
x
cos] 0
p. 47
State-space description with orthogonal realization matrix R (try it) implies overall lossless characteristic, i.e.
H ( z ) z ! e j[
2 2 ~ ~ H ( z) z !e
j[
!1
PS : If all a_i=0 (i.e. H(z) is FIR), then all theta_i=0 and then this reduces to FIR lossless lattice PS : If all phi_i=0, then this reduces to (retimed) Gray-Markel structure
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization
p. 48
x +
cosU 0
cosU 2
sinU 0
x x x
sin U 2
sinU 2
x
cosU 0
k0 ! sinU 0
+ x x
x x x
+
sin U1
sin U1 cosU 2
y[k] + x
x
Lecture-4 : FIR and IIR Filter Realization p. 49
State-space realization = realization such that all the elements of A,B,C,D are the multiplier coefficients in the structure A u[k] C ( B +
N
y[k]
Example: (transposed) direct form is NOT a state-space realization, cfr. elements (bi-bo.ai) in B or C (page 31 & 35)
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 50
L
u[k]
1 E i .z 1 F i .z 2 H i ( z) ! 1 K i .z 1 H i .z 2
+ +
Q Q
O
P
poles : L s j.Q
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 51
0 A . 1 C
B T . 0 D
0 1
State-space realization with orthogonal realization matrix is referred to as `orthogonal filter : A B R! C D RT .R ! R.R T ! I Relevance : implementation aspects
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 52
`triangle of stability : denominator polynomial is stable (i.e. roots inside unit circle) iff coefficients lie inside triangle
Hi
1 -2 -1 2
Ki
proof: apply Schur-Cohn stability test (cfr. supra). Stable iff all |ki|<1.
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 55
end
- 0 .5 -1 - 1 .5 - 1 .5
-1
- 0 .5
0 .5
1 .5
Low density of `quantized pole locations at z=1, z=-1, hence problem for narrow-band LP and HP filters (cfr. supra).
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 56
L
u[k]
1 .5 1
+ +
Q Q
O
P
0 .5 0
y[k]
-1
-0.5
0 .5
1 .5
p. 57
-> tightly spaced poles (e.g. for narrow band filters) imply high sensitivity of pole locations to coefficient quantization -> hence preference for low-order systems (parallel/cascade)
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 58
Coefficient Quantization
PS: Coefficient quantization in lossless lattice realizations,
o = original transfer function + = transfer function after 8-bit 8truncation of lossless lattice filter coefficients - = transfer function after 8-bit 8truncation of direct-form directcoefficients (bis)
In lossless lattice, all coefficients are sines and cosines, hence all values between 1 and +1, i.e. `dynamic range and coefficient quantization error well under control.
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 59
Addition:
if, two B-bit numbers are added, the result has (B+1) bits.
Multiplication:
if a B1-bit number is multiplied by a B2-bit number, the result has (B1+B2-1) bits. For instance, two B-bit numbers yield a (2B-1)-bit product Typically (especially so in an IIR (feedback) filter), the result of an addition/multiplication has to be represented again as a B-bit number (e.g. B=B). Hence have to remove most significant bits and/or least significant bits
ALARI/DSP Marc Moonen - Version 2011 Lecture-4 : FIR and IIR Filter Realization p. 60