Wavelet basics
Hennie ter Morsche
1. Introduction 2. The continuous/discrete wavelet transform 3. Multi-resolution analysis 4. Scaling functions 5. The Fast Wavelet Transform 6. Examples
1. Introduction For a given univariate function f , the Fourier transform of f and the inverse are given by f() =
f (t)ei t dt.
1 f (t) = 2
f()ei t d. f (t) g(t) dt.
Parseval: ( f, g) = ( f, g)/2 , ( f, g) = e (t) = ei t , 0 () = ( 0 ) f(0) = ( f, e0 ) = ( f, 0 )
1 0.8
0.14
0.12 0.6 0.4 0.2 0 0.2 0.4 0.6 0.02 0.8 1 0 0 0 0.06 0.1
0.08
0.04
0.5
1.5
2 TIJD
2.5
3.5
HERTZ
10
15
Figure 1:
The frequency break and its amplitude-spectrum
The short time Fourier transform Given a Window function g g L 2 (IR), g = 1 g is real-valued. The short time Fourier transform F (u, ) of a function f is dened by F (u, ) = 1 f (t) = 2
f (t)ei ut g(t ) dt,
F (u, )ei ut g(t ) d du,
gu, (t) := ei ut g(t ), F (u, ) = ( f, gu, )
( f, gu, ) =
1 ( f , gu, ) ( Parseval). 2
gu, () = ei (u) g( u). Fixed window width in time and frequency.
2. The continous/discrete Wavelet transform The continuous Wavelet transform Given in L 2 (IR). Introduce a family of functions a,b (a > 0, b IR) as follows 1 a,b (t) = ((t b)/a) a a,b = . The continuous wavelet transform F (a, b) of a function f is dened by 1 F (a, b) = ( f, a,b ) = a ( f, a,b ) = where a,b () = i b ae (a),
(t IR),
f (t) ((t b)/a) dt.
1 ( f , a,b ) Parseval. 2
The inverse wavelet transform f (t) =
1 C 0
1 F (a, b) a,b (t) da db. a2
C =
0
|()|2 d.
Needed (0) = 0, i.e.,
(t) dt = 0.
This is the reason why the functions a,b are called wavelets. is called the Motherwavelet.
Example: The Mexican hat (Morlet wavelet) 2 1 2 (t) = 4 (1 t 2)et /2 . 3
0.2
0.8
0.15
0.6
0.1
0.4
0.05
0.2
0.05
0.2
0.1
0.4 5
0 TIJDas
0.15 2
1.5
0.5
0 Hertz
0.5
1.5
Figure 2: The Mexican hat
The wavelet transform of the frequency break using the Mexican hat
1 0.8
0.14
0.12 0.6 0.4 0.2 0 0.2 0.4 0.6 0.02 0.8 1 0 0 0 0.06 0.1
0.08
0.04
0.5
1.5
2 TIJD
2.5
3.5
HERTZ
10
15
Figure 3: frequency break
128
64
a schaal
32
16
2 100 200 300 400 500 600 700 800 900 1000
Figure 4: Grey value picture of the waveletcofcinten
Horizontal b-axis contains 1000 samples on interval [0, 1]. The vertical axis contains the a-values: 2, 4, . . . , 128.
The discrete wavelet transform Sampling in the a-b plane. a0 > 1, b0 > 0 a = a0 , b = k a0 b0, (k, Z ). Z The translation step is adapted to the scale k, (t) = a0 (a0 t k b0). Dyadic wavelets: a0 = 2, b0 = 1. k, (t) = 2
/2 /2
(2 t k).
( f, k, ) are called waveletcoefcients.
Discrete Wavelet transform: f ( f, k, ) a. Problem of reconstruction: f = k, ( f, k, )k, . b. Problem of decomposition: f =
k,
ak, k,
It would be nice if the functions k, constitute an orthonormal basis of L 2 (IR). (orthogonal wavelets)
For orthogonal wavelets the reconstruction formula and the decomposition formula coincide. A biorthogonal wavelets system consists of two sets of wavelets generated by a mother wavelet and a dual wavelet , for which (k, , m,n ) = k,m ,n , for all integer values k, , m en n. We assume that (k, ) constitute a so called Riesz basis (numerically stable) of L 2 (IR), i.e. A ( f, f )
k,
k,
B ( f, f )
k,
for positive constants A en B, where f = The reconstruction formula now reads f =
k,
k, k, .
( f, k, )k, .
Examples of biorthogonal wavelets are the bior family implemented in the MATLAB Toolbox
3. Multi-resolution analysis For a given function f , let
f = Then
( f, k, )k, ,
k=
f =
=
f.
f can be interpreted as that part of f which belongs to the scale . So, f = = f is a decomposition of f to different scale levels . The function f belongs to the scale space W spanned by (k, ) with xed . The space W0 is spanned by the integer translates of the mother wavelet . For integer n the function
n1
gn (t) =
=
f (t)
contains all the information of f up to scale level n 1. So gn Vn , where
n1
Vn =
=
W. (n Z ) direct sum. Z
It follows that Vn = Vn1 Wn1
10
Properties of the sequence (Vn ) a) Vn1 Vn b)
nZ Z
(n geheel),
Vn = L 2 (IR), Vn = {0},
nZ Z
c)
d) f (t) Vn f (2t) Vn+1 , e) f (t) V0 f (t + 1) V0 .
If a sequence of subspaces (Vn ) satises the properties a) to e), then it is called a Multi-Resolution-Analysis (MRA) of L 2 (IR). If there exists a function such that V0 is spanned by the integer translates of , then is called a scaling function for the MRA. As a consequence one has that Vn is spanned by k,n , (n xed), k,n = 2n/2 (2n t k)
11
4. Scaling functions Sufcient conditions for a compactly supported function to be a scaling function for an MRA. 1. There exists a sequence of numbers ( p k ), from which only a nite number differs from zero, such that
(t) =
k=
pk (2t k) 2-scale relation.
2. The so-called Riesz function has no zeros on the unit circle. Autocorrelation function of : ( ) := Riesz function
(t
+ ) (t) dt.
R(z) =
m=
(m) z m .
3. Partition of the unity (t k) 1.
k
The Laurent polynomial P(z) = scale symbol of .
1 2
pk z k is called the two
12
Examples B-splines of order m: P(z) = z+1 2
m
The Daubechies scaling function of order 2 1 P2 (z) = 2 1+ 3 3+ 3 3 3 2 1 3 3 + z+ z + z . 4 4 4 4
For an orthonormal system one has R(z) 1, |P(z)|2 + |P(z)|2 1 (|z| = 1)
13
Based on a given MRA with scaling function one may construct wavelets by rst completing the spaces V to a space V +1 by means of a space W , i.e.V +1 = V W in such a way that there exists a function such that W is spanned by ((2 t k)). To satisfy V1 = V0 W0 the following conditions are necessary and sufcient: 1. W0 V1 , 2. W0 V0 = {0}, 3. (2t) V0 W0 and (2t 1) V0 W0 . It follows that
(t) =
k=
qk (2t k),
(2t) =
k=
(ak (t k) + bk (t k)) (ck (t k) + dk (t k))
k=
(t IR), (t IR).
(2t 1) =
14
k By introducing the Laurent series A(z) = k ak z , B(z) = k k k k bk z , C(z) = k ck z and D(z) = k dk z and the symbol Q(z) = k qk z k for the wavelet , the application of the Fourier-transform to the previous equations and the 2-scale relation for the scaling function nally lead to the following set of equations, which must hold for complex z with |z| = 1.
A(z 2 ) P(z) + B(z 2) Q(z) = 1/2, A(z 2 ) P(z) + B(z 2) Q(z) = 1/2, C(z 2 ) P(z) + D(z 2 ) Q(z) = z/2, C(z 2 ) P(z) + D(z 2 ) Q(z) = z/2,
15
Now let (assuming the inverse exists) P(z) Q(z) P(z) Q(z) where H (z) =
k 1
H (z) H (z) G(z) G(z)
hk zk , gk z k .
k
G(z) = Then
A(z 2 ) = (H (z) + H (z))/2, B(z 2) = (G(z) + G(z))/2, C(z 2 ) = z (H (z) H (z))/2, D(z 2 ) = z (G(z) G(z))/2, .
16
We now have
(2tk) =
m=
h 2mk (tm)+g2mk (tm)
(t IR).
It can be shown that the symbol P(z) for the dual scaling and the symbol Q(z) for the dual wavelet will satisfy P(z) = H (z 1), Q(z) = Q(z 1 ). For orthogonal wavelets based on an orthogonal scaling function one may choose qk = (1)k p1k .
17
5. The Fast Wavelet Transform To obtain a wavelet decomposition of a function f in practice, one rst approximates f by a function from a space Vn , which is close to f . So let us assume that f itself belongs to Vn . So
f =
k=
ak,n k,n
n1 =
Since Vn =
n1
W , one has
f =
= k=
dk, k,
18
Vn = Vn1 Wn1 implies
f =
k=
ak,n k,n =
k=
ak,n1 k,n1 +
k=
dk,n1 k,n1 .
Due to
k,n =
m=
2 h 2mk m,n1 + 2 g2mk m,n1 .
we obtain
f =
k=
ak,n k,n =
k=
ak,n 2 (
(h 2mk m,n1 +g2mk m,n1 )).
m=
Our conclusion is
am,n1 =
k=
2 h 2mk ak,n , dm,n1 =
2 g2mk ak,n .
k=
convolution and subsequently downsampling (m 2 m) yields the two sequences a (n1) = (am,n1 ) en d (n1) = (dm,n1 ).
19
A repeated application of the previous operation leads to a decomposition of f to coarser levels, which can be expressed by the following scheme and ltering proces. a (n) @
@ R @
a (n1)@ d
a (n2) d (n2)
@ R @ (n1)
...
- (nN) a @ @ R @ (nN)
a (n1)
-
Lo_d
a (n)
-
d (n1)
-
Hi_d
Figure 5: Decomposition
Filter coefcients are 2 h k for the low pass lter and 2 gk for the high pass lter.
20
Reconstruction If a 1 and d 1 are given then we may reconstruct the approximation coefcients a . f = f
1
+w
=
k=
ak, k,
=
k=
ak,
1 k, 1
+
k=
dk,
1 k, 1
=
k= m=
ak, dk,
k= m=
1 2 2 1
pm 2k+m, qm 2k+m, .
+ Hence,
ak, k,
k=
1 ak, 2 k= m=
1 pm2k
+ dk,
1 qm2k
m, .
Conclusion: 1 = 2
ak,
(am,
m=
1 pk2m
+ dm,
1 qk2m ).
upsampling and subsequently convolution
21
a(
1)
Lo_r
? 6
a(
d(
1)
Hi_r
Figure 6: Reconstruction
22
6. Examples 1. Haar wavelet General characteristics: Orthogonal Support width 1 Filters length 2 Number of vanishing moments for : 1 Scaling function yes
1.5
0.5
0.5
1.5 0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Figure 7: Haar wavelet
23
2. Daubechies family General characteristics: Order N = 1, . . . Orthogonal Support width 2 N 1 Filters length 2 N Number of vanishing moments for N Scaling function yes
1.2
db4 : phi
1.5
db4 : psi
1 1 0.8
0.6
0.5
0.4 0
0.2
0 0.5 0.2
0.4
Figure 8:
Daubechies order 4
24
3. Coiet family General characteristics: Order N = 1, . . . , 5 Orthogonal Support width 6 N 1 Filters length 6 N Symmetry near from Number of vanishing moments for 2 N
1.2
coif4 : phi
1.5
coif4 : psi
1 1 0.8
0.6
0.5
0.4
0.2 0.5 0
0.2
10
15
20
25
10
15
20
25
Figure 9:
Coiet order 4
25
Meyer wavelet General characteristics: Orthogonal Compact support no Effective support [-8, 8] Symmetry yes Scaling function yes
1.2
Meyer scaling function
1.5
Meyer wavelet function
1 1 0.8
0.6
0.5
0.4 0
0.2
0 0.5 0.2
0.4 10
10
1 10
10
Figure 10:
Meyer
26