Harr Wavelet Analysis
Harr Wavelet Analysis
geophones
seismic trace
Sesimic trace
Direct wave (along the surface)
Subsequent waves (rock layers below ground)
Fourier Transform (FT) is not a good tool
gives no direct information about when an
oscillation occurred.
Short-time FT : equal time interval, high-
frequency bursts occur are hard to detect.
Wavelets can keep track of time and
frequency information. They can be used to
zoom in on the short bursts, or to zoom
out to detect long, slow oscillations
frequency
frequency + time
4.2 Haar Wavelets
4.2.1 The Haar Scaling Function
Wavelet functions
Scaling function (father wavelet)
Wavelet (mother wavelet)
These two functions generate a family of functions
that can be used to break up or reconstruct a signal
The Haar Scaling Function
Translation
Dilation
Using Haar blocks to approximate a signal
Figure 2
Daubechies 4
Daubechies 8
4.2.2 Basic Properties of the Haar Scaling Function
The Haar Scaling function is defined as
1, if 0 x 1
(x)
0, elsewhere
a (x k) a
kZ
k k R
V0 consists of all piecewise constant functions whose
discontinuities are contained in the set of integers
V0 has compact support.
Figure 5
Figure 6
Typical element in V0
f ( x) 2 ( x) 3 ( x 1) 3 ( x 2) 2 ( x 3)
has discontinuities at x=0,1,3, and 4
Let V1 be the space of piecewise constant functions of
finite support with discontinuities at the half integers
ak ( 2 x k ) ak R
kZ
(2 x)
f ( x) 4 (2 x) 2 (2 x 1) 2 (2 x 2) (2 x 3) V1
has discontinuities at x=0,1/2,3/2, and 2
Suppose j is any nonnegative integer. The space of step
functions at level j, denoted by Vj , , is defined to be the
space spanned by the set
Proof :
If a function f belongs to Vj , then
f(x) is a linear combinations of { (2 j x k ), k Z }
Therefore, f(2 j x) is a linear combinations of { (2 j 2 j x k ), k Z },
which means that f(2 j x) is a member of Vo .
How to decompose a signal into its Vj-components
(2nd : V0 )
Any function f1 ak (2 x k ) V1 is orthogonal to V0
k
Vj W j Vj1 W j1 W j 2 Vj 2
...
W j1 W j 2 W0 2 V0
So each f in Vj can be decomposed uniquely as a sum
f w j 1 w j 2 w0 f 0
where each wl belongs to Wl , 0 l j 1 and f 0 belongs to V0
Intuitively, wl represents the " spikes" of f of width 1/2l 1
that cannot be represented as linear combinations of
spikes of other widths.
Theorem:
Example :
Suppose that spikes of width less than 0.01 represents noise
2-6 0.01 2-7 , any w j with j 6 represents noise, set these
commponents equal to zero to filter out this noise.
Implementation
Step 1 : Approximate the original signal f by a step
function of the form
f j(x) al ( 2 j x l )
lZ
j : small enough to capture the essential features of the signal.
l : range depends on the domain of the signal.
Sample the signal at x ...,-1,-1/2 j ,0,1/2 j ,..., which leads
to al f (l / 2 j ) for l Z .
Step 2
Decompose (2 j x l ) into its Wl components for l j.
(2x) ( ( x) (x))/2 (4.4)
(2x 1 ) ((x) (x))/2 (4.5)
x 2 j 1 x
The following relations holds for all x R :
(2 j x) ( (2 j 1 x) (2 j 1 x))/2 (4.6)
(2 j x 1 ) ((2 j 1 x) (2 j 1 x))/2 (4.7)
Example 4.11
a2 k a2 k 1 a a2 k 1
( )( 2 j 1 x k ) ( 2 k ) ( 2 j 1 x k )
kZ 2 2
w j 1 f j 1
Wj-1-component Vj-1-component
Theorem 4.12 (Haar Decomposition)
f j(x) akj ( 2 j x k ) Vj
kZ
f j 1 akj 1 ( 2 j 1 x k ) V j 1
kZ
a j
a j
a j
a j
with bkj 1 2 k 2 k 1
akj 1 2 k 2 k 1
2 2
f j w j 1 f j 1 w j 1 w j 2 f j 2 ... w j 1 w j 2 w0 f 0
Example 4.13
Figure 13, j 8, 0 x 1,
decompose f into W1 , W0 , V0 components.
ak8 f( k / 28 ),0 k 28 1
28 1
f 8 ( x ) f( k / 28 )( 28 k)
k 0
W7-component
4.3.2 Reconstruction
Having decomposed f into V0 and Wj' components for
0 j' j, then what ?
Noise filtering : The W j' - components corresponding to the
unwanted frequencies can be thrown out.
Data compression : The W j' - components that are small
can be thrown out, only keep larger bkj' .
bkj' have been modified, need a reconstruction algorithm
to rebuild f(x) alj ( 2 j x l )
lZ
Goal :
To rewrite f ( x ) l alj ( 2 j x l ) and
find a algorithm for the computation of constants alj
General reconstruction scheme
(x) ( 2 x) ( 2 x 1 ) (4.12)
(x) ( 2 x) ( 2 x 1 ) (4.13)
( 2 j 1 x) ( 2 j x) ( 2 j x 1 ) (4.14)
( 2 j 1 x) ( 2 j x) ( 2 j x 1 ) (4.15)
Using 4.12 with x replaced by x-k , we have
f 0 ( x) ak0 ( x k ) (ak0 (2 x 2k ) ak0 (2 x 2k 1))
kZ kZ
so f 0 ( x) al1 (2 x l ) (4.16)
kZ
ak0 if l 2k is even
where al1
k if l 2k 1 is odd
0
a
Similarly , w0 k ak0 ( x k ) can be written as
w0 ( x) bl1 (2 x l ) (4.17)
lZ
bk0 if l 2k is even
where bl1
bk if l 2k 1 is odd
0
f 0 ( x) w0 ( x) al1 (2 x l ) ( f1 ( x))
lZ
Suppose f f 0 w0 w j 1 with
f 0 ( x ) ak0 ( x k ) V0 and
kZ
Then f ( x ) alj ( 2 j x l ) V j
lZ
for 0 j ' 7.
After ordering the bkj by size,
set the smallest 80% equal to zero (80% compression),
then reconstruct the signal.
4.3.3 Filters and Diagrams
Decomposition algorithm
Discrete filters (convolution operators) H and L
a2jk a2jk 1 a2jk a2jk 1
via their impulse responses, bk
j 1
2
j 1
ak
2
n 1
which are the sequences h and : [ y * z ]k y j z k j
j 0
1 1 1 1
h ( 0 0 ), ( 0 0 )
2 2 2 2
k=-1,0
k=-1,0
downsampling
operator
Reconstruction
~ ~
Discrete filters (convolution operators) H and L
via their impulse responses, a j' 1
b j' 1
, if l 2k is even
~ ~ al j' 1
j' k k
j' 1
which are the sequences h and : a
k bk , if l 2k 1 is odd
~
h ( 0 1 - 1 0 ), ( 0 1 1 0 )
k=0,1 k=0,1
~ ~
For a sequence {x k }, we have (h x) k xk -xk-1 and ( x) k xk xk-1.
If x and y are sequences in which the odd entries are all 0, then
~ x 2k l 2k is even ~ y 2k l 2k is even
(h x)l ( y )l
- x 2k l 2k 1 is odd y 2k l 2k 1 is odd
~ ~
Adding the two sequences h x and y then gives us
~ ~ x2k y2k l 2k is even
(h x) l ( y )l
y2k -x2k l 2k 1 is odd
This is almost the pattern for the reconstructin formula given in
j ' 1 j ' 1
ak bk , if l 2k is even
Theorem 4.14. al j '1
j'
j ' 1
a
k bk , if l 2k 1 is odd
Although we have assumed that x2k 1 ' s and y2k 1 ' s are 0,
the x2k ' s and y2k ' s are ours to choose,
so we set x2k bkj 1 and y2k akj 1 ; that is,
x ( 0 b j-1
-1 0 b
0
j-1
0 b
1
j-1 j-1
0 b
2 0 ) and similarly for y.
The sequences x and y are called upsampling of the
sequences b j 1 and a j 1
We use U to denote the upsampling operator, so x Ub j 1 and y Ua j 1
~ ~
a j L Ua j 1 HUb j 1
upsampling
operator
Summary
Given signal y f(t),
Let and be the Haar scaling function and wavelet
Step1. Sample
continuous signal : choose top level j J and 2 J is larger than
the Nyquist rate.
Let akJ f (k / 2 J ) k : a finite interval determined by the duration
of the signal.
ex. 0 t 1, 0 k 2 J -1 (or 1 k 2 J )
discrete signal : skip this step.
highest - level approximation to f
f J (x) akJ (2 J x k)
kZ
Step 2 Decomposition
Decompose f J wJ 1 w j 1 w j w0 f 0 where
w j 1 bl j 1( 2 j 1 x l ) f j 1 alj 1 ( 2 j 1 x l )
lZ lZ
and reconstruct it as
f J akJ ( 2 J x k ).
kZ