introduction to wavelets - university of alabamafeihu.eng.ua.edu/wavelet_2.pdflist of topicslist of...

45
Introduction to Wavelets For sensor data processing

Upload: dinhquynh

Post on 25-Apr-2018

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Introduction toWavelets

For sensor data processing

Page 2: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

List of topicsList of topics

Why transform? Why wavelets?y Wavelets like basis components. Wavelets examples Wavelets examples. Fast wavelet transform . Wavelets like filter Wavelets like filter. Wavelets advantages.

Page 3: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Why transform?Why transform?

Page 4: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Image representationImage representation

Page 5: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Noise in FourierNoise in Fourierspectrum

Page 6: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Fourier AnalysisFourier Analysis Breaks down a signal into constituent Breaks down a signal into constituent

sinusoids of different frequencies

In other words: Transform the view of the i l f ti b t f bsignal from time-base to frequency-base.

Page 7: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

What’s wrong with Fourier?

By using Fourier Transform , we loose the time information : WHEN did a particular event take place ?

FT can not locate drift, trends, abrupt , , pchanges, beginning and ends of events, etc.

Calculating use complex numbers.

Page 8: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Ti d S d fi itiTime and Space definition

Time – for one dimension waves we start point shifting from source to endp gin time scale .

Space – for image point shifting is two Space for image point shifting is two dimensional .

Here they are synonyms Here they are synonyms .

Page 9: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

K k f tiKronneker function

tktt kk

,1

tktt kk ,0

Can exactly show the time of appearance but have notppinformation about frequency and shape of signal.

Page 10: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Short Time Fourier AnalysisShort Time Fourier Analysis In order to analyze small section of a In order to analyze small section of a

signal, Denis Gabor (1946), developed a technique based on the FT and usingtechnique, based on the FT and using windowing : STFT

Page 11: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

STFT (or: Gabor Transform)STFT (or: Gabor Transform) A compromise between time-based and p

frequency-based views of a signal. both time and frequency are both time and frequency are

represented in limited precision. The precision is determined by the size The precision is determined by the size

of the window.Once o choose a partic lar si e for Once you choose a particular size for the time window - it will be the same for all frequenciesall frequencies.

Page 12: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

What’s wrong with Gabor?

M i l i fl ibl Many signals require a more flexible approach - so we can vary the window i t d t i t l ithsize to determine more accurately either

time or frequency.

Page 13: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

What is Wavelet Analysis ?What is Wavelet Analysis ?

A d h t i l t ? And…what is a wavelet…?

A l t i f f ff ti l A wavelet is a waveform of effectively limited duration that has an average value fof zero.

Page 14: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

W l t' tiWavelet's properties

Short time localized waves with zero integral value.g

Possibility of time shifting Possibility of time shifting.

Flexibility.

Page 15: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

The Continuous WaveletThe Continuous WaveletTransform (CWT)

A th ti l t ti f th A mathematical representation of the Fourier transform:

