You are on page 1of 26

Ch.

14 Subband Coding
Perfect Reconstruction Filterbanks

Perfect Reconstruction for 2 Channels


Recall the general structure of subband coding:

To Design the Filters: Imagine removing the encoders/decoders Then design


so that the output is a perfect reconstruction of the input
PR

x[n ] = cx[n no ]
X ( z ) = cX ( z ) z no

Well limit here to M = 2 Channels

The analysis side filters


are half-band LPF & HPF

Q: To ensure PR how do we choose:


Analysis Filters: H1(z), H2(z)
Synthesis Filters: K1(z), K2(z)
Note: If H1(z), H2(z), K1(z) & K2(z) are
all ideal half-band filters then PR is
easily achieved
But we cant build ideal filters So is it
even possible to really get PR????

Impact of Non-Ideal Filters


Stop-Band Issues
Analysis Filters: H1(z) & H2(z) will leave some content outside their halfband passbands that gets aliased into the passband after decimation.
Synthesis Filters: K1(z) & K2(z) will not completely eliminate the images
created by upsampling that lie outside their half-band passbands.

Pass-Band Issues
Magnitude: For non-ideal filters the passbands are not perfectly flat and
will change the shape of the signals DTFT magnitude in the passband.
Phase: Because PR allows a delay and a delay corresponds to a linear
phase response (as a function of frequency) it seems natural to focus on
linear phase filters which puts our focus on FIR Filters.
Our Goal: Choose filters such that the aliasing & imaging
errors cancel out!!! (Fixes the stop-band issues)
Then make what is left combine to give the desired
composite passband to achieve the PR condition.

Lets see how


to do this
mathematically
4

Math Analysis of PR Requirements

Start at input & work toward the output using z-transform methods:
Top Channel (Bottom Channel Similar):

Y1 ( z ) = H i ( z ) X ( z )

Filter

1
1
12
W1 ( z ) = Y1 ( z ) + Y1 ( z1 2 )
2
2
=

Down Sampling

1
H1 ( z1 2 ) X ( z1 2 ) + H1 ( z1 2 ) X ( z1 2 )
2
5

V1 ( z ) = W1 ( z 2 )
=

Up Sampling

1
[ H1 ( z ) X ( z ) + H1 ( z ) X ( z )]
2

U1 ( z ) = K1 ( z )V1 ( z )

Filter

1
= K1 ( z ) [ H1 ( z ) X ( z ) + H1 ( z ) X ( z )]
2
Now the output of the whole structure is:

X ( z ) = U1 ( z ) + U 2 ( z )

Summation
6

Substitute results for Ui(z) & Group X(z) terms & group X(-z) terms

1
1

X ( z ) = [ H1 ( z ) K1 ( z ) + H 2 ( z ) K 2 ( z ) ] X ( z ) + [ H1 ( z ) K1 ( z ) + H 2 ( z ) K 2 ( z )] X ( z )
2
2

= T ( z)

= S ( z)

X ( z ) = T ( z ) X ( z ) + S ( z ) X ( z )
Aliasing Term
Dont Want It!
j

X ( z ) = X (e z )
e j z

DTFT : z = e

z =e

Aliasing

X DTFT ( + )

= e j ( + )

We want to eliminate this Aliasing Term: S(z) = 0

H1 ( z ) K1 ( z ) + H 2 ( z ) K 2 ( z ) = 0
Can cancel aliasing term by choosing:

K1 ( z ) = H 2 ( z ) &

K 2 ( z ) = H1 ( z )

K1 () = H 2 ( + )

K 2 ( ) = H 1 ( + )

&

ACC
Aliasing
Cancellation
Condition

Doesnt constrain the filters but constrains the relationship between the Ks and Hs

Note: Since.

H1(z) is lowpass

&

H2(z) is highpass

we have:

K1(z) is lowpass

&

K2(z) is highpass.

To see this: K1(z) = H2(z) K1(z) = H2(e j z)

K1() = H2( + )

H2()
- -/2

/2

K1() = H2( + )

- -/2

Similarly: K2(z) = H1(z) K2(z) = H1(e j z)

/2

K2() = H2( + )

Once the Ks are chosen this way we get


X ( z ) = T ( z ) X ( z )
=

1
[ H1 ( z ) H 2 ( z ) H1 ( z ) H 2 ( z )] X ( z )
2 

Want this = Cz no for PR

So the condition the Hs must meet for PR is:

[ H1 ( z ) H 2 ( z ) H1 ( z ) H 2 ( z )] = Cz n

Note:

