wavelet transform and its applications in data analysis and signal and image processing

14
Wavelet Transform and its applications in Data Analysis and Signal and Image Processing 7th Semester Seminar Electronics and Communications Engineering Department NIT Durgapur

Upload: sourjya-dutta

Post on 03-Jul-2015

2.007 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Wavelet transform and its applications in data analysis and signal and image processing

Wavelet Transform and its applications in Data Analysis and Signal and Image Processing

7 t h S e m e s t e r S e m i n a r

E l e c t r o n i c s a n d C o m m u n i c a t i o n s

E n g i n e e r i n g D e p a r t m e n t

N I T D u r g a p u r

Page 2: Wavelet transform and its applications in data analysis and signal and image processing

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.

Page 3: Wavelet transform and its applications in data analysis and signal and image processing

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. ∞ ∞

∫ |ψ(t)|2dt< ∞ ∫ |φ(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.

Page 4: Wavelet transform and its applications in data analysis and signal and image processing

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

0.5

1

1.5

2

2.5

3x 10

5

frequency in Hz

Pow

er

Fourier Transform

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:

The Fourier power plot of the above signal is as shown below.

The Fourier plot only gives us the

frequencies present i.e. 1Hz, 2Hz and

3Hz but does not tell us when each of

the frequencies were introduced and

how long have they been present.

One might assume that all the

frequencies were present at all times

simultaneously!

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.

0 1 2 3 4 5 6 7 8 9 10-2

-1.5

-1

-0.5

0

0.5

1

1.5

2Plot of the given signal

Time t->

Page 5: Wavelet transform and its applications in data analysis and signal and image processing

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.

Scalogram

Percentage of energy for each wavelet coefficient

Time (or Space) b

Scale

s a

200 400 600 800 1000 1

8

15

22

29

36

43

50

57

64

71

78

85

92

99

106

113

120

127

1

2

3

4

5

6

x 10-3

1

2

3

4

5

6

x 10-3

Page 6: Wavelet transform and its applications in data analysis and signal and image processing

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.

Fig 1a Fig 1b

Fig 1a shows the original signal and 1b represents the signal which has been affected by noise while passing through an

augmented white Gaussian channel. Using the db4 wavelet we have thrown out the high frequency detail coefficients of fig 1b and reconstructed the signal giving us the 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

0 1 2 3 4 5 6 7 8 9 10-8

-6

-4

-2

0

2

4

6Noisy Signal

x(t)

+n(

t)->

t->

0 1 2 3 4 5 6 7 8 9 10-6

-4

-2

0

2

4

6Denoised Signal

x`(

t)->

t->

0 1 2 3 4 5 6 7 8 9 10-6

-4

-2

0

2

4

6Original Signal

x(t)

->

t->

Page 7: Wavelet transform and its applications in data analysis and signal and image processing

period of about 4 centuries. The following graphs will illustrate the example.

Fig 2a: Group Sunspot Data

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.

1600 1650 1700 1750 1800 1850 1900 1950 2000-0.4

-0.2

0

0.2

0.4

0.6

0.8

1Variation of relative sunspot no with year

Year(AD)

Relat

ive s

unsp

ot n

umbe

r

1600 1650 1700 1750 1800 1850 1900 1950 2000-0.4

-0.2

0

0.2

0.4

0.6

0.8

1Noise free data

Years in AD

Page 8: Wavelet transform and its applications in data analysis and signal and image processing

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.

Fig3: Image de-noising using 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.

Original Image

Noisy Image

De-noised Image

20 40 60 80 100 120 140 160 180

50

100

150

200

250

Page 9: Wavelet transform and its applications in data analysis and signal and image processing

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.

percentage compression= perf0 = 85.1741

1750 1800 1850 1900 19500

50

100

150

200

250Plot of Wolf Sunspot number with time

Year(AD)

Suns

pot N

umbe

r

1750 1800 1850 1900 19500

50

100

150

200

250Compressed data

Year(AD)

Page 10: Wavelet transform and its applications in data analysis and signal and image processing

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.

Page 11: Wavelet transform and its applications in data analysis and signal and image processing

The following example shows the image and its compressed form achieved

using wavelet transform.

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

STORAGE OR

TRANSMISSION

Fig5: Schematic for Image Compression using Wavelet Transform.

Compressed Image

20 40 60 80 100 120 140 160 180

50

100

150

200

250

THRESHOLDING QUANTISATION ENCODING

Page 12: Wavelet transform and its applications in data analysis and signal and image processing

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.

Page 13: Wavelet transform and its applications in data analysis and signal and image processing

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.

Page 14: Wavelet transform and its applications in data analysis and signal and image processing

Thanking you,

Sourjya Dutta

08/ECE/08