Beruflich Dokumente
Kultur Dokumente
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0
1
2
1
2
0 0 0 0 0 0 0 0
0 0 0 0
1
2
1
2
0 0 0 0 0 0 0
. . . 0 0 0 0 0
1
2
1
2
0 0 0 0 0 0 . . .
0 0 0 0 0 0
1
2
1
2
0 0 0 0 0
0 0 0 0 0 0 0
1
2
1
2
0 0 0 0
.
.
.
.
.
.
.
.
.
1
2
x
n1
then
x
n
= y
n
+ z
n
and x
n1
= y
n
z
n
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
Perhaps we could invert the process if we used both lters. We
know that G is
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
G =
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0
1
2
1
2
0 0 0 0 0 0 0 0
0 0 0 0
1
2
1
2
0 0 0 0 0 0 0
. . . 0 0 0 0 0
1
2
1
2
0 0 0 0 0 0 . . .
0 0 0 0 0 0
1
2
1
2
0 0 0 0 0
0 0 0 0 0 0 0
1
2
1
2
0 0 0 0
.
.
.
.
.
.
.
.
.
H
G
x =
y
z
W
N
=
1
2
1
2
0 0 0 0 0 0
0 0
1
2
1
2
0 0 . . . 0 0
.
.
.
.
.
.
.
.
.
0 0 0 0 . . . 0 0
1
2
1
2
1
2
1
2
0 0 0 0 0 0
0 0
1
2
1
2
0 0 . . . 0 0
.
.
.
.
.
.
.
.
.
0 0 0 0 . . . 0 0
1
2
1
2
W
1
N
=
1 0 0
1 0 0
0 1 0
0 1 0
.
.
.
.
.
.
.
.
.
0 0 0
0 0 0
0 0 1
0 0 1
1 0 0
1 0 0
0 1 0
0 1 0
.
.
.
.
.
.
.
.
.
0 0 0
0 0 0
0 0 1
0 0 1
We have
W
T
N
=
1
2
W
1
N
.
If we multiply
W
N
by
We have:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
We have
W
T
N
=
1
2
W
1
N
.
If we multiply
W
N
by
We have:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
We have
W
T
N
=
1
2
W
1
N
.
If we multiply
W
N
by
We have:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
We have
W
T
N
=
1
2
W
1
N
.
If we multiply
W
N
by
We have:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
We have
W
T
N
=
1
2
W
1
N
.
If we multiply
W
N
by
We have:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
W
N
=
H
G
2
2
2
2
0 0 0 0
0 0
2
2
2
2
0 0
.
.
.
.
.
.
.
.
.
0 0 0 0 . . .
2
2
2
2
2
2
2
2
0 0 0 0
0 0
2
2
2
2
0 0
.
.
.
.
.
.
.
.
.
0 0 0 0 . . .
2
2
2
2
W
N
is called the Discrete Haar Wavelet Transform
The lter
h =
2
2
,
2
2
2
2
+
2
2
e
i
satises H() = 0, but
H(0) =
2
2
. We will still consider this to be a lowpass lter-
the
2
2
resulted when we made the transform orthogonal.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
W
N
is called the Discrete Haar Wavelet Transform
The lter
h =
2
2
,
2
2
2
2
+
2
2
e
i
satises H() = 0, but
H(0) =
2
2
. We will still consider this to be a lowpass lter-
the
2
2
resulted when we made the transform orthogonal.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
W
N
is called the Discrete Haar Wavelet Transform
The lter
h =
2
2
,
2
2
2
2
+
2
2
e
i
satises H() = 0, but
H(0) =
2
2
. We will still consider this to be a lowpass lter-
the
2
2
resulted when we made the transform orthogonal.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Putting Two Filters Together
Building the Haar Matrix
Putting Two Filters Together
W
N
is called the Discrete Haar Wavelet Transform
The lter
h =
2
2
,
2
2
2
2
+
2
2
e
i
satises H() = 0, but
H(0) =
2
2
. We will still consider this to be a lowpass lter-
the
2
2
resulted when we made the transform orthogonal.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
If V
0
is the space of piecewise constants with possible
breaks at Z, then the characteristic function (t ) =
[0,1)
(t )
and its translates form an orthonormal basis for V
0
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
If V
0
is the space of piecewise constants with possible
breaks at Z, then the characteristic function (t ) =
[0,1)
(t )
and its translates form an orthonormal basis for V
0
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
If V
0
is the space of piecewise constants with possible
breaks at Z, then the characteristic function (t ) =
[0,1)
(t )
and its translates form an orthonormal basis for V
0
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
If V
1
is the space of piecewise constants with possible
breakpoints at
1
2
Z, then V
0
V
1
, and the functions
2(2t k)
form an orthornormal basis for V
1
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
Note that
(t ) =
2
2
(2t ) +
2
2
(2t 1)
1 0 t <
1
2
1
1
2
t < 1
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
1 0 t <
1
2
1
1
2
t < 1
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
1 0 t <
1
2
1
1
2
t < 1
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
1 0 t <
1
2
1
1
2
t < 1
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Why the Word Wavelet?
Building the Haar Matrix
Why the Word Wavelet?
Note that (t ) V
1
and
(t ) = (t ) =
2
2
(2t )
2
2
(2t 1)
2
2
,
2
2
2
2
v
1
+ v
2
v
3
+ v
4
v
5
+ v
6
v
7
+ v
8
2
2
v
1
+ v
2
v
3
+ v
4
v
5
+ v
6
v
7
+ v
8
v
1
v
2
v
3
v
4
v
5
v
6
v
7
v
8
2
2
2
2
= Vh
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Implementing W
N
Coding the Haar Transform
Implementing W
N
In a similar way we see that
Gv = Vg
So all we need to do to compute W
n
v is to create V, multiply it
with h and g, and join to the two blocks together!
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Implementing W
N
Coding the Haar Transform
Implementing W
N
Here is some Mathematica code to do it:
DHWT[v_]:=Module[{V,lp,hp,y},
V=Partition[v,2,2];
lp=V.{1,1};
hp=V.{1,-1};
y=Join[lp,hp];
Return[Sqrt[2]
*
y/2];
];
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Implementing W
T
N
Coding the Haar Transform
Implementing W
T
N
H
T
G
T
H
T
G
T
H
T
G
T
H
T
G
T
2
2
1 0 0 0 1 0 0 0
1 0 0 0 1 0 0 0
0 1 0 0 0 1 0 0
0 1 0 0 0 1 0 0
0 0 1 0 0 0 1 0
0 0 1 0 0 0 1 0
0 0 0 1 0 0 0 1
0 0 0 1 0 0 0 1
v
1
v
2
v
3
v
4
v
5
v
6
v
7
v
8
2
2
v
1
v
5
v
1
+ v
5
v
2
v
6
v
2
+ v
6
v
3
v
7
v
3
+ v
7
v
4
v
8
v
4
+ v
8
Now V is
V =
v
1
v
5
v
2
v
6
v
3
v
7
v
4
v
8
Now V is
V =
v
1
v
5
v
2
v
6
v
3
v
7
v
4
v
8
Now V is
V =
v
1
v
5
v
2
v
6
v
3
v
7
v
4
v
8
Now V is
V =
v
1
v
5
v
2
v
6
v
3
v
7
v
4
v
8
How do we transform A?
If we compute W
N
A, we are simply applying the DHWT to
each column of A:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
How do we transform A?
If we compute W
N
A, we are simply applying the DHWT to
each column of A:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
How do we transform A?
If we compute W
N
A, we are simply applying the DHWT to
each column of A:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
How do we transform A?
If we compute W
N
A, we are simply applying the DHWT to
each column of A:
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
A W
N
A
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
Answer: Compute W
N
AW
T
N
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
Answer: Compute W
N
AW
T
N
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
Answer: Compute W
N
AW
T
N
.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
A W
N
AW
T
N
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
If we look at W
N
AW
T
N
in block format, we can get a better
idea whats going on.
W
N
AW
T
N
=
H
G
H
G
T
=
HA
GA
H
T
G
T
=
HAH
T
HAG
T
GAH
T
GAG
T
B V
H D
If we look at W
N
AW
T
N
in block format, we can get a better
idea whats going on.
W
N
AW
T
N
=
H
G
H
G
T
=
HA
GA
H
T
G
T
=
HAH
T
HAG
T
GAH
T
GAG
T
B V
H D
If we look at W
N
AW
T
N
in block format, we can get a better
idea whats going on.
W
N
AW
T
N
=
H
G
H
G
T
=
HA
GA
H
T
G
T
=
HAH
T
HAG
T
GAH
T
GAG
T
B V
H D
HAH
T
averages along the columns of A and then along the
rows of HA. This will produce an approximation (or blur) B
of A.
HAG
T
averages along the columns of A and then
differences along the rows of HA. This will produce vertical
differences V between B and A.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
HAH
T
averages along the columns of A and then along the
rows of HA. This will produce an approximation (or blur) B
of A.
HAG
T
averages along the columns of A and then
differences along the rows of HA. This will produce vertical
differences V between B and A.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
HAH
T
averages along the columns of A and then along the
rows of HA. This will produce an approximation (or blur) B
of A.
HAG
T
averages along the columns of A and then
differences along the rows of HA. This will produce vertical
differences V between B and A.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
GAH
T
differences along the columns of A and then
averages along the rows of GA. This will produce
horizontal differences H between B and A.
GAG
T
differences along the columns of A and then
differences along the rows of GA. This will produce
diagonal differences V between B and A.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
GAH
T
differences along the columns of A and then
averages along the rows of GA. This will produce
horizontal differences H between B and A.
GAG
T
differences along the columns of A and then
differences along the rows of GA. This will produce
diagonal differences V between B and A.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
GAH
T
differences along the columns of A and then
averages along the rows of GA. This will produce
horizontal differences H between B and A.
GAG
T
differences along the columns of A and then
differences along the rows of GA. This will produce
diagonal differences V between B and A.
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Building the 2D Transform
2D Haar Transform
Building the 2D Transform
To better understand these block forms, lets look at the
Mathematica notebook
HaarTransforms2D.nb
Wednesday, 7 June, 2006 Lecture 4
Discrete Haar Wavelet Transforms
Todays Schedule Building the Haar Matrix Coding the Haar Transform 2D Haar Transform Iterating In the Classroom
Coding the 2D Transform
2D Haar Transform
Coding the 2D Transform
I let the students work in pairs and they write code for the
Haar transform and its inverse (1D and 2D) as well as
iterated versions.
I let the students work in pairs and they write code for the
Haar transform and its inverse (1D and 2D) as well as
iterated versions.
I let the students work in pairs and they write code for the
Haar transform and its inverse (1D and 2D) as well as
iterated versions.
I let the students work in pairs and they write code for the
Haar transform and its inverse (1D and 2D) as well as
iterated versions.