Wavelets and Filter Banks

advertisement
Wavelets and Filter Banks
彭思龙
Silong.peng@ia.ac.cn
中国科学院自动化研究所
国家专用集成电路设计工程技术研究中心
2008.2.29
• 参考书
– Wavelet and filter banks, G. Strang, T. Nguyen,
Wellesley-Cambridge Press, 1997 (据说有翻译版,
也有MIT的ppt 中文有翻译,也可参考瑞士联邦工学
院M. Vetterlli的ppt)
– 多抽样率信号处理,宗孔德,清华大学出版社,
1996。
– Multirate systems and filter banks, Vaidyanathan,
PP., Englewood Cliffs, New Jersey, Prentice Hall Inc.
1993.
– A wavelet tour of signal processing, S. Mallat,
Academic Press. NY, 1998
– Ten Lectures on Wavelets, Ingrid Daubechies, 1992
– Matlab 6.5, Mathworks.com.
– 其他部分小波应用的书,《小波域图像处理》,
2009年出版
Background needed
• Mathematics:
–
–
–
–
Linear algebra
Polynomial
Mathematical analysis
Functional analysis
• Signal processing
• Image processing
• Matlab programming
Contents
•
•
•
•
•
•
•
Signal processing basic
Filter bank
Mathematical basic
MRA (multiresolution analysis)
Wavelet lifting scheme
Two dimensional wavelet
The application of wavelet
– Wavelet domain denoising
– Fast object searching
Contents (cont.)
– Wavelet domain image deconvolution
– Wavelet domain image super-resolution
– Wavelet domain image compression and postprocessing
– Wavelet domain image fusion and mosaicing
– Filter approximation
– Adaptive wavelet (pyramid)
Contents (cont.)
• Advances of wavelet now:
– Nonlinear signal transform:
• Empirical Mode Decomposition (Hilbert-Huang
transform)
• Local narrow band signal based decomposition
– Geometry wavelet in 2D (optional)
– Image decomposition (optional)
Contents (cont.)
• Some ideas in life and research
– How to win before forty
–…
Lecture 1
• Introduction
– Filter banks=a set of filters, filter is widely used
in many fields of engineering and science for a
long time.
– Wavelet, an old and new tool to produce filter
banks, have been thoroughly studied in past 20
years. Here we use wavelets to indicate many
kinds of wavelets with different properties.
– Application: image compression, pattern
recognition, image processing, video
processing…
Some basic concepts
• Signal: x(t) or {x(n)}
• Filter: a vector, h={h(n)}, for a given signal
{x(n)}, the process of filtering: y=h*x, where * is
the convolution operator:
y ( n)   h( k ) x ( n  k )
k
• FIR=Finite Impulse Response=finite length
• IIR=Infinite Impulse Response=infinite length
• Example of filtering:x=sin(4:0.08:4)+0.1*randn(1,101);h=[1 1 1 1]/4;y=x*h
1.5
1
0.5
0
-0.5
-1
-1.5
0
20
40
60
80
100
120
0
20
40
60
80
100
120
1.5
1
0.5
0
-0.5
-1
-1.5
• Continuous Fourier Transform
f (t )  L2 ( R )  { | f (t ) |2 dt  }
R
Fourier Transform:
fˆ ( ) 
1
2
 f (t )e
 i t
dt
R
Inverse Fourier Transform:
1
f (t ) 
2

fˆ ( )eit d
R
• Some basic properties:
– Linearity
– Parseval Identity:
 f , g  fˆ , gˆ 
• Z transform
Given a signal or filter s (n), Z transform is defined as:
S ( z )   s ( n) z  n
Discrete Time Fourier Transform (DTFT)
S ( )   s (n)e  jn
j  -1
Filtering:
y  x * h  Y ( z )  X ( z ) H ( z )  Y ( )  X ( ) H ( )
• Lowpass Filter=moving average=passing
low frequency
– h={h(n)}, if sum of h is not zero, we call it a
lowpass filter, in most time, the sum of h is 1.
– H(z), H(1)=1
– Example:
•
•
•
•
Simplest: H={1 1}/2; (average)
Spline: {1 2 1}/4
General: {h(n)}
Previous figure
• Highpass Filter=moving difference=passing
high frequency
– h={h(n)}, is called highpass filter is the sum of h
is zero.
– H(z), H(1)=0
– Examples:
•
•
•
•
Simplest: h={1 –1}/2, difference
Dual spline: {-1 2 –1}/4;
General:{h(n)} sum of h is 0.
Figure,x as before, h={-1 2 –1}/4, y=x*h;
1.5
1
0.5
0
-0.5
-1
-1.5
0
20
40
60
80
100
120
0
20
40
60
80
100
120
0.4
0.2
0
-0.2
-0.4
Frequency response of {1 1}/2
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3
-2
-1
0
1
2
3
Frequency response of {1 2 1}/4
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3
-2
-1
0
1
2
3
Frequency response of {-1 2 -1}/4
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3
-2
-1
0
1
2
3
• Phase
H ( ) | H ( ) | ei ( )
– ( ) is called the phase of H
– If ( )  a  b , we say H has linear
phase
– H has linear phase is equivalent to say H is
symmetric or antisymmetric,
– Previous filters are symmetric, have linear
phase
• Invertibility or noninvertibility
– Y(z)=H(z)X(z), If we want to reconstruct X, H
can not be 0 at any point z. If H does not equal
to 0 at any |z|=1, we say H is invertible, that is
to say, we can reconstruct X by:
X(z)=Y(z)/H(z),
which is a inverse filtering, the filter is 1/H(z).
But in most cases, H equals to 0 at some points,
we can not reconstruct X exactly.
– Example: H(z)=1+0.5z is invertible, but
H(z)=(1+z)/2 is not invertible. How to
reconstruct a signal? We can use filter banks
• Filter banks=Lowpass+Highpass(intercomplement),
– Simplest idea: H0 and H1, where H0 is a
lowpass filter, and H1 is a highpass filter, the
lost information in the process of lowpass
filtering can be fund in the output of the
highpass filter.
– Some problems:
•
•
•
•
How to reconstruct the signal?
How to find such filter bank?
How to reduce the computation and/or storage?
Any more properties beside reconstruction?
• Inner product
– F_1 and F_2 are two functions in L_2, the inner
product of these two functions is defined as:
 F1 , F2   F1 F2