()

the Ks are chosen to cancel aliasing


the Hs are chosen to give PR

Comment: For compression we not only want to cancel aliasing but we often
need to minimize it in each channel which requires all filters to have sharp
transition bands and low stop bands
Why do we need this? Because in compression we often throw away some
subbands (those having small energy) and that upsets the balance used to
cancel aliasing!

Focus of Design Process


So our design process now focuses on designing the analysis filters
H1(z) & H2(z) so that they meet () for PR
Note: The aliasing cancelation puts no constraint on the design of the
filters it only says: if the analysis filters are this then the synthesis
filters must be that.
There are several design methods to get analysis filters H1(z) & H2(z)
that give PR various researchers have proposed these over the years.
Well look at two:
Quadrature Mirror Filters (QMF)
Power Symmetric Filters
also called Conjugate Mirror Filters (CMF)

10

Quadrature Mirror Filters (QMF)


These were proposed in 1977 by Esteban & Galand
Their definition of QMF leads to:
Useful filters for filterbanks
But not able to give PR (except in a trivial case)
QMF Definition: A pair of analysis filters are QMFs if

z z = e j = e j e j
= e j

H 2 ( z ) = H1 ( z )
QMF Condition

H 2 ( ) = H1 ( )

Note: Once H1(z) is designed then the QMF condition nails down H2(z) and
remember that K1(z) & K2(z) are also nailed down by the ACC
So enforcing QMF & ACC reduces the design problem to only designing H1(z)

11

QMF Facts
1.

If H1(z) is linear phase, so is H2(z)

2.

QMFs can only achieve PR if the h1[n] and h2[n] each have only 2 nonzero taps

E.g., h1[n] = [ 1 1]

Note: 2-tap Filters Stink! (See poor -band characteristics shown in


Fig. 14.18)

3.

or

h1[n] = [ 1 0 1] or

h1[n] = [ 1 0 0 1] etc.

If H1(z) has linear phase then T(z) the analysis/synthesis total transfer
function also has linear phase.

Linear
Phase

Note that this is necessary for PR, where we need

T ( z ) = Cz no

T () = Ce jno

