You are on page 1of 37

ELEN E4810: Digital Signal Processing

Topic 7:
Filter types and structures
1. More filter types
2. Minimum and maximum phase
3. Filter implementation structures

1
1. More Filter Types
 We have seen the basics of filters
and a range of simple examples
 Now look at a couple of other
classes:
 Comb filters - multiple pass/stop bands

 Allpass filters - only modify signal


phase

2
Comb Filters
 Replace all system delays z-1 with
longer delays z-L
y[n]
x[n] z-L + z-L

z-L z-L

→ System that behaves ‘the same’ at


a longer timescale

3
Comb Filters
 ‘Parent’ filter impulse response h[n]
becomes comb filter output as:
g[n] = {h[0] 0 0 0 0 h[1] 0 0 0 0
h[2]..} L-1 zeros

 Thus, G  z    g n  zn
n
  hnz  nL  H z L

n

4
Comb Filters
 Hence frequency response:
parent frequency response

 H(e )
G e j
j
 
 H e jL & repeated L times
G(e j  )
compressed

L copies
 Low-pass response → of H(e j  )
 pass  = 0, 2 π/L, 4 π/L...
 cut  = π/L, 3 π/L, 5 π/L... useful to enhance
a harmonic series
5
Allpass Filters
 Allpass filter has A(ej  )2 = K for all  i.e.
spectral energy is not changed Phase

response is not zero (else trivial)
 phase correction 5
 special effects
 e.g. |H(ω)|
0
Magnitude (dB)

−5

−10

−15

−20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

−100

θ(ω)
Phase (degrees)

−200

−300

−400
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

6
Allpass Filters
 Allpass has special form of system fn:
dM  dM 1z 1M
 ...  M 1  z

AM z   1  1  ... dd1zM M  dM z 


1 M
d1z z
 z 
D M 
z
1
=
1
mirror-image

M
DM z
 polynomials

 AM(z) has poles  where DM( ) = 0

→ AM(z) has zeros = 1/ = -1


7
1
Allpass Filters
AM z  z M
DM z 
DM

z
 Any (stable) DM can be used:
Im{z} 1
reciprocal
zeros 0 poles
from DM(z- −1 from 1/DM(z)
1)
−3 −2 −1 0 1 2
Re{z}
peak
Phase is always
arg{H(z)}
group
0

−

decreasing: −2 delay


  M at   −3
0 0.2 0.4 0.6 0.8
1 /

8
M
Allpass Filters
Why do mirror-img poly’s give const gain?
 Conj-sym system fn can be factored as:


K i z  * 1
i
o * 1
i

AM z  
 z   
λ ej
i *
i i

K  *i 1 z i  z ZP *i e-j


 i 1
 + complex
-1i z - ji  conjugate p/z
 z = ej  → z = e also on u.circle...
9
2. Minimum/Maximum Phase
 In AP filters, reciprocal roots have..
 same effect on magnitude (modulo const.)
 different effect on phase
 In normal filters, can try
substituting reciprocal roots

reciprocal of stable pole will be unstable ×
 reciprocals of zeros?
→ Variants of filters with same magnitude
response, different phase
10
1
0
Minimum/Maximum Phase
 Hence:
z-b b(z -
H1(z) = 1/b)
z-a H2(z) = z - a
reciprocal
a b a 1/b zero..
3 3

H(ej )
2 2
.. same
1 1 mag..
0 0

0.5 0.5
 .. added
H(ej) 0
0
phase
-0.5
-
0.5 lag
- -
0 0.2 0.4 0.6 0.8  0 0.2 0.4 0.6 0.8 
 

11
Minimum/Maximum Phase
 For a given magnitude response
 All zeros inside u.circle → minimum
 phase

All zeros outside u.c. → maximum


 phase (greatest phase dispersion for
 i.e.that
fororder) Otherwise,
a given magnitudemixed phase
response
several filters & phase fns are possible;
minimum phase is canonical, ‘best’

12
Minimum/Maximum Phase
 Note:
Min. phase + = Max. phase
Allpass o o

o pole-
zero
cancl’n
o

o o

z  z 
1 1*
z  z
1

1*

 z    z   x   =  
z z   z    z 
 
