Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Wavelet transform and its applications in data analysis and signal and image processing
1. Wavelet Transform and its applications in
Data Analysis and Signal and Image
Processing
7th Semester Seminar
Electronics and Communications
Engineering Department
NIT Durgapur
2. Introduction to Wavelet Transform: For the last two decades a new
mathematical microscope has enabled scientists and engineers to view
into the details of transient and time-variant phenomenon as was hitherto
not possible using conventional tools. This invention goes by the name of
“wavelet transform” and has made revolutionary changes in the fields of
data analysis, signal processing and image processing. This allows one to
achieve time-frequency localisation and multi-scale resolution, by suitably
focussing and zooming around in the neighbourhood of one’s choice.
We are familiar with Fourier series and Fourier transform which maps a
time domain signal to frequency domain. Just as a prism breaks up white
light into its different constituents, the Fourier transform breaks up a time
dependent signal into its frequency components. Thus it can be called a
mathematical prism. The time information in the signal is distributed
throughout the frequency domain and is practically difficult to retrieve.
This is because the time information is stored in relative phases (i.e. the
angles between ars and brs) of the basis function. One faces difficulty using
Fourier transform while analysing signals which have transients or are
rapidly varying.
One possible way to overcome the shortcomings of Fourier analysis is to
have a basis set whose elements are localised in time. It will be even
better if the basis function is similar to the function itself. This thought is
employed in wavelet transform. A wavelet is a small wave which oscillates
and decays in the time domain. Unlike Fourier Transform which uses only
sine and cosine waves, wavelet transform can use a variety of wavelets
each fundamentally different from each other.
The wavelet basis set starts with two orthogonal functions: the scaling
function or the father wavelet (φ(t)) and the wavelet function or the
mother wavelet(ψ(t)). By scaling and translation of these two orthogonal
functions we obtain the complete basis set.
3. The father and the mother wavelet must satisfy the following conditions:
∞ ∞
∫ φ(t)dt=A ∫ ψ(t)dt=0
-∞ -∞
∞
∫ φ*(t)ψ(t)dt=0
-∞
Where A is an arbitrary constant.
The energy of these functions is finite i.e.
∞ ∞
2
∫ |ψ(t)| dt< ∞ ∫ |φ(t)| 2dt<∞
-∞ -∞
The scaling function captures the average behaviour of the data set
whereas the wavelets detect the differences. These are represented as
low pass or average coefficients and high pass or detail coefficients.
Daughter wavelets are produced by scaling the mother wavelet and are
orthogonal to the father wavelet, mother wavelet and all the successive
daughter wavelets. The mother captures the variation in a broader scale
whereas the daughters zoom in on these variations at finer and finer
scales. A given function can be expresses in terms of scaling and wavelet
functions as below
Some commonly used wavelet families are Harr, Daubechies, Symlets,
Gaussian, Mexican hat, Morlet, Meyer etc. This was a very brief
introduction to wavelet transform. Mathematical details have been
excluded. In the next section we shall discuss some applications of wavelet
transform. The simulations have been done using MATLAB using the
wavelet tool box.
4. A simple example:
In this example we have used a signal given by
f(t)=sin 2πt for 0<t≤4
sin 2πt+ sin 6πt for4<t≤7
sin 2πt + sin4πt for 7<t≤10
The signal plotted using MATLAB looks like this:
Plot of the given signal
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
0 1 2 3 4 5 6 7 8 9 10
Time t->
The Fourier power plot of the above signal is as shown below.
5
x 10 Fourier Transform
3
The Fourier plot only gives us the
frequencies present i.e. 1Hz, 2Hz and 2.5
3Hz but does not tell us when each of 2
the frequencies were introduced and
Power
1.5
how long have they been present. 1
One might assume that all the
0.5
frequencies were present at all times
0
simultaneously! 0 0.5 1 1.5 2 2.5 3
frequency in Hz
3.5 4 4.5 5
This is where wavelet transform comes to save the day. This is achieved by
computing wavelet transform and then plotting a scalogram. The 2-D
scalogram of the above signal can be given as shown next.
5. Scalogram
-3 -3
Percentage of energy for each wavelet coefficient x 10 x 10
127
120
113 6 6
106
99
5 5
92
85
78 4 4
Scales a
71
64
57 3 3
50
43
2 2
36
29
22 1
1
15
8
1
200 400 600 800 1000
Time (or Space) b
scale freq
27.0000 3.0093
41.0000 1.9817
83.0000 0.9789
From the scalogram we not only find the frequencies present as tabulated
above but we also can tell when each frequency was introduces and
withdrawn by consulting the x-axis.
The time is taken at an interval of 0.01 so any value on the time axis needs to be
multiplied by that factor .
6. De-noising data sets and signals:
De-noising is a very common and very important aspect of any
communication system. Let us consider the following MATLAB generated
example.
Noisy Signal
Original Signal 6
6
4
4
2
2
0
x(t)+n(t)->
x(t)->
0 -2
-2 -4
-6
-4
-8
0 1 2 3 4 5 6 7 8 9 10
-6
0 1 2 3 4 5 6 7 8 9 10 t->
t->
Fig 1a Fig 1b
Denoised Signal
6
Fig 1a shows the original signal and 1b 4
represents the signal which has been 2
affected by noise while passing through an
x`(t)->
0
augmented white Gaussian channel. Using -2
the db4 wavelet we have thrown out the -4
high frequency detail coefficients of fig 1b -6
0 1 2 3 4 5 6 7 8 9 10
and reconstructed the signal giving us the t->
clean noise free signal of fig 1c. Fig 1c
The general de-noising procedure comprises of the following steps:
1. Decompose: Choose a wavelet and a level N and compute the
wavelet decomposition of the signal at level N.
2. Threshold detail coefficients ( using soft thresholding)
3. Reconstruct the signal using the approximation coefficients and the
modified detail coefficients.
The same technique may be also applied to data sets. Data sets contain
many noise spikes caused due to the non-idealness of the measuring
system or due to external interference. Thus for any analysis these data
sets need to be cleaned. The cleaning of a time varying data set may be
illustrated using the Group Sunspot Number. The data set is for a time
7. period of about 4 centuries. The following graphs will illustrate the
example.
Variation of relative sunspot no with year
1
0.8
0.6
Relative sunspot number
0.4
0.2
0
-0.2
-0.4
1600 1650 1700 1750 1800 1850 1900 1950 2000
Year(AD)
Fig 2a: Group Sunspot Data
Noise free data
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
1600 1650 1700 1750 1800 1850 1900 1950 2000
Years in AD
Fig 2b:De-noised Group Sunspot data
This de-noised data set may be used to study this phenomenon and obtain its
physical properties. In both the above examples the de-noising was performed by
Discrete Wavelet Transform using Daubechies 4 wavelet. Other wavelets may also be
used depending on the application.
8. Original Image De-noising Images:
The same concept of de-noising of 1-D
signals and data sets may be extended to
two dimensional sets which are used to
represent images. The following diagrams
will show wavelets in action in the field of
image de-noising.
Noisy Image
De-noised Image
50
100
150
200
250
Fig3: Image de-noising using
20 40 60 80 100 120 140 160 180
wavelets.
The original image was subjected to gaussian noise and as it is visible the
noise granules have been removed in the de-noised image.
9. Signal and Data Compression:
The notion behind compression is based on the concept that a regular
signal component can be accurately approximated by the following signal
component by using the following components: approximation
coefficients at some desired level and some of the detail coefficients.
The steps used for compression are as follows:
1. Decompose the signal using a desired wavelet till level N.
2. Thresholding (Hard thresholding unlike de-noising).
3. Reconstruction.
The following simulation has been run with Wolf’s Sunspot Numbers to
exemplify the point.
Plot of W olf Sunspot number with time
250
200
Sunspot Number
150
100
50
0
1750 1800 1850 1900 1950
Year(AD)
Compressed data
250
200
150
100
50
0
1750 1800 1850 1900 1950
Year(AD)
percentage compression= perf0 = 85.1741
10. Image Compression:
Digital image have been an important source of information in modern
communication systems. But the problem with images is that unlike data
and speech they take up enormous amount of memory. In a recent study
it was found that over 90% of the total volume of traffic in the internet is
composed of images and image related data. With the advent of
multimedia computing, the demand of processing, storing and
transmitting images have gone up exponentially. A lot of emphasis has
been given by researchers on image compression.
Image compression can be of two types, lossless and lossy compression.
Lossless compression is required for medical data, legal records, satellite
images, military images and such sophisticated applications. Lossy
compression is rather simple to achieve and is used for applications like
video conference, fax or multimedia application etc. where a certain
degree of error is tolerable. Here we will discuss lossy compression.
The tools available for image compression are fast Fourier transform,
discrete cosine transform and wavelet transform. The JPEG-93 used the
DCT whereas JPEG-2000 uses the discrete wavelet transform.
Image compression is much like data/signal compression in two
dimensions. The basic concept is that in most images adjacent pixels are
strongly correlated and hence carry very little information. Thus the value
of one pixel can be estimated by its neighbour. This gives rise to
redundancy which can be reduced if the 2-D array of the image is
transformed into a format which keeps the difference in the pixel values.
As wavelet transforms are suitable to capture variations at different scales
hence they are suited for this purpose. This removes spatial redundancy.
Coding redundancy can be removed by using Huffman coding.
Thresholding and quantisation is used to remove phychovisual redundancy
as the human eye looks only for distinguishing features.
11. The following example shows the image and its compressed form achieved
using wavelet transform.
Compressed Image
50
100
150
200
250
20 40 60 80 100 120 140 160 180
Compression ratio in percentage
perf0 = 87.4040
Fig 4: Image Compression
Thus for the above image the size of the image is same as well as the
image is undistorted but the memory requirement has dropped to
87.404% of the original image using threshold of 20 and 5 levels of wavelet
decomposition.
The steps for image compression can be sequentially given by the
following flow diagram:
WAVELET TRANSFORM THRESHOLDING QUANTISATION ENCODING
STORAGE OR
TRANSMISSION
Fig5: Schematic for Image Compression using Wavelet Transform.
12. Compression performances: The compression performance can be
measured using the following parameter:
1. Compression ratio (CR) which means that the compressed image is
stored using CR% of the memory required for the original image.
2. The Bit-per-pixel ratio which gives the number of bits required to
store one pixel of the image.
The compressed image can be reconstructed using the reverse steps of
compression i.e. by un-coding un-quantisationinverse wavelet
transform.
Advantages of DWT over DCT:
1. Gibbs Phenomenon: As in DCT the thresholding is carried out in the
frequency domain hence the chopping of certain coefficients which are
local in nature manifests throughout the signal and produces great
distortion if thresholding produces large errors. But in DWT due to
time-frequency localisation errors due to thresholding are local in
nature and only affects a few points.
2. Time complexity: For DCT time complexity is of O (Nlog2N). For most
wavelets it is of O (N) while some require O(Nlog2N).
3. Blocking Artefacts: In DCT the entire image is broken up into 8X8 blocks.
Hence correlation between adjacent blocks is lost and its effect are
annoying at low bit rates. No such blocking is done in DWT and the
entire image is transformed.
4. Flexibility: For DWT compression we can choose from a large menu of
wavelets and even create and wavelet according to our needs. This
flexibility is curbed for DCT.
5. Compression Ratio: For JPEG-93 the compression ratio is 25:1 and for
DCT compression the best images deteriorates above 30:1. For wavelet
coders this ratio can go up to 100:1.
13. Other Applications of Wavelet Transform:
1. Pattern Recognition- Wavelets are widely used in the field of pattern
recognition (especially factal patterns) due to their ability to zoom on
finer patterns as well as view the entire global trend.
2. Edge recognition: Wavelets can be used to separate out the edge of
images and the greatest application of this property is in the field of
finger print recognition.
3. Scientific data analysis: Not only can wavelets de-noise and
compress data sets but it can also predict the time varying patterns
in a data set. It is greatly used now a day in scientific data analysis.
The applications of wavelet transform in the field of science and
engineering are many and many are rapidly evolving. These small waves
have ushered a tsunami of change in various fields.