dtetfwF iwt)()(

Meaning: the sum over all time of the i l f(t) lti li d b l

signal f(t) multiplied by a complex exponential, and the result is the Fourier

ffi i t F()coefficients F() .

s1

Page 16: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Slide 15

s1 student, 11/3/2003

Page 17: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Wavelet Transform (Cont’d)Wavelet Transform (Cont d) Those coefficients, when multiplied by a

i id f i t fsinusoid of appropriate frequency , yield the constituent sinusoidal

t f th i i l i lcomponent of the original signal:

Page 18: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Wavelet TransformWavelet Transform And the result of the CWT are Wavelet

coefficients . Multiplying each coefficient by the p y g y

appropriately scaled and shifted waveletyields the constituent wavelet of the yoriginal signal:

Page 19: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Scalingg Wavelet analysis produces a time-scale

view of the signal.g Scaling means stretching or

compressing of the signalcompressing of the signal. scale factor (a) for sine waves:

f t a

f t

t( ) sin( )

i ( )

; 1

2 1f t a

f t a

t( )

( )

sin( )

sin( )

;

;

2 12

4 1f t at( ) sin( ) ; 4 14

Page 20: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Scaling (Cont’d)

Scale factor works exactly the same with wavelets:

f t at( ) ( ) ; 1

f t at( ) ( ) ; 2 12

f t at( ) ( ) ; 2

4 144

Page 21: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

W l t f tiWavelet function b – shift

coefficientl

bxxba

1 a – scale

coefficient

axba a,

bybxbbayx

yxyx ,1 2D function aaabba yxyx ,, ,,

Page 22: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

CWTCWT Reminder: The CWT Is the sum over all

time of the signal, multiplied by scaled and shifted versions of the wavelet function

Step 1:Take a Wavelet and comparepit to a section at the start of the original signal

Page 23: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

CWTCWTStep 2:C l l b C hCalculate a number, C, that represents how closely correlated the wavelet is

i h hi i f h i l Thwith this section of the signal. The higher C is, the more the similarity.

Page 24: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

CWTCWT

St 3 Shift th l t t th i ht d Step 3: Shift the wavelet to the right and repeat steps 1-2 until you’ve covered th h l i lthe whole signal

Page 25: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

CWTSt 4 S l ( t t h) th l t d Step 4: Scale (stretch) the wavelet and repeat steps 1-3

Page 26: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Wavelets examplesWavelets examplesDyadic transform

For easier calculation we can discretize continuous signal.g

We have a grid of discrete values that called dyadic grid j

j

kba

22

values that called dyadic grid . Important that wavelet

functions compact (e g no

kb 2

functions compact (e.g. no overcalculatings) .

Page 27: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Haar transformHaar transform

Page 28: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Wavelet functions examples

Haar Haar function

Daubechies Daubechies function

Page 29: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Properties of Daubechies waveletsI. Daubechies, Comm. Pure Appl. Math. 41 (1988) 909.

Compact support Compact support finite number of filter parameters / fast

implementations p high compressibility fine scale amplitudes are very small in regions where

the function is smooth / sensitive recognition of structures

Identical forward / backward filter parameters Identical forward / backward filter parameters fast, exact reconstruction very asymmetricy y

Page 30: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Mallat* Filter Scheme

Mallat was the first to implement this scheme, using a well known filter design , g gcalled “two channel sub band coder”, yielding a ‘Fast Wavelet Transform’y g

Page 31: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Approximations and Details:

Approximations: High-scale, low-frequency components of the signalq y p g

Details: low-scale, high-frequency componentscomponents

LPF

Input SignalHPF

Page 32: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Decimation

The former process produces twice the data it began with: N input samples g p pproduce N approximations coefficients and N detail coefficients.

To correct this, we Down sample (or: Decimate) the filter output by two by simplyDecimate) the filter output by two, by simply throwing away every second coefficient.

Page 33: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Decimation (cont’d)

So a complete one stage block looks like:So, a complete one stage block looks like:

LPF A*

Input Signal HPF D*g

Page 34: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Multi-level Decomposition

Iterating the decomposition process, breaks the input signal into many lower-p g yresolution components: Wavelet decomposition tree:p

Page 35: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

O th litOrthogonality

For 2 vectors 0*, nnwvwvn

For 2 functions 0*, dttgtftgtfb

a

Page 36: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Why wavelets have orthogonalWhy wavelets have orthogonal base ? It easier calculation. When we decompose some image and When we decompose some image and

calculating zero level decomposition we have accurate valueshave accurate values .

Scalar multiplication with other base function equals zerofunction equals zero.

Page 37: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Wavelet reconstruction

Reconstruction (or synthesis) is the process in which we assemble all pcomponents back

Up samplingUp sampling(or interpolation) is done by zero yinserting between every two

ffi icoefficients

Page 38: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Wavelets like filtersWavelets like filtersRelationship of Filters to Wavelet e a o s p o e s o a e eShape

Ch i th t filt i t Choosing the correct filter is most important.

The choice of the filter determines the shape of the wavelet we use to perform the analysis.

Page 39: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Examplep A low-pass reconstruction filter (L’) for

the db2 wavelet:

The filter coefficients (obtained by Matlab dbaux command:0.3415 0.5915 0.1585 -0.0915reversing the order of this vector and multiply everyreversing the order of this vector and multiply every second coefficient by -1 we get the high-pass filter H’:-0.0915 -0.1585 0.5915 -0.3415

Page 40: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Example (Cont’d)Example (Cont d)

Now we up-sample the H’ coefficientNow we up sample the H coefficient vector:

-0 0915 0 -0 1585 0 0 5915 0 -0 3415 00.0915 0 0.1585 0 0.5915 0 0.3415 0 and Convolving the up-sampled vector

with the original low-pass filter we get:with the original low-pass filter we get:

Page 41: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Example (Cont’d)p ( )

Now iterate this process several more ti t dl li dtimes, repeatedly up-sampling and convolving the resultant vector

with the original low-pass filter, p ,a patternbegins tobegins to emerge:

Page 42: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Example: Conclusionp The curve begins to look more like the db2

wavelet: the wavelet shape is determined entirely by the coefficient Of the reconstruction filter

You can’t choose an arbitrary wavelet ywaveform if you want to be able to reconstruct the original signal accurately!g g y

Page 43: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Compression Example

A two dimensional (image) compression, using 2D wavelets p , ganalysis.

The image is a Fingerprint The image is a Fingerprint. FBI uses a wavelet technique to

compress its fingerprints databasecompress its fingerprints database.

Page 44: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Fingerprint compression

Wavelet:Wavelet: HaarLevel:3

Page 45: Introduction to Wavelets - University of Alabamafeihu.eng.ua.edu/wavelet_2.pdfList of topicsList of topics Why transform? Why wavelets? Wavelets like basis components. WaveletsexamplesWavelets

Results (1)

Original Image Compressed Image

Threshold: 3.5Zeros: 42%Zeros: 42%Retained energy:99.95%