*
 13
Inverse Systems
 i h [n] is called the inverse of hf[n] iff
hi n  h f n   n
 Z-transform: H f (e j ).H i (e j )  1

x[n] w[n]
y[n] Hf (z) Hi
(z)

W z  Hi zY z  Hi zH f zX z  X

zi.e. Hi(z) recovers x[n] from o/p of Hf(z)

 wn  xn 14
Inverse Systems
 What is Hi(z)? Hi zH f z  1

  Hi z  1/ H f z
Hi(z) is reciprocal polynomial→ofzeros
Hf(z)of
P z  poles of
bwd
zeros of fwd
fwd
H f z   H i z  → poles of
Dz 
D z   bwd
 Just swap o

poles P z  o

zeros:
and H f (z) o
Hi(z)
15
Inverse Systems
When does Hi(z) exist?
 Causal+stable → all Hi(z) poles inside u.c.
→ all zeros of Hf(z) must be inside u.c.
→ Hf(z) must be minimum phase
 Hf(z) zeros outside u.c. → unstable Hi(z)
 Hf(z) zeros on u.c. → unstable Hi(z)
j j lose...
H i (e )  1 H f (e )  1 0   

→ only invert if min.phase, H f (e j  ) ≠ 0


16
System Identification
x[n]
y[n] H(z)

 Inverse filtering = given y and H, find x


 System ID = given y (and ~x), find H
 Just run convolution backwards?

yn   k0 hkxn  k deconvolution


 but: errors
y0  h0x 0  accumulate

y1  h0x1 
h0
h1 ... 17
System Identification
x[n] y[n] +
noise H?(z)

 Better approach uses correlations;


Cross-correlate input and output:
rxy   y x  h?  
x x

 h?   rxx 

If rxx is ‘simple’, can recover h?[n]...
e.g.    white
rxx (pseudo-) h? nnoise:
  rxy
18
System Identification
 Can also work in frequency domain:
make a const.
Sxy z  H? z  Sxx
 x[n] is not observable → Sxy unavailable,
but Sjxx
 (e
zj ) may still be known, so:
Syy e  Y  j  Y * j

 e  e
 H e X e H e X e
j
2
j * j *
j j
 H (e ) .S (e )
 xx

 Use e.g.j min.phase to rebuild H(ej  )...


19
3. Filter Structures
 Many different implementations,
representations of same filter
 Different costs, speeds, layouts, noise
performance, ...

20
2
0
Block Diagrams
 Useful way to illustrate implementations
 Z-transform helps analysis:

x[n] y[n] Y z  G1zX z  G2 zY z


+ G1(z)
 Y z1  G1zG2 z  G1zX
G2(z) z
Y z G1z
 H z   X
 Approach 1  G1zG2

z dummy variables
 Output of summers as

z
 Everything else is just multiplicative

21
Block Diagrams
 More complex example:
w1 w2
x[n] + + W1  X  z1
-  -  W23  W1 
+ z-1 2
y[n] +  z-1 w3 Wz1Wz 1W 
3 2
Y  z1W  W W2 W
3 W2 
1 1 2 1 1
Y
   z1    2 


zz1
1
 1
    
z1  zstackable  W3  W
X
z 2nd order section   z
1
1
22
Delay-Free
Loops
 Can’t have them!

x + u y = B(v + Au) u = x + y
Α
Β c y = B(v + A(x + y))
y
+ v
 At time n = 0, setup inputs x and v ;
need u for y, also y for u →can’t calculate
1
 Algebra: 1 +
y(1 — BA) = Bv + x BA u
BA
BAx Bv + 1 B B
y BA +
y 1 1 v
BAx
1 - BA can
BA simplify...
BA
=
23
Equivalent Structures
 Modifications to block diagrams that do
not change the filter
 e.g. Commutation H = AB = BA
A B ≡ B A
 Factoring AB+CB =
x1 (A+C)·B x1
A(z)B(z) y
+ +
A(z) B(z)
x2 y x2
C(z)B(z) C(z)
fewer blocks less computation
24
Equivalent Structures
 Transpos x b1 + y
e reverse paths z-1 b2
z-1
 adders<—>nodes b3
 Input<—>output ≡