R
• Orthogonality
– If <F_1, F_2>=0, we say they are orthogonal.
• Biorthogonality
– Two sets of function {F_j} and {G_j}, if <F_j,
G_k>=1 if j=k and 0 otherwise. We call the two
set of functions are biorthogonal.
• Compact support
– For a given function f, supp(f)={x|f(x) is not 0}
– If measure(supp(f)) is finite, we say f is
compactly supported or f has compact support.
– Corresponding to FIR
Filters
• Signal
– Sequence of numbers, {…x(-1), x(0), x(1), …}
– Unit impulse: x(n)=1 if n=0 and 0 otherwise
– Usually use Dirac delta symbol  (n )
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5
-4
-3
-2
-1
0
1
2
3
4
5
•  (n) is called sampling function:
– x    x(n) (n)  x(0)

T

–  x(t ),  (t )   x(t ) (t )dt  x(0)

– Continuous signal x(t)discrete signal x(n)
• Sampling rules:
–
–
–
–
–
For band-limited and energy limited
Nyquist rate
Sharp: Nyquist,
Redundant: fast than Nyquist
Alias: slow than Nyquist
• Shannon sampling theorem:
ˆ
– If signal f(t) satisfies: supp( f
) is included in the
interval [-T, T], and sampling rate is r, then
 , we can not reconstruct signal f(t);
T


f (t )  r  f (kr) ( x  kr)
• If r<= , we have

T
• Where  is any function w hich satisfies
• If r>
supp(ˆ )  [-/r, /r],
ˆ |[-T, T]  1.

•
T is called Nyquist sampling rate.
sin(T x)
• Purticular ly :  
x
• Simple Proof:
fˆ  [ T , T ]   ,   ,   T
r= /,
therefore
1
f(kr) 
2
1

2

