Course 18.327 and 1.130 Wavelets and Filter Banks

advertisement
Course 18.327 and 1.130
Wavelets and Filter Banks
Refinement Equation: Iterative and
Recursive Solution Techniques;
Infinite Product Formula; Filter Bank
Approach for Computing Scaling
Functions and Wavelets
Solution of the Refinement Equation
N
φ(t)
= 2∑
φ
∑ h0[k] φ(2t-k)
φ
k=0
First, note that the solution to this equation may not
always exist! The existence of the solution will depend
on the discrete-time filter h0[k].
If the solution does exist, it is unlikely that φ
φ(t) will have
a closed form solution. The solution is also unlikely to
be smooth. We will see, however, that if h0[n] is FIR with
h0[n] = 0 outside 0 ≤ n ≤ N
then φ(t)
has compact support:
φ
φ(t)
= 0 outside 0 < t < N
φ
2
1
φ(t)
Approach 1 Iterate the box function
φ(0)(t)
= box function on [0 , 1]
0
N
1
t
φ(i + I) (t) = 2∑
∑ h0[k] φ(i) (2t – k)
k=0
If the iteration converges, the solution will be given
by
lim
φ(i)(t)
i→
→∞
This is known as the cascade algorithm.
3
Example: suppose h0[k] = {¼, ½, ¼}
φ (i+1) (t) = ½ φ(i)(2t) + φ(i) (2t – 1) + ½ φ(i) (2t – 2)
Then
φ(0)(t)
φ(0)(t)
1
1
1
2
0
1
2
φ(2)(t)
t
0
φ(3)(t)
1
½
1
2
1
3
2
2
3
1 2
2
t
1
0
1
2
1
3
2
2
t
0
1
2
Converges to the hat function on [0, 2]
t
4
2
Approach 2 Use recursion
First solve for the values of φ
φ(t) at integer values of t.
φ at half integer values, then at quarter
Then solve for φ(t)
integer values and so on.
This gives us a set of discrete values of the scaling
function at all dyadic points t = n/2i.
At integer points:
N
φ(n) = 2 ∑ h0[k] φ (2n – k)
φ
k=0
5
Suppose N = 3
3
φ(0) = 2 ∑ h0[k] φ(-k)
k=0
3
φ(1) = 2 ∑ h0[k] φ(2-k)
k=0
3
φ(2) = 2 ∑ h0[k] φ(4-k)
k=0
3
φ(3) = 2 ∑ h0[k] φ(6-k)
k=0
Using the fact that φ(n) = 0 for n < 0 and n > N, we
can write this in matrix form as
φ(0)
h0[0]
φ(0)
h0[2] h0[1] h0[0]
φ(1)
φ(1)
= 2
h0[3] h0[2] h0[1]
φ(2)
φ(2)
h0[3]
φ(3)
φ(3)
6
3
Notice that this is an eigenvalue problem
λΦ = AΦ
Φ
where the eigenvector is the vector of scaling function values at integer points and the eigenvalue is λ = 1.
Note about normalization:
Since (A - λI)
λ Φ = 0 has a non-unique solution,
we must choose an appropriate normalization for Φ
Φ
The correct normalization is
∑ φ(n)
= 1
φ
n
This comes from the fact that we need to satisfy the
partition of unity condition, ∑ φ(x-n)
= 1.
φ
n
7
At half integer points:
N
φ (n/2) = 2 ∑ h0[k] φ (n-k)
k=0
So, for N = 3, we have
φ(1/2)
φ(3/2)
φ(5/2)
=
h0[1] h0[0]
2 h0[3] h0[2] h0[1] h0[0]
h0[3] h0[2]
φ(0)
φ(1)
φ(2)
φ(3)
8
4
Scaling Relation and Wavelet Equation
in Frequency Domain
φ(t) = 2 ∑ h0[k] φ(2t
– k)
φ
φ
k
∞
∫
∞
Ω dt
φ(t)e-iΩt
φ
= 2 ∑ h0[k]
k
−∞
Ω dt
– k) e-iΩt
φ
∫ φ(2t
−∞ ∞
= 2 ∑ h0[k] ½
k
Ω τ + k)/2 dτ
φ τ –iΩ(τ
τ
∫− ∞φ(τ)e
Ω
= 2 ∑ h0[k]e-iΩk/2
∞
φτ e
∫− ∞ φ(τ)
k
- iΩτ/2
Ωτ dτ
τ
9
^
i.e. φ(Ω)
φ Ω = H0(Ω2 ) .
^( Ω )
φ 2
= H0(Ω2 ) . H0 (Ω4 ) . ^
φ (Ω4)
^
φ(0)
=
φ
Π
j=1
Ω
678
123
∞
=
M
H0( 2j )
^
φ (0)
∞
∫
φ(t)
φ dt = 1 (Area is normalized to 1)
−∞
10
5
So
∞
^
φ(Ω)
φ Ω = Π H0 (Ωj )
Infinite Product Formula
2
j=1
Similarly
w(t) = 2 ∑ h1[k] φ(2t
– k)
φ
k
leads to
^ Ω = H ( Ω ) ^φ
w(Ω)
1 2
( Ω2 )
Desirable properties for H0(ω):
ω
• H(0) = 1, so that ^
φ(0) = 0
φ
• H(ω)
ω should decay to zero as ω → π ,
∞
so that
^Ω dΩ<∞
φ
∫ φ(Ω)
−∞
2
11
Computation of the Scaling Function and
Wavelet – Filter Bank Approach
y0[n] ↑2
H0(ω
ω) ⊕yY [n]
(ω
ω) ↑2
x0[n] ↑2
H1(ω
ω)
1
1
↑2
x1[n]
H0(ω
ω) ⊕yY [n]
(ω
ω) ↑2
2
2
H0(ω
ω)
⊕
y3[n]
Y3(ω
ω)
H1(ω
ω)
↑2
x2[n]
H1(ω
ω)
Normalize so that ∑ h0[n] = 1.
n
12
6
i. Suppose y0[n] = δ[n]
and xk[n] = 0.
δ
Y0(ω)
ω = 1
Y1(ω)
ω = Y0(2ω)
ω H0(ω)
ω = H0(ω)
ω
Y2(ω)
ω = Y1(2ω)
ω H0(ω)
ω = H0(2ω)H
ω 0(ω)
ω
Y3(ω)
ω = Y2(2ω)
ω H0(ω)
ω = H0(4ω)
ω H0(2ω)
ω H0(ω)
ω
After K iterations:
K-1
YK(ω)
ω = Π H0(2kω)
ω
k=0
What happens to the sampling period?
Sampling period at input = T0 = 1 (say)
Sampling period at output = TK = ½K
13
Treat the output as samples of a continuous time
signal, yc (t), with sampling period ½K:
K
yK[n] =
1 c
y (n/2K)
2K K
^
⇒YK(ω)
ω = YcK (2Kω)
ω
; -π
π ≤ ω ≤ π
(yKc (t) is chosen to be bandlimited)
Replace 2Kω with Ω:
Ω
K-1
K
^
YcK(Ω)
Ω/2j ) ;
Ω = YK(Ω
Π H0(Ω/2
Ω K-k ) = Π H0( Ω
Ω/2k ) = k=0
j=1
-2Kπ ≤ Ω ≤ 2Kπ
So
∞
^
^
lim YKc(Ω)
φ(Ω)
Ω = Π H0( Ω/2
Ω
Ω j) = φ
k→∞
→∞
j=1
14
7
⇒
⇒ 2K yK[n] converges to the samples of the scaling
function, φ
φ(t), taken at t = n/2K.
ii. Suppose y0[n] = 0, x0[n] = δ[n]
δ
and all other xk[n] = 0
K-2
YK(ω)
ω = H1(2K-1ω)
ω Π H0(2kω)
ω
k=0
Then
K-2
^c
YK(Ω)
Ω = YK(Ω/2
Ω K) = H1( Ω2 ) Π H0(Ω/2
Ω K-k)
k=0
K-1
)
= H1( Ω2 ) Π H0( 12 . Ω
2j
So
j=1
^
^Ω
lim YKc(Ω)
= w(Ω)
Ω = H1(Ω/2)
Ω φ^ (Ω/2)
Ω
K→∞
→∞
⇒ 2KyK[n] converges to the samples of the wavelet,
w(t), taken at t = n/2K.
15
Support of the Scaling Function
yk-1[n]
↑2
↑
v[n]
h0[n]
yk[n]
length {v[n]} = 2 • length {yk-1[n]} - 1
Suppose that
h0[n] = 0 for n < 0 and n > N
⇒length {yk[n]} = length {v[n]} + length {h0[n]} – 1
= 2 • length {yK-1[n]} + N – 1
Solve the recursion with length {y0[n]} = 1
So
length {yk[n]} = (2K –1)N + 1
16
8
i.e. length {yKc(t)} = TK . length {yK[n]}
=
(2K – 1) N + 1
2K
= N-
φ(t)
N-1
2K
lim K → ∞
length {φ(t)}
= N
φ
0
N
t
So the scaling function is supported on the interval [0, N]
17
18
9
Matlab Example 6
Generation of orthogonal scaling
functions and wavelets
MATLAB M-file
MATLAB M-file
By Inverse DWT
20
10
By Recursion
21
Comparison
22
11
Matlab Example 7
Generation of biorthogonal scaling
functions and wavelets.
MATLAB M-file
Primary Daub 9/7 Pair
24
12
Dual Daub 9/7 Pair
25
13
Download