So for QMF (w/ # taps > 2) we cant get the amplitude part of PR:
jno
T () = C
(

)
e
N

Amplitude
Distortion

real-valued
& 0

Not PR!

Linear
Phase
12

QMF Design Process (One Way to Do It)


1.
Not really
part of QMF
design
just what we
do with
them once
weve
designed
them

Once we get a design for the Analysis Filters the Hi()


Choose the Synthesis Filters the Ki() to cancel aliasing

K1 ( z ) = H 2 ( z ) &

K 2 ( z ) = H1 ( z )

ACC

1
T ( z ) = [ H1 ( z ) H 2 ( z ) H1 ( z ) H 2 ( z )]
2
2.

Eliminate Phase Distortion by constraining the Hi() to be


linear phase FIR filters which ensures that you get:

T () = C ()e jno
3.

Enforce the QMF relationship

H 2 ( z ) = H1 ( z )

QMF

1
2
2
T ( z ) = [ H1 ( z )] [ H1 ( z )]
2

T(z) now
depends only
on H1(z)!!
13

4.
See book
Numerical
Recipes in
C for details
on numerical
minimization
methods

Design H1() to be a good LPF and to minimize the amplitude


distortion of the end-to-end frequency response T(). This
can be done numerically by minimizing

J (h1 ) =

Vector of
Filter taps

4.

H1 ( ) d + (1 ) 1 T ( ) d

Stop-Band
Energy

Amplitude Distortion Measure

controls relative priority of


the two goals 0 1

Once you have a H1() that minimize J for your chosen ,


then use it to generate all the other filters

H 2 ( z ) = H1 ( z )

QMF

K1 ( z ) = H 2 ( z ) = H1 ( z )

K 2 ( z ) = H1 ( z )

ACC
14

Power Symmetric FIR Filters (or Conjugate Mirror Filters)


This Does Allow PR!!!
Well get rid of aliasing the same way as before:

K1 ( z ) = H 2 ( z ) &

K 2 ( z ) = H1 ( z )

ACC

Error in Book in (14.75)

This gives S(z) = 0 (as before) and gives (as before)

T ( z) =

1
[ H1 ( z ) H 2 ( z ) H1 ( z ) H 2 ( z )]
2

Error in Book

Now here is the new condition to use instead of QMF:


Only Use
Odd N

H 2 ( z ) = ( z ) N H1 ( z 1 )

CMF Z-D

where N = Order of the FIR filter H1(z)


Recall: FIR has h1[n] = 0 for n 0, 1, 2, , L-1
Length = L

Order = Length 1 = L-1


15

Can show that CMF is equivalent to

h2 [n ] = ( 1) n h1 ( N n )

CMF T-D

For Order-N FIR with Odd N

h1[n ] :

h1[0]

h1[1]

h1 [2]

h2 [n ] : h1[ N ] h1[ N 1]

"

"

h1 [ N ]

h1[1] h1[0]

Using CMF Z-D in T(z) gives:

1 N
T ( z ) = z H1 ( z ) H1 ( z 1 ) + H1 ( z ) H1 ( z 1 )
2

= R( z )
=

1 N
z [ R( z ) + R( z )]
2
Want = constant for PR

16

Recall: 1. If H1(z) h1[n] then H1(z-1) h1[-n]


2. F(z)G(z) f [n]*g[n]

R ( z ) [n ] = h1[n ]* h1 [ n ]

So since R(z) = H1(z)H1(z-1)


Time Auto
Correlation of h1[n]

Note:

= h1 [k ]h1 [k + n ]
k =0

[n] = 0 for |n| > N


[-n] = [n] (even symmetry)

So (recalling that N is odd)

R ( z ) = [ N ]z N + [ N 1]z N 1 + " + [1]z1 + [0] + [1]z 1 + " + [ N ]z N


R( z ) = [ N ]z N + [ N 1]z N 1 " [1]z1 + [0] [1]z 1 + " [ N ]z N
Cancel

Cancel

Cancel

Cancel

Odd-Indexed Terms Cancel when R(z) & R(-z) are added


17

R( z ) + R( z ) = Only even-order terms


= [0] +

n = 2,4,..., N 1

[n ] ( z n + z n )

Want = constant for PR

C , n = 0

[n ] = 0, n even, n 0

don ' t care, n odd


Requirement for PR: [2n] = C [n]
N

[2n ] = h1[k ]h1[k + 2n ] = C [n ]


k =0

Time-Domain
Requirement
for PR

18

To convert this into Freq. Domain: F { [2n ]} = F {C [n ]}


DTFT of
decimated
sequence
From F-D result for decimation:

=C
Dummy
Variable

F { [2n ]} =


= 2

(A)

1
 2
R ( 2 ) + R (

2 )

2
1
R ( ) + R ( )
2

(B)

Now since R(z) = H1(z) H1(z-1) The DTFT form is R() = H1 () H1 ( )


= H1 () H1* ()

R () = H 1 ()
From (A) (C) we get:

(C)
2

H 1 () + H 1 ( ) = C

Freq-Domain
Requirement
for PR
19

To see this condition:

|H1( )|2

|H1()|2 + |H1( )|2

|H1( )|2

|H1()|2

-/2

/2

Filters satisfying this are called


Power Symmetric Filters or Conjugate Mirror Filters

For Design Details See Books on Filter Banks

20

Perfect Reconstruction for M Channels


There are two ways to get PR for M > 2 Channels:
1. Extend all previous results to general M > 2 case

Same basic ideas but much more complicated

See books on Filter Banks

2. Cascade 2-Channel Stages

21

Analysis Side of 3-Stage, 8-Channel PR Filter Bank

22

Design a 2-Channel PR Filterbank Get M Channel PR:


Gives PR so can remove
2

K1(z)
2

K2(z)

K2(z)

x[n ]

Gives PR so can remove


2

K1(z)
2

K2(z)

K2(z)

23

After removal of Center:


Gives PR

z-k

K2(z)

x[n ]

z-k

K2(z)

So a cascade followed by the reverse cascade collapses to


give M-Channel PR
24

What do the various channels in a cascaded analysis filter bank look like?
Can be shown that each channel has transfer function that looks like this (for
the 3-stage case):

H channel ( z ) = H i ( z ) H j ( z 2 ) H k ( z 4 )
1 or 2
(1st Stage)

Hchannel(z)

1 or 2
(2nd Stage)

1 or 2
(3rd Stage)

23

The cascade method is useful but has a limitation:


If Hi(z) has order N, then Hi(z2) has order 2N, and Hi(z4) has order 4N
and then the cascade of them has order N + 2N + 4N
BUT. You only have N degrees of freedom in choosing all those
N + 2N + 4N coefficients!!!

Book has
error uses
product
here instead
of add

25

Bit Allocation
Same ideas as for Bit Allocation for TC.
Each subband has its own quantizer and you want to allocate bits to
the quantizers

26

You might also like