ˆ  )e ikr d
f(

R


1
2 r
such that,

ˆ  )e ikr d
f(




ˆ
f(
)e ik d
r
f̂(

r
)  r  f(kr)e-ik , for     ,   ,that is
Z
f̂( )  r  f(kr)e-ikr , for    ,  
Z
For any function  with ˆ |[ T ,T ]  1 and
ˆ |R \[  , ]  0
ˆ  )  r f(kr)e-ikr ˆ ( )
f(

Z
Inverse transform will be
f(t)  r  f (kr ) (t  kr )
Z
• Delay
– Sx(n)=x(n-1)
• Advance
– S-1x(n)=x(n+1)
• SS-1=S-1S=I, where I represent the unit
operator.
• Time-invariant filters: H is a linear filter, if
H(Sx)=S(Hx): a shift of the input produces a
shift of the output.
• Ideal filters,
– Ideal lowpass: H ( )   h(k ) e
ik
kZ
– Ideal Highpass:H ( ) 
 h( k ) e
kZ
ik
1, 0 |  | /2

0, /2 |  | 
0, 0 |  | /2

1, /2 |  | 
– For ideal lowpass fitler:
n
–
sin
h( n) 
2
n
– But in practice, we must use finite filter for
convolution, the first idea is to use finite part of
this filter, it leads to Gibbs phenomenon.(see ex)
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
function h=idealh(N)
step=pi/200;
o=-pi;
h=zeros(400,1);
for kk=1:400
h(kk)=1/2;
sn=1;
for ii=1:N
nu=2*ii-1;
h(kk)=h(kk)+2*sn*cos(nu*o)/pi/nu;
sn=-sn;
end
o=o+step;
end
figure;plot(h);
• We can verify that
| H ( ) |2  | H (   ) |2  1
• We will meet this equation later in
constructing filter banks.
• Traditional filter design methods:
• Firstly, we note that we only need to
construct lowpass filter, and shift in phase
by pi we can get correspondent highpass
filters.
• Window method: h(n)=hI(n)w(n)
– Hamming window:
2n
w(n)    (1   ) cos(
)
N
| n | (N - 1)/2
2n
w(n)  1 / 2  1 / 2 cos(
)
N
– Kaiser window:
| n | (N - 1)/2
– Hanning window:
2

1
 2n  

w(n)  I 0  1    / I 0 (  ) | n | N/2
2 
N 



where
 (0.5 x) 
I 0 ( x)  1   

k
!
k 1 


2
2
• Equiripple method:
– The filter with the smallest maximum error in
passband and stopband is an equiripple filter.
Means the ripples in passband and stopband is
equal height.
– Remez exchange algorithm
• Weighted least squares(eigenfilters)
– This method is to minimize the function:
E   | D( ) - H(e j ) |2 ( weight)d 
where D( ) is desired frequency response.
• In discrete case, we can rewrite the above
function into E=hTPh, where h is the
unknown coefficient vector. To minimize
the function, h must satisfies Ph=u h, that is
to say, h is an eigenvector of the matrix P,
such that the optimal problem reduces to
find the eigenvector of P.
• In detail for designing lowpass filter:
– Given a unknown symmetric filter h(n)=h(2L-1n) of length 2L
2 L 1
L 1
–
H ( )   h(n)e  jn  e  j ( L 1/ 2 )  h(n)cn ( )
–
n 0
n 0
where cn ( )  2 cos[( n 1/ 2) ]
in stop band, we need the desired response
from ws to PI is zero., then the error function
is:
Estop   H ( )d  h
2
r
T


c( )c( )T d h  hT Ps h
s
In the passband, from 0 to wp, we need the
desired response all pass, such that we can
use normalized constant hTc(0) to rewrite the
error in pass band into :
E pass  h
T
p

0
(c(0)  c( ))(c(0)  c( )) dh  h Pp h
T
T
Where the matrix P is known since we know
c.
We consider the weighted error:
E=aEp+(1-a)Es, find the eigenvectors of
P=Pp+Ps which will be the suitable filters
we needed.
• Halfband and Mth band filter design(filter
banks).
• Maximally Flat Filter: (Daubechies
wavelets).
• Poisson Summation Formula:
– We use Dirac function as a sampling function:
 x(t ) (t  a)dt  x(a)
– By sampling rules, we need x(kr), k is any
integer, consider   (t  2k ) is called Dirac
kZ
comb which likes a comb in figure.
– Poisson summation formula:
1
itn

(
t

2
k

)

e


2

kZ
nZ
– Simple Proof: using distribution and Parseval
Identity.
• Another equivalent form:
1
k G(2k )  2
 Gˆ (n)
n
• Heisenberg’s Uncertainty Principle:
• Define two window width:time and
frequency:
 2   t 2 | f (t ) |2 dt ;
ˆ 2   2 | fˆ ( ) |2 d
• Then: if ||f||=1, we have ˆ  1/ 2
• If f is the Gaussian function, the minimum
value is reached. The inverse is true.
• Basis and frames
– Basis: unique representation; linear
independence and completeness
– Frame: linear independence and completeness
but stable
– Riesz basis: stable basis
• The Wigner-Ville Transform—timefrequency analysis:
• Given a signal f(t), the WV transform is:
W f (t , )   f (t   / 2) f (t   / 2)e i d
R
• Analyze signal in time-frequency plane.
• Some properties:
1
1
2
ˆ ( ) |2 ;
W
(
t
,

)
d


|
f
(
t
)
|
;
W
(
t
,

)
dt

|
f
f
f
2 
2 
W (t  T ,  ) is the transform of eit f (t  T );
t
1
1
W ( , a ) is the transform of
f ( );
a
a a
W (t , ) determine f (t ) up to a constant multiplier | c | 1.
2
1
0
-1
-2
200
250
300
250
300
350
400
450
350
400
450
120
100
Frequency
80
60
40
20
0
200
Time
• Shortcomings:
– Not positive;
– Interactive parts between separated frequency
parts.
• Cohen class:
• General theory reference:
– Time-frequency signal analysis Leon Cohen,
– 中译本:时频信号分析,L.科恩.
• Related theory: Matching Pursuit ( S. Mallat,
Refer to “A Wavelet tour of signal
processing”)
2
1
0
-1
-2
200
250
300
250
300
350
400
450
350
400
450
120
100
Frequency
80
60
40
20
0
200
Time
• Downsampling and Upsamping
–
–
–
–
–
DS: {x(n)}{y(n)}, y(n)=x(2n);
US: {x(n)}{y(n)}, y(2n)=x(n), y(2n+1)=0;
Examples of DS and US.
Two functions: ds and us
Recoverable for half-band signal by using
Shannon sampling theorem.
– Otherwise, we can not recover the signal always.
– We use D denotes the Downsamping operator,
and U denote the Upsampling operator.
– DU=I, that is, D after U does not change the
signal.
• Downsmapling in the frequency domain.
1


v  Dx , ( or v   2 x), then V( )  [ X ( )  X (   )]
2
2
2
• Simple proof:
• Example:
• Aliasing: (see alias.m)
– Extreme aliasing
– No aliasing
– Typical aliasing
• Upsamping in the frequency domain:
v  Ux (or v   2x), V ( )  X (2 )
•
•
•
•
•
•
Imaging: (see imaging.m)
……
Upsamping after downsampling
UDx( )  ( X ( )  X (   )) / 2
Produce both aliasing and imaging
In the Z-domain:
Downdampli ng :
V ( z )  [ X ( z1/ 2 )  X ( z1/ 2 )] / 2
Upsamping :
V ( z)  X ( z 2 )
• To remove the aliasing and imaging, we use
filtering before downsampling to remove
aliasing and after upsampling to remove
imaging.
• ……
• M-channel subsampling:
• V(n)=x(Mn), and u(Mn)=x(n) and 0
otherwise.
1  
  ( M  1)2 
V ( ) 
X ( )  ...  X (
)

M M
M

U ( )  X ( M )
• In the z domain:
1
V ( z) 
M
M 1
1 / M 2ik / M
X
(
z
e
)

k 0
U ( z)  X ( z M )
• Fractional sampling rate:
• DL and UM can commute if and only if L and
M are relatively prime.
• Fundamental rule: if L and M are relatively
prime, then {Mk, k=0, …., L-1} is the same
as {0, 1, …, L-1} besides a integer times of
L.
• Simple proof:…
• Filters exchanged with samplers.
– G(z)DM=DMG(zM)
• Proof:
– UMG(z)=G(zM)UM
• Proof:
Filter Bank
• Lowpass+Highpass
Ideal Lowpass
X(n)
X(n)
Ideal Highpass
Improved Lowpass+Highpass
Ideal LP
2
2
Ideal LP
X(n)
X(n)
Ideal HP
2
2
Ideal HP
Filter bank
• General lowpass and highpass
Lowpass
?
X(n)
Highpass
X(n)
Filter banks
• Perfect Reconstruction condition
H0
y0(n)
2
v0
2
u0(n)
F0
T(n)
X(n)
H1
y1(n)
2
v1
u1(n)
2
F1
• We need T=X to recover the original signal.
Y0 ( z )  H 0 ( z ) X ( z )
1
2
1
2
V0 ( z )  (Y0 ( z )  Y0 (  z )) / 2
U 0  V0 ( Z 2 )
T ( z )  U 0 ( z ) F0 ( z )
T ( z )  F0 ( z )( H 0 ( z ) X ( z )  H 0 (  z ) X (  z )) / 2 
F1 ( z )( H1 ( z ) X ( z )  H1 (  z ) X (  z )) / 2
Therefore
T ( z )  X ( z )( F0 ( z ) H 0 ( z )  F1 ( z ) H1 ( z )) / 2 
X (  z )( F0 ( z ) H 0 ( z )  F1 ( z ) H1 (  z )) / 2
• Theorem 4.1.
– A 2-channel filter bank gives perfect
reconstruction when
– F0(z)H0(z)+F1(z)H1(z)=2z-L
– F0(z)H0(-z)+F1(z)H1(-z)=0
– F0(z)H0(-z)=-F1(z)H1(-z)
• Alias Cancellation and the product filter
–
–
–
–
–
–
–
F0(z)=H1(-z), and F1(z)=-H0(-z)
Let P0(z)=F0(z)H0(z) and P1(z)=F1(z)H1(z), then
P1(z)=-P0(-z), and then
P0(z)-P0(-z)=2z-L
L must be odd, so let P(z)=zLP0(z)
Then we have P(z)+P(-z)=2
Because all even terms in P(z) are zero, we can
conclude that P(z) is a half band filter.
– Some examples.
– Haar Filter
• Ex3:
–
–
–
–
–
P(z)=(-z3+9z+16+9-1-z-3)/16
P=H0F0
The roots of P is: c=2+31/2, 2-31/2, -1(4)
H0 or F0 can be:
The order N can be:
•
•
•
•
N=0, 1
N=1, 1+z-1
N=2, (1+ z-1)2 or (1+z-1)(c-z-1)
N=3, (1+ z-1) 3 or (1+z-1) 2(c-z-1)
• (1+z-1)3 and (-1+ 3 z-1 +3 z-2 - z-3)
• (1+z-1)2(c- z-1) and (1+z-1)2(1/c- z-1), Daubechies
wavelet of length 4
• Modulation matrix:
F1 ( z ) 
 F0 ( z )
 F ( z ) F ( z )
1
 0

l
H
(
z
)
H
(

z
)

 0
 2z
0
 H ( z ) H ( z )   
1
 1
  0

l 
2( z ) 
0
• Theorem 4.2.
– If all filters are symmetric ( or anti-symmetric)
around zero, h(k)=h(-k), then the condition of
PR becomes a statement about inverse matrices
– Fm(z)Hm(z)=2I
• Early choice:
–
–
–
–
Croisier-Esaban-Galand(1976)
H1(z)=H0(-z)
H02(z) - H02(-z) =2z-L
So called QMF(Quadrature Mirror Filter) just because
|H1(z)|=|H0(-z)|, they are symmetric about PI/2--quadrature frequency.
– No FIR filters (except Haar).
– Simple proof: use polyphase expansion
• Better choice:
–
–
–
–
Smith and Barnwell (1984-6), Mintzer(1985)
H1(z)=-zNH0(-z-1),
Orthogonal filter banks.
Simple example: db4
• General choice: F0(z)H0(z) is a half band filter.
Biorthogonal
• Theorem 4.3: In a biorthogoanl linear-phase filter
bank with two channels, the filter lengths are all
odd or all even. The analysis filters can be:
– A)both symmetric, of odd length
– B)one symmetric, and one antisymmetric of even lenth.
– Proof:
• Perfect reconstruction with M Channels.
• Modula matrix:
– Hm(z)=(Hjk(z))jk
– Where Hjk(z)=Hj(zWk) for j,k=0, …, M-1
• Polyphase matrix
– Meaning of polyphase
x(t )   ak t k   a2 k t 2 k   a2 k 1t 2 k 1  x0 (t 2 )  tx1 (t 2 )
M 1
x(t )   xk (t M )t k
k 0
xk (t ) is called a phase of x(t )
– Purpose of polyphase, efficient for computing.
x
H
2
v
1
X ( z1/ 2 ) H ( z1/ 2 )  X (  z1/ 2 ) H (  z1/ 2 ) 

