Professional Documents
Culture Documents
An Introduction To Wavelet Transform PDF
An Introduction To Wavelet Transform PDF
Pao-Yen Lin
E-mail: r97942117@ntu.edu.tw
Graduate Institute of Communication Engineering
National Taiwan University, Taipei, Taiwan, ROC
Abstract
Wavelet transforms have become one of the most important and powerful tool of
signal representation. Nowadays, it has been used in image processing, data
compression, and signal processing. This paper will introduce the basic concept for
Wavelet Transforms, the fast algorithm of Wavelet Transform, and some applications
of Wavelet Transform. The difference between conventional Fourier Transform and
modern time-frequency analysis will also be discussed.
Introduction
In conventional Fourier transform, we use sinusoids for basis functions. It can only
provide the frequency information. Temporal information is lost in this transformation
process. In some applications, we need to know the frequency and temporal
information at the same time, such as a musical score, we want to know not only the
notes (frequencies) we want to play but also when to play them. Unlike conventional
Fourier transform, wavelet transforms are based on small waves, called wavelets. It
can be shown that we can both have frequency and temporal information by this kind
of transform using wavelets. Moreover, images are basically matrices. For this reason,
image processing can be regarded as matrix processing. Due to the fact that human
vision is much more sensitive to small variations in color or brightness, that is, human
vision is more sensitive to low frequency signals. Therefore, high frequency
components in images can be compressed without distortion. Wavelet transform is
one of a best tool for us to determine where the low frequency area and high
frequency area is. These kinds of applications will be discussed later.
Background
When we look at some images, generally we see many regions (objects) that are
1
formed by similar texture. If the objects are small in size, we normally examine them
Fig. 1
at high resolutions. Contrary we examine big objects at low resolutions. This is the
fundamental motivation for multi-resolution processing.
2.1 Image pyramids
We start from a powerful, but conceptually structure for representing signal at more
than one resolution called image pyramid. It was first proposed in early 1980s. As
shown in Fig. 1, the base of the pyramid has the highest resolution however the apex
contains a low-resolution approximation. The image size and resolution both
decrease during moving up the pyramid. For a fully populated pyramid, we have J +1
resolution levels from 2J 2J to 20 20, but generally we truncate to P + 1 levels
from
Fig. 2
H 0 z G0 z H1 z G1 z 0
H 0 z G0 z H1 z G1 z 2
(1)
For finite impulse response (FIR) filters ignoring the delay, we can also find a relation
between the analysis and synthesis bandpass filter:
g0 n 1 h1 n
n
g1 n 1
n +1
h0 n
(2)
From Eq. 2, we can see that if the analysis FIR filters coefficients are known, we can
find their corresponding synthesis FIR filters uniquely.
Fig. 3
Time-Frequency atoms
When we listen to music, we clearly hear the time variation of the sound frequencies.
The properties of sounds are revealed by transforms that decompose signals over
elementary functions that are well concentrated in time and frequency. Windowed
Fourier transforms and wavelet transforms are two important classes of local
time-frequency decompositions. A linear time-frequency transform correlates the
signal with a family of waveforms that are well concentrated in time and in frequency.
These waveforms are called time-frequency atoms. Let us consider a family of
time-frequency atoms
= 1.
Tf
f t t dt
f ,
(3)
|| || | t |2 dt 1
2
(4)
we interpret ()
t | t |2 dt
(5)
= t | t |2 dt
2
t
(6)
By Plancherel formula
= 2
Fig. 4
1
=
2
d
2
(7)
1
2
2
d
2
(8)
1
2
(9)
g , t ei t g t
(10)
f L2 R is written by:
f t g t e
i t
dt
(11)
Fig. 5
Windowed Fourier transform is also called short time Fourier transform, because of
the multiplication of the window function localized the Fourier integral in a
neighborhood of = .
4.1
as a probability
distribution. Calculate its variance we can find the center point and spread in the
time-frequency plane. The time spread around is :
2
t
g , t dt
2
t g t
2
dt
(12)
1
2
2
g ,
1
d
2
g
2
(13)
g , g exp i
(14)
We can easily find that both time and frequency spread is independent of and .
It is shown in Fig. 5, which means that a windowed Fourier transform has the same
resolution across the time-frequency plane.
Wavelet Transform
t dt 0
(15)
,s t
1 t
s s
(16)
W f , s f , ,s
f t
1 t
dt
s s
(17)
(18)
1
f t
C
W f , s
0
1 t ds
du 2
s s s
(19)
define that
ds
(20)
lim C
2
(21)
Thus the scaling function can be interpreted as the impulse response of a low-pass
filter. And the low-frequency approximation of at scale can be written as
L f , s f , ,s
f t
1 t
dt
s s
(22)
1 0
ds
1
f t
W
f
.,
s
L f ., s0 ,s t
,s
C 0
s 2 C s0
(23)
5.1.3
Heisenberg boxes of wavelet atoms
To analyze the time evolution of frequency tones, it is necessary to use an analytic
wavelet to separate the phase and amplitude information of signals. A function is said
to be analytic if its Fourier transform is zero for negative frequency.
fa 0 for 0
(24)
f f a f a
2
(25)
2 f if 0
fa
if 0
0
(26)
, we
verify that
8
,s t dt s 2 t2
2
(27)
where 2 =
+ 2
center frequency of is
(28)
,s s s exp i
(29)
1
2
is
d 2
0 s ,s
s
2
(30)
with
1
2
2
2
d
2
(31)
along frequency.
This is shown by Fig. 6. We can see that the area of the box remains , but the
Fig. 6
Heisenberg boxes of two wavelets. Smaller scales decrease the
time spread but increase the frequency support and vice versa.
9
1
2
g t
e 2
2
(32)
t 2 t 2
2
t
e 2 1
2 3
(33)
which is
2
It is shown in Fig.7.
Morlet wavelet
The most commonly used CWT wavelet is the Morlet wavelet, it is defined as
following in time and frequency domains:
t 1 4eimt et
1 4U e m
(34)
2
(35)
10
Fig. 7
Fig. 8
Fig. 9
t sinc t 2 cos 3 t 2
1 0.5 f 1
0 otherwise
(36)
(37)
The Shannon wavelets in time and frequency domain are shown in Fig.9.
11
A simple example
We give one example of time-frequency analysis using continuous wavelet transform.
In this example we choose Morlet wavelet for the mother wavelet. For an input signal
f t , where
(38)
The resulting wavelet transform is shown in Fig. 10. We can see that the resolution in
high frequency is less than low frequency part.
5.2
W f , s N 1 2W f N , Ns
(39)
1
where
j ,k x 2 j 2 2 j x k
(40)
For all , and 2 . And we can also write the scaling function as
j ,k x 2 j 2 2 j x k
(41)
Fig. 10
12
Fig. 11
Fig. 12
Haar wavelet functions in W0 and W1
Generally, we will denote the subspace spnned over for any as
V j Span j ,k x
(42)
We can verify that the size of can be increased by increasing , allowing functions
with finer detail. There are four fundamental requirements of multiresolution analysis
that scaling function and wavelet function must follow:
1.
2.
V V1 V0 V1 V2 V
3.
(43)
V 0
(44)
13
Fig. 13
4.
Any function can be represented with arbitrary precision. As the level of the
expansion function approaches infinity, the expansion function space V contains
all the subspaces.
V L2 R
(45)
j ,k x n j 1,k x
(46)
x h n 2 2 x n
(47)
where the are called the scaling function coefficients and is referred to as
a scaling vector. On the other hand, for all we denote the subspace spanned by
discrete wavelet set as:
W j span j ,k x
(48)
And we define the discrete wavelet set , spans the difference between any two
adjacent scaling subspaces, and +1 . It is shown in Fig. 13 and related by
V j 1 V j W j
(49)
where denotes the union of spaces. We can thus express the space of 2 as:
L2 R V0 W0 W1
(50)
L2 R W2 W1 W0 W1 W2
(51)
which eliminates the scaling function and represents a function in terms of wavelets
14
alone. If a function
L2 R V j0 W j0 W j0 1
(52)
x h n 2 2 x n
(53)
where the are called the wavelet function coefficients and is the wavelet
vector. If the function being expanded is a sequence of numbers, like samples of a
continuous function , the resulting coefficients are called the discrete wavelet
transform (DWT) of . By applying the principle of series expansion, the DWT
coefficients of are defined as
W j0 , k
W j, k
1
M
f x x
1
M
f x x
(54)
j0 ,k
(55)
j ,k
f x
where
1
M
W j0 , k j0 ,k x
k
1
M
W j, k x
j j0 k
j ,k
(56)
x h n 2 2 x n
(57)
would get
2 j x k h n 2 2 2 j x k n
n
h m 2k 2 2
j 1
x m
(58)
and similarly
2 j x k h m 2k 2 2 j 1 x m
(59)
W j, k
1
M
f x2
j 2
2 j x k
(60)
W j , k
1
M
f x 2 h m 2k
j 2
2 2 j 1 x m
(61)
1
W j, k h m 2k
m
M
f x 2
x
j 1 2
2 2 j 1 x m (62)
W j, k h m - 2k W j 1, k
(63)
W j, k h m 2k W j 1, k
(64)
Fig. 14
16
Fig. 15
and ,
three
two-dimensional
wavelet
functions, H x, y ,
(65)
H x, y x y
(66)
V x, y x y
(67)
17
D x, y x y
(68)
For image processing, these functions measure the variation of intensity for the image
along different directions: H measures variations along columns, V measures
variations along rows, and D measures variations along diagonals. The scaling
function gives the approximation as same as the one-dimensional one. When the
scaling function and wavelet functions are given, extension of the one-dimensional
DWT to two-dimensions is straightforward. We first define the basis functions:
j , m, n x, y 2 j 2 2 j x m, 2 j y n
ij ,m,n x, y j 2 i 2 j x m, 2 j y n ,
(69)
i H ,V , D
(70)
where the index i defines the direction of the wavelet functions. The discrete
wavelet transform of function f x, y of size M N is
M 1 N 1
f x, y j0 ,m,n x, y
MN x 0 y 0
1 M 1 N 1
Wi j , m, n
f x, y ij ,m ,n x, y
MN x 0 y 0
W j0 , m, n
(71)
i H ,V , D
(72)
Wi j , m, n ij ,m,n x, y
MN i H ,V , D j j0 m n
(73)
Fig. 16
Fig. 17
Fig. 18
original image (matrix) can be decomposed into four subimages, which are W , WH ,
WV and WD . We can again divide the scale j 1 approximation coefficients into
four parts in smaller size. In other words, the j 1 approximation coefficients are
constructed by the scale j approximation and detail coefficients. By the same idea
in section 5.3, the two-dimensional IDWT reverse the processes described above. The
reconstruction algorithm is similar to the one-dimensional one. At each iteration, four
19
scale j approximation and detail coefficients are upsampled and convolved with
two one-dimensional filters, one is for the subimages rows and the other is for its
columns. Adding the results then we can obtain the j 1 approximation coefficients.
By repeating the process, we can ultimately reconstruct the original image (matrix).
Fig. 18 shows the synthesis filter bank of this operation.
Windowed Fourier Transform and Discrete Wavelet Transform to analyze it. The
window function g n here we use is Hanning window. It is defined as:
2 n
g n 0.5 1 cos
N 1
(74)
where N is the maximum length of the window. And the mother wavelet of Discrete
Wavelet Transform is Morlet wavelet. After these three kinds of transforms, we can
obtain their intensity in time-frequency plane. The results are shown in Fig. 20, Fig.
20
21 and Fig. 22. It can be found that in Wavelet Transform and Windowed Fourier
Transform we can obtain both frequency and time information, whereas in Fourier
Transform we only have the frequency information in a specific time. This is the
biggest difference between conventional Fourier Transform and modern
time-frequency analysis technique. From Fig. 20, we can find that the size of
Heisenberg box of Wavelet Transform is a function of frequency. When a
Fig. 19
Fig. 20
Fig. 21
21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
N 2 log2 N
DFT, N
4, the WFT is a transform with a window g t being its basis. Similarly, we need a
discretized window function g n for Discrete Windowed Fourier Transform
(DWFT). Then the DWFT for an N periodic signal is
N 1
i 2 nl
S f m, l f , g m,l f n g n m exp
N
n 0
(75)
operations.
Now, consider the one-dimensional DWT. Recall that the one-dimensional DWT can
be implemented by filter banks we saw in Fig. 14. If the input signal length is N
and the length of the filter is M . Totally, we need one time FFT for the input signal,
two times FFT for the two filters and two times FFT for the output signals. That is, we
need a total of O N log 2 N operations.
23
Conclusion
Reference
[1] R. C. Gonzalez and R. E. Woods, Digital Image Processing 2/E. Upper Saddle
River, NJ: Prentice-Hall, 2002, pp. 349-404.
[2] S. Mallat, Academic press - A Wavelet Tour of Signal Processing 2/E. San Diego,
Ca: Academic Press, 1999, pp. 2-121.
[3] J. J. Ding and N. C. Shen, Sectioned Convolution for Discrete Wavelet
Transform, June, 2008.
[4] Clecom Software Ltd., Continuous Wavelet Transform, available in
http://www.clecom.co.uk/science/autosignal/help/Continuous_Wavelet_Transfor
.htm.
[5] W. J. Phillips, Time-Scale Analysis, available in
http://www.engmath.dal.ca/courses/engm6610/notes/node4.html
24