y + b1 x
1 2
Y  b1X  b2z X  b3 z X z-1
b2
 
+
1 1
 b1X  b2 X  z b 3 X z-1 b3
z

25
FIR Filter Structures
 Direct form “Tapped Delay Line”
x z-1 z-1 z-1 z-1 yn  h0 4xn  h1xn 1
h0 h1 h2 h3 h4
y  ...   k0 hk xn  k
+ + + +

 Transpos
x e
h4 h3 h2 h1 h0 z-1 z-1
y
+ + + +
z-1 z-1

 Re-use delay line if several inputs xi


for single output y ?
26
FIR Filter Structures
 Cascade
 factored into e.g. 2nd order sections
1 2 3
 2h z  *
H z  h0 
h1z  h 0 1  1 h z
31 
1

1  1 2
1 1z
0 z
 12 z
 
11
1
2
z
x h0 h10  Re1z
+ + y

0 z z-1 ≥ z-1 -2Re{1}
0 z-1
1
27
FIR Filter Structures
 Linear Phase:
n

Symmetric filters with h[n] = (-)h[N - n]


x
yn  b0 xn  xn  4 z-1
+ z-1
+
b1xn 1  xn  ...
z-1 z-1
3 + +
b0 b1 b2 y
b2 xn  2 half as many
 Also Transpose form: multiplies
gains first, feeding folded delay/sum line
28
IIR Filter Structures
 IIR: numerator + denominator
1 2
 2  ..
p z
p0  p 1z
H z  1  1  d z 2 . ..
2
d z .
 Pz  1
1

D z 
p0 + +
z-1 p1 -d1 z-1
all-pole
FIR
z-1 z-1 IIR
p2 -d2

29
IIR Filter Structures
 Hence, Direct form I
p0 +
z-1 p1 -d1 z-1

z-1 z-1
-d2
 Commutation
p2 → Direct form II
(DF2) + p0 • same signal
+
-d1 z-1 p1 ∴ delay lines merge
z-1 • “canonical”
-d2
= min. memory usage
p2 30
3
0
IIR Filter Structures
 Use Transpose on FIR/IIR/DF2
x p0 + y

z-1
p1 + -d1

z-1
p2 + -d2

 “Direct Form II Transpose”

31
Factored IIR Structures

 Real-output filters have 
conjugate-symm roots: -
1
H z 
 1  (   j  )z 1
1  ( 

j )z 1 

p0 1  1z 1
2
Can always1 group
1 
 2 
into
2 z1
 ( 2
2   2
2 )z
2nd 2order2 terms
...
H z 1   1 

with real coefficients:
1
 (  2  2 )z 2

...
 1z 22 z
 32
Cascade IIR Structure
 Implement as cascade of fwd gain
second order sections (in DFII) factored
out
x + + + + + + y
p0 z-1
z-1 z-1
1 - 1 22 z-1 -2 2 z-1

 ( 22   22 )  22   22

 Second order sections (SOS):


 modular - any order from optimized block
 well-behaved, real coefficients (sensitive?)
33
Second-Order Sections
 ‘Free’ choices:
 grouping of pole pairs with zero
 pairs order of sections
 Optimize numerical properties:
 avoid very large values (overflow)
 avoid very small values

 (quantization)
e.g. Matlab’s zp2sos
 attempt to put ‘close’ roots in same
 section intersperse gain & attenuation?

34
Second Order Sections
 Factorization affects intermediate values
Factorization 1

Factorization 2
Original System
(2 pair poles, zeros)

 

35
Parallel IIR Structures
 Can express H(z) as sum of terms 1(IZT)
H (z)  consts    1   z F
 
z 
1
11 
z  

N

 Or, second-order
  zterms:
0 k  1kz 1
H (z)  0   k 1  1kz12
 2
kz
 Suggests parallel realization...

36
Parallel IIR Structures
0 y
 Sum terms become
x
parallel paths
+
01
Poles of each SOS
+ +

- 1
z-1 11 are from full TF
-21 z-1  System zeros arise
02
+ +
from output sum
-12
z-1
12  Why do this?
-22 z-1  stability/sensitivity
 reuse common terms

37

You might also like