2
X ( z )  X e ( z 2 )  z 1 X o ( z 2 ),
V ( z) 
H ( z )  H e ( z 2 )  z 1 H o ( z 2 )
X ( z1/ 2 ) H ( z1/ 2 )   X e ( z )  z 1/ 2 X o ( z )  H e ( z )  z 1/ 2 H o ( z ) 
 X e ( z) H e ( z)  z 1 X o ( z) H o ( z)
 z 1/ 2 ( X e ( z ) H o ( z )  X o ( z ) e H ( z )
X ( z1/ 2 ) H ( z1/ 2 )   X e ( z )  z 1/ 2 X o ( z )  H e ( z )  z 1/ 2 H o ( z ) 
 X e ( z) H e ( z)  z 1 X o ( z) H o ( z)
-z 1/ 2 ( X e ( z) H o ( z)  X o ( z) e H ( z)
1
X ( z1/ 2 ) H ( z1/ 2 )  X ( z1/ 2 ) H ( z1/ 2 )   X e ( z ) H e ( z )  z 1 X o ( z ) H o ( z )

2
• (HX)e=HeXe+z-1 HoXo
x
2
He
2
Ho
z-1
• Polyphase matrix:
(HX)e
H0
y0(n)
2
v0
X(n)
H1
y1(n)
2
v1
.X ( z )  X 0 ( z 2 )  X 1 ( z 2 ) z 1
H 0 ( z )  H 00 ( z 2 )  H 01 ( z 2 ) z 1
H1 ( z )  H10 ( z 2 )  H11 ( z 2 ) z 1
V0 ( z )  2( H 0 X )( z )  H 00 ( z ) X 0 ( z )  z 1H 01 ( z ) X 1 ( z )
V1 ( z )  2( H1 X )( z )  H10 ( z ) X 0 ( z )  z 1H11 ( z ) X 1 ( z )
• Efficient Filter bank by using polyphase
V0 ( z )   H 00 ( z ) H 01 ( z )   X 0 ( z ) 
 X 0 ( z) 
V ( z )    H ( z ) H ( z )   z 1 X ( z )   H p ( z )  z 1 X ( z ) 
11
 1   10
1


1


 H 00 ( z ) H 01 ( z ) 
H p ( z)  

H
(
z
)
H
(
z
)
11
 10

2
X 0 ( z)
X ( z)
z
1
2
z 1 X 1 ( z )
1 1/ 2
1/ 2
1/ 2
1/ 2
1/ 2 1/ 2
z
X
(
z
)

z
X
(

z
)

z
z X1( z) 



2
H0
y0(n)
2
v0
X(n)
H1
y1(n)
2
v1
2
X(n)
v0(n)
Hp
z-1
2
v1(n)
• Relations with Modula matrix
 H 0,even ( z 2 ) H 0,odd ( z 2 ) 1
 1  H 0 ( z ) H 0 ( z ) 1 1 
 

 1  1
1 
2
2 
H
(
z
)
H
(

z
)
z
H
(
z
)
H
(
z
)
2


1
 1

1,odd
 1,even

• Polyphase for upsampling and reconstruction
v(n)
2
u(n)
w(n)
F
2

F
(
z
) 2
2
1
even
W ( z )  F ( z )v( z )  1 z  
v( z )
2 
 Fodd ( z ) 
2
2

F
(
z
)
v
(
z
)
1
1  ( 2) Feven ( z )v( z ) 
even
W ( z )  1 z  
 1 z  

2
2 
 Fodd ( z )v( z ) 
 ( 2) Fodd ( z )v( z ) 
Feven
2
w(n)
v(n)
Fodd
2
z-1
• Synthesis bank: direct and polyphase
v0(n)
2
F0
xˆ (n)
v1(n)
2
F1
Polyphase matrix of synthesis filter bank:
Xˆ  F0 ( z )V0 ( z 2 )  F1 ( z )V1 ( z 2 ) 
2
2
2



F
(
z
)
F
(
z
)
V
(
z
)
1
00
10
0
1 z  
2
2 
2 
 F01 ( z ) F11 ( z )   V1 ( z ) 
  2 0    F00 ( z ) F10 ( z )   V0 ( z )  
 1 z  
 
  V ( z)  
F
(
z
)
F
(
z
)
11
 1 
 0  2    01
1

F
(
z
)
F
(
z
)

V
(
z
)



2
0




01
11
0
Xˆ   z
1 
 



 0  2    F00 ( z ) F10 ( z )   V1 ( z )  
 F00 ( z ) F10 ( z ) 
I
Fp  

F
(
z
)
F
(
z
)
11
 01

1
v0(n)
F0
2
xˆ (n)
v1(n)
v0(n)
v1(n)
2
F1
 F00
F
 01
F10 

F11 
2
2
z-1
xˆ (n)
H0
y0(n)
2
v0
2
u0(n)
F0
xˆ (n)
X(n)
H1
y1(n)
2
v1
u1(n)
2
F1
v0(n)
2
X(n)
2
Fp I
Hp
z-1
2
v1(n)
2
z
ˆ ( n)
x
-1
• Type 2 polyphase:
v0(n)
2
Fp-type 2
z-1
xˆ (n)
2
v1(n)
II
p
F
 F00 ( z ) F10 ( z ) 
Fp ( z )  

 F01 ( z ) F11 ( z ) 
 0 1  I  F01 ( z ) F11 ( z ) 
II
Fp  
 FP   F ( z ) F ( z ) 
1 0
10
 00

I
H0
y0(n)
2
v0
2
u0(n)
F0
xˆ (n)
X(n)
H1
y1(n)
2
v1
u1(n)
2
F1
2
X(n)
v0(n)
Hp
z-1
2
v0(n)
v1(n)
2
Fp-type 2
v1(n)
2
z-1
xˆ (n)
• Polyphase matrix
 H 0,even ( z )
Hp  
 H1,even ( z )
 F0,odd ( z )
II
Fp  
 F0,even ( z )
 F0,even ( z )
I
Fp  
 F0,odd ( z )
H 0,odd ( z ) 
H1,odd ( z ) 
F1,odd ( z ) 

F1,even ( z ) 
F1,even ( z ) 
F1,odd ( z ) 
• Perfect reconstruction
– Theorem 4.9:
• If Xˆ ( z )  X ( z ) z 2 L1
• Ex: QMF: F0(z)=H1(-z), and F1(z)=-H0(-z)
• banks give perfect reconstruction when Fp and Hp
are inverse:
– Fp(z)Hp(z)=I or z-LI
• Hp is of type 1, and Fp is type 2, transposed, for
synthesis
1 0  1  H 0 ( z ) H 0 ( z )  1 1 
H p (z ) 
 
 1 1
1 
H
(
z
)
H
(

z
)
0
z
2



 1
1

F1 ( z ) 
 0 1  II 2
1 1 1   F0 ( z )
 z 1 0  Fp ( z )  2 1 1  F ( z ) F ( z ) 



 0
1

2
 2zL

FM H M  
(L is odd)
L 
2( z ) 

L
1
0
1
1

2
z
 0 1  II 2




1
2
F
(
z
)
H
(
z
)
 

p
 z 1 0  p

1 


0 z  4 1 1 
 1 1 
z  L 1 1   1



1 1 1
2 1 1 
2
1
zL 
L 


z 

1
2 2



F (z )H p (z )  z
II
p
2
2
L
 0 z   1  1 0 
 L 1

z
I




1 0   1   0 z 
 1 1 

L  
2( z )  1 1
generally,
 2zL
FM H M  

if and only if


2( z )  L 
 L 1

z
(1

(

1)
)
1
II
2
2
L
Fp ( z ) H p ( z )  z 
L
2
(1

(

1)
)

If L is odd,
0 z 
Fp ( z ) H p ( z )  z
1 0 


det( FpII ( z ) H p ( z ))  ( z )  L 1
II
L/ 2
(1  ( 1)  L ) z 2 

z (1  (1)  L 1 ) 
• Lattice structure
– How to find a solution of above equation? To
find suitable analysis and synthesis bank?
– The simplest example:
 a1  b1 z 1 a2  b2 z 1 
Hp  
1
1 
a4  b4 z 
 a3  b3 z
– To ensure that Fp is also a FIR, det(Hp) must
be a monomial.
– Particularly,
 a  cz 1 b  dz 1 
Hp  
1
1 
b  dz 
 a  cz
• We can get Fp=inverse(Hp)
• In fact,
1 1  1
 a b 
H p ( z)  
  z 1   c d 
1

1




Such that
1
Hp
1
 1 1 
1  a b  1
( z)  





2  c d   z  1 1
• The condition of linear phase to require:
– a=d, and b=c
• Another case: a=d, and b=-c: Orthogonal
filter
1
Fp ( z ) 
det( H p )
H pT ( z 1 )
• when |z|=1, we can have Fp is a unitary
matrix, we call it paraunitary.
• In general, let
 cos sin  
1

R
and (z)= 

-1 
  sin  cos 
 z 
then the filter given by
H p ( z )  (1) Rl ( z ) Rl 1...R1( z ) R0
is a proper orthogonal filter.
X(n)
2
cos 0
sin  0
 sin  0
z-1
2
cos 0
z-1
• If H0=0 at z=-1, then the polyphase matrix has:
1 1 1 
H p (1) 
1 1
2

Proof:
a b 
Let H p (1)  
,

c d 
H 0 (1)  0  a  b
H1 (1)  0  c  d
H p is orthogonal  a 2  b 2  1& c 2  d 2  1
• Which means in orthogonal cases, the angels of the
lattices add to PI/4.
• Synthesis filter banks:
 cos  sin  
1

R
and  (z)= 
-1 

  sin  cos  
 z 
then the synthesis filter bank is given by
H p 1 ( z )  R0T  1 ( z ) R1T  1 ( z ) R2T ...Rl T ( 1)
• Theorem 4.7
– Every lowpass-highpass orthonormal filter bank
has a polyphase matrix of a lattice form as
above.
Proof:
H p ( z ) H Tp ( z 1 )  H Tp ( z 1 ) H p ( z )  I
N
Let H p ( z )   H k z  k
k 0
therefore
H 0T H N is the coefficient of z  N , so it must be 0.
a b 
e f 
Let H  
and H N  


c
d
g
h




In general, assume that a 2  b2  0 and e 2  g 2  0
T
0
a b
t t
2
2
2
2
Define R  
 where l = e  g , t  a  b
 e g 
l l
We can verify that R is a unitary matrix and
.
 * *
 0 0
RH 0  
and RH N  


0
0
*
*




that is
M 12 ( z ) 
 M 11 ( z )
RH p ( z )  
1
1 
M
(
z
)
z
M
(
z
)
z
22
 21

where the matrices are polynomial of z 1 with degree N  1
 M 11 ( z ) M 12 ( z ) 
T
Let H new ( z )  
,
then
H

R
H new
p

 M 21 ( z ) M 22 ( z ) 
Iteratively, we prove that H p ( z ) has the lattice decompostion
• Theorem 4.8:
– Every linear phase PR filter bank with equal
(even) length filters has a lattice factorization:
1 1 
H p ( z)  
S L  ( z ) S L 1 ( z )...S1 ( z ) S 0

1 1
where
 ai
1 0 
( z )  
and Si  
1 
0 z 
 bi
bi 
1
 ai 

ai 
 ki
ki 
1 
– We can collect all a’s together to be one
constant to reduce the computational complex.
• Theorem 4.9:
– An FIR analysis bank has an FIR synthesis
bank that gives PR if and only if the determinat
of Hp is a nonzero monomial.
• The lattice complexity is approximately half
of the polyphase complexity.
H p ( z )  ( 1) Rl ( z ) Rl 1...R1( z ) R0
 1
Rl  
  kl
X(n)
kl 
1

and  (z)= 
-1 

1
z


2
z-1
2
k
k
z-1
Orthogonal Filter banks
• Paraunitary matrices
– Definition 5.1, The matrix H(z) is paraunitary if
it is unitary for all |z|=1:
– HT(1/z)H(z)=I, for all |z|=1;
– The above formula is true for all z.
• Theorem 5.1,
– Det(H(z))=+z-L or -z-L
• Condition O in polyphase form:
– A filter bank is orthogonal when its polyphase matrix is
Paraunitary.
• Theorem 5.2:
– For an orthogonal filter bank the lowpass filter H must
satisfy Condition O:
Polypase form: |H even (e j ) |2 |H odd (e j ) |2  1
Modula form: |H( )|2 |H(   )|2  2
Coefficient form:  h(n)h(n-2k)= (k)
• Proof:
H ( z )  H even ( z 2 )  z 1H odd ( z 2 )
| H ( z ) |2 | H even ( z 2 ) |2  | H odd ( z 2 ) |2
 zH even ( z 2 ) H odd ( z 2 )  z 1H even ( z 2 ) H odd ( z 2 )
| H ( z ) |2  | H (  z ) |2  2(| H even ( z 2 ) |2  | H odd ( z 2 ) |2 )
P ( z ) | H ( z ) |2   pk z  k
pk   hn hn k
P is halfband, p2 k  0 except k  0, p0  1
• Theorem:
H m ( z ) H mT ( z 1 )  H mT ( z 1 ) H m ( z )  2 I
If and only if
H p ( z ) H Tp ( z 1 )  H Tp ( z 1 ) H p ( z )  I
Lemma: If |H( )| |H(   )|  2, and
2
2
L
H ( z )   hk z  k
k 0
then L is odd
Proof:
If L is even, assume that h0  0,
|H( )|2 
L
 k
c
e
 k  c2k  0(k  0)
k  L
 cL  0
cL  h0hL  0  hL  0
• Theorem 5.3, A symmetric orthogonal FIR
filter can only have two nonzero
coefficients.
• Proof:
H ( z ) is symmetric, then H ( z 1 )  z L H ( z )
H ( z )  H even ( z 2 )  z 1H odd ( z 2 )
H even ( z 2 )  zH odd ( z 2 )  z L H even ( z 2 )  z L1H odd ( z 2 )
If L is odd
zH odd ( z 2 )  z L H even ( z 2 ) | H odd ( z ) || H even ( z ) |
| H odd ( z ) || H even ( z ) | 1/ 2
• Let P(z)=|H(z)|2, we have P(z)+P(-z)=2,
that is to say, P(z) is a halfband filter:
– p(2m)=1 if m=0, and 0 otherwise.
– P(z) is real, symmetric, nonnegative, halfband
• Spectral Factorization
– Given P(z), how to find H?
– Can any nonnegative P(z) have such
factorization?
– How to factorize?
– The root of P(z) (polynomial),
• z, 1/z, con(z), 1/con(z), for z is complex
• z, z for z is real.
M
P( x)  P( N ) ( x  zi )( x  1/ zi )( x  zi )( x  1/ zi ) ( x  z j )
i 1
2
• For orthogonal factorization,
H ( z ) | P ( N ) |
1/ 2
M
 ( x  z )( x  z ) ( x  z )
i 1
i
i
j
• If all z’s are in unit circle, we call it
minimum phase spectral factor .
• We can choose F and H freely to be
biorthogonal filter bank. To ensure that H
and F are real, relatively conjugate, linear
phase needs symmetric about unit circle.
• Which one is better?(length=10)
1.5
1.5
1
1
0.5
0.5
0
0
50
100
150
200
250
300
350
400
0
0
Same?
50
100
150
200
250
300
350
400
• Maxflat
(Daubechies)
filters
2 p 1
P( ) 

p(n)e
 in
1 2 p
2 p 1
equals to | h( ) | |  h(n)ein |2
2
0
– Condition O: P=|H|2 is a normalized halfband
filter:
• p(0)=1, p(2)=….=p(2p-2)=0
– Condition Ap: H has a zero of order p at π:
H ( )  H ( )  ...  H ( p 1) ( )  0
•
2 p 1
n k
(

1)
n h(n)  0, for k  0,1,..., p  1

n 0
 1 e
H ( )  
 2
 i
p

 R( )

 1  cos 
P( ) has a factor 

2


p
• Lemma:
H ( )   hk e
 k
then
| H ( ) |2   ck (cos ) k
Proof:
| H ( ) |   hk e
2
 k
*  hk e
| H ( ) |2   d k cos( k )
k
  d k e  k
cos( k ) is a polynomial of cos( )
• Formulas for P: Daubechies method:
P( ) is a polynomial of cos( )
1  cos( )
set y 
, then P ( )  (1  y ) p R( y )
2
the orthogonal condition is :
(1  y ) p R( y )  y p R(1  y )  2
if the degree of R as a polynomail of y is less than p,
then according the theory of polynomial, the solution is
unique.
R( y )  (1  y )  p (2  y p R(1  y ))
(1  y )
p
 p  k  1 k
p
 
y

y
Q( y )

k
k 0 

p 1
•
 p  k  1 k
p
p
R( y )  (  
y

y
Q
(
y
))(2

y
R(1  y ))

k
k 0 

p 1
 p  k  1 k
p
=2 
y

y
Q( y )

k
k 0 

p 1
Since R( y ) is polynomial of degree p-1, we can say Q  0.
 p  k  1 k
R( y )=2 
y

k
k 0 

p 1
 p  k  1 k
p
P( y )  2(1  y )  
y

k
k 0 

p 1
– Unit factorization method:
1  y 1  y 2 p 1
1  12 p 1  (

)
2
2
2 p 1
 2 p  1 1  y k 1  y 2 p 1 k
 
) (
)
(
k  2
2
k 0 
 2 p  1 1  y k 1  y 2 p 1 k 2 p 1  2 p  1 1  y k 1  y 2 p 1 k
 
) (
)
 
) (
)
(
(
k  2
k  2
2
2
k 0 
k p 
1  y p p 1  2 p  1 1  y k 1  y p 1 k p 1  2 p  1 1  y l  p 1  y p 1l
(
) 
) (
)
 
) (
)
(
(
k  2
2
2
2
2
k 0 
l 0  l  p 
1  y p p 1  2 p  1 1  y k 1  y p 1 k 1  y p p 1  2 p  1 1  y l 1  y p 1l
(
) 
) (
)
(
) 
)(
)
(
(
k  2
2
2
2
2
2
k 0 
l 0  l  p 
p 1
1  y p p 1  2 p  1 1  y k 1  y p 1 k 1  y p p 1  2 p  1  1  y p 1l 1  y l
(
) 
) (
)
(
) 
)
(
)
(
(
k  2
2
2
2
2
2
k 0 
l 0  2 p  1  l 
1  y p p 1  2 p  1 1  y k 1  y p 1 k 1  y p p 1  2 p  1 1  y p 1l 1  y l
(
) 
) (
)
(
) 
)
(
)
(
(
k  2
l  2
2
2
2
2
k 0 
l 0 
1 y 1 y 
1 y
1 y 
)
) 1

 Q(
 Q(
2
2
 2 
 2 
1 y
1 y
Let t 
, then
1 t
2
2
t pQ (1  t )  (1  t ) p Q (t )  1
p
p
• Two formulas:
 2 p  1
p 1k k
p( y )  2(1  y )  
(1

y
)
y

k 
k 0 
p 1
 p  k  1 k
p
P( y )  2(1  y )  
y

k
k 0 

p 1
p
• Meyer’s method:
Let P( y ) be a polynomail of degree 2 p -1, satisfies:
has oder p zeros at y  1, and oder p at y  0 except P(0)  2.
then P( y )  cy p 1 (1  y ) p 1 , all such polynomials satisfies P(0)=2
must have P( y )  P(1  y )  2, since the codition at 0 and 1
decide the polynomial uniqely.
1  cos( )
y=
will give
2
P( )  c sin 2 p 1 

P( )  2  c  sin 2 p 1 d
0
where c is chosen for P( )  0.
• Transition band for maxflat filters
– Theorem 5.6, the maxflat filter has center slope
proportional to N .The transition rom 0.98 to
0.02 is over an interval of length 4/ N , where N
is the order of the filter.
Download