what is wavelet? ( wavelet analysis) wavelets are functions that satisfy certain mathematical...

36
What is Wavelet? ( Wavelet What is Wavelet? ( Wavelet Analysis) Analysis) Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other functions Idea is not new--- Joseph Fourier--- 1800's Wavelet-- the scale we use to see data plays an important role FT non local -- very poor job on sharp spikes Sine wave Sine wave Wavelet Wavelet db10 db10

Upload: margaret-andrews

Post on 05-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

What is Wavelet? ( Wavelet Analysis)What is Wavelet? ( Wavelet Analysis) Wavelets are functions that satisfy certain mathematical

requirements and are used to represent data or other functions Idea is not new--- Joseph Fourier--- 1800's Wavelet-- the scale we use to see data plays an important role FT non local -- very poor job on sharp spikes

Sine waveSine wave

WaveletWavelet db10db10

Page 2: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

History of wavelets 1807 Joseph Fourier- theory of frequency analysis-- any 2pi functions f(x) is the sum of

its Fourier Series

1909 Alfred Haar-- PhD thesis-- defined Haar basis function---- it is compact support( vanish outside finite interval)

1930 Paul Levy-Physicist investigated Brownian motion ( random signal) and concluded Haar basis is better than FT

1930's Littlewood Paley, Stein ==> calculated the energy of the function 1960 Guido Weiss, Ronald Coifman-- studied simplest element of functions space called atom

1980 Grossman (physicist) Moorlet( Engineer)-- broadly defined wavelet in terms of quantum mechanics

1985 Stephen Mallat--defined wavelet for his Digital Signal Processing work for his Ph.D.

Y Meyer constructed first non trivial wavelet 1988 Ingrid Daubechies-- used Mallat work constructed set of wavelets The name emerged from the literature of geophysics, by a route through France. The The name emerged from the literature of geophysics, by a route through France. The

word word ondeonde led to led to ondeletteondelette.. Translation Translation wavewave led to led to waveletwavelet

Page 3: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

01

2

0

0

2

0

2

0

( ) ( cos sin )

where the coefficients are calculated by

1( )

2

1( )cos( )

1( )sin( )

k kk

k

k

f x a a kx b kx

a f x dx

a f x kx dx

b f x kx dx

22

0

Energy of a function ( )

1( )

2

f x

energy f x dx

Fourier Series and EnergyFourier Series and Energy

Page 4: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Functions (Science and Engg) often use time as their Functions (Science and Engg) often use time as their parameterparameter

g(t)-> represent g(t)-> represent time domaintime domain since typical function oscillate – think it as wave– so since typical function oscillate – think it as wave– so

G(f) where f= frequency of the wave, the function G(f) where f= frequency of the wave, the function represented in the represented in the frequency domainfrequency domain

A function g(t) is periodic, there exits a nonzero A function g(t) is periodic, there exits a nonzero constant P s.t. g(t+P)=g(t) for all t, where P is called constant P s.t. g(t+P)=g(t) for all t, where P is called periodperiod periodic function has 4 important attributesperiodic function has 4 important attributes

• Amplitude– max value it has in any periodAmplitude– max value it has in any period• Period---2PPeriod---2P• Frequency f=1/P(inverse)– cycles per second, HzFrequency f=1/P(inverse)– cycles per second, Hz• Phase—Cos is a Sin function with a phase Phase—Cos is a Sin function with a phase / 2

FunctionsFunctions

Page 5: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Fourier, HaarFourier, Haar Amplitude, time Amplitude, time amplitude , frequency amplitude , frequency 1965 Cooley and Tukey – Fast Fourier 1965 Cooley and Tukey – Fast Fourier

TransformTransform Haar Haar 1

1 0 x<2

1( ) 1 <x 1

20 otherwise

x

( ),

(2 ), (2 1),

(4 ), (4 1), (4 2), (4 3),

x

x x

x x x x

Page 6: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

continuous wavelet transform (CWT) of a continuous wavelet transform (CWT) of a function f(t) a mother wavelet function f(t) a mother wavelet mother wavelet may be real or complex with the mother wavelet may be real or complex with the

following propertiesfollowing properties• 1.the total area under the curve=0, 1.the total area under the curve=0, • 2. the total area of is finite 2. the total area of is finite • 3. Admissible condition3. Admissible condition

• oscillate above and below the t-axisoscillate above and below the t-axis• energy of the function is finiteenergy of the function is finite function is localize function is localize

Infinite number of functions satisfies above Infinite number of functions satisfies above conditions– some of them used for wavelet conditions– some of them used for wavelet transformtransform

exampleexample• Morlet waveletMorlet wavelet• Mexican hat waveletMexican hat wavelet

( )t

( ) 0t dt

2| ( ) |t 2| ( ) |t dt

CWTCWT

Page 7: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

once a wavelet has been chosen , the once a wavelet has been chosen , the CWT of a square integrable function f(t) is CWT of a square integrable function f(t) is defined as defined as

* * denotes complex denotes complex conjugateconjugate

For any For any aa, ,

Thus Thus bb is a translation parameter is a translation parameter

Setting Setting b=0b=0, ,

Here Here aa is a scaling parameter is a scaling parameter

a>1a>1 stretch the wavelet and stretch the wavelet and 0<a<10<a<1 shrink it shrink it

( )t

*1( , ) ( )

| |

t bW a b f t dt

aa

, ,0( ) is a copy of ( ) shifted b units along the time axisa b at t

,0

1( )

| |a

tt

aa

Page 8: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

WaveletsWaveletsWaveletsWavelets( ) ( ) jwtF f t e dt

Fourier TransformFourier Transform

CWT = C( scale, position)=CWT = C( scale, position)= ( ) ( scale, position, t) f t dt

1 2 3 4 5 6

1.5

2

2.5

3

Scaling wave means simply Stretching Scaling wave means simply Stretching (or Shrinking) it (or Shrinking) it

2.5 5 7.5 10 12.5 15 17.5

-1

-0.5

0.5

1

ShiftingShiftingf (t) f(t-k)f (t) f(t-k)

Page 9: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Wavelets ContinueWavelets ContinueWavelets ContinueWavelets Continue Wavelets are basis functions in continuous timeWavelets are basis functions in continuous time A basis is a set of linearly independent function that can be A basis is a set of linearly independent function that can be

used to produce a function used to produce a function f(t)f(t) f(t)f(t) = combination of basis function = = combination of basis function = is constructed from a single mother wave w(t) -- is constructed from a single mother wave w(t) --

normally it is a small wave-- it start at normally it is a small wave-- it start at 00 and ends at and ends at t=Nt=N Shrunken ( scaled) Shrunken ( scaled) shifted shifted A typical wavelet compressed j times and shifted k times A typical wavelet compressed j times and shifted k times

is is

Property:- Remarkable property is orthogonality i.e. their inner-Property:- Remarkable property is orthogonality i.e. their inner-products are zeroproducts are zero

This leads to a simple formula for bThis leads to a simple formula for bjkjk

( )jkw t

,

( )jk jkj k

b w t( )jkw t

0 (2 )jjw w t

0 ( ) ( )jw t w t k ( )jkw t

( ) (2 )jjkw t w t k

Page 10: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Haar TransformHaar Transform Digitized sound, image are discrete. Digitized sound, image are discrete. we need discrete we need discrete

waveletwavelet

where cwhere ckk and d and dj,kj,k are coefficients to be calculated are coefficients to be calculated example:- consider the array of 8 values example:- consider the array of 8 values

(1,2,3,4,5,6,7,8)(1,2,3,4,5,6,7,8) 4 average values4 average values 4 difference ( detail coefficients) 4 difference ( detail coefficients)

calculate average, and difference for 4 averagescalculate average, and difference for 4 averages continue this waycontinue this way Method is called PYRAMID DECOMPOSITIONMethod is called PYRAMID DECOMPOSITION

Haar transform depends on coeff ½, ½ and Haar transform depends on coeff ½, ½ and ½, - ½ ½, - ½

if we replace 2 by if we replace 2 by √2 then it is called √2 then it is called coarse detailcoarse detail and and fine fine detaildetail

,0

( ) ( ) (2 )jk k j k

k k j

f t c t k c d t k

Page 11: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

TransformsTransforms Transform of a signal is a new representation of that Transform of a signal is a new representation of that

signalsignal Example:- signal x0,x1,x2,x3 define y0,y1,y2,y3Example:- signal x0,x1,x2,x3 define y0,y1,y2,y3 QuestionsQuestions

1. 1. What is the purpose of y'sWhat is the purpose of y's 2. 2. Can we get back x'sCan we get back x's

Answer for 2: The Transform is invertible-- perfect Answer for 2: The Transform is invertible-- perfect reconstructionreconstruction

Divide Transform in to 3 groupsDivide Transform in to 3 groups 1. Lossless( Orthogonal)-- Transformed Signal has the same 1. Lossless( Orthogonal)-- Transformed Signal has the same

lengthlength 2. Invertible (bi-orthogonal)-- length and angle may change-- 2. Invertible (bi-orthogonal)-- length and angle may change--

no information lostno information lost 3. Lossy ( Not invertible)-- 3. Lossy ( Not invertible)--

Transform of a signal is a new representation of that Transform of a signal is a new representation of that signalsignal

Example:- signal x0,x1,x2,x3 define y0,y1,y2,y3Example:- signal x0,x1,x2,x3 define y0,y1,y2,y3 QuestionsQuestions

1. 1. What is the purpose of y'sWhat is the purpose of y's 2. 2. Can we get back x'sCan we get back x's

Answer for 2: The Transform is invertible-- perfect Answer for 2: The Transform is invertible-- perfect reconstructionreconstruction

Divide Transform in to 3 groupsDivide Transform in to 3 groups 1. Lossless( Orthogonal)-- Transformed Signal has the same 1. Lossless( Orthogonal)-- Transformed Signal has the same

lengthlength 2. Invertible (bi-orthogonal)-- length and angle may change-- 2. Invertible (bi-orthogonal)-- length and angle may change--

no information lostno information lost 3. Lossy ( Not invertible)-- 3. Lossy ( Not invertible)--

Page 12: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Answer to Q1: PurposeAnswer to Q1: Purpose IT SEES LARGE vs SMALLIT SEES LARGE vs SMALL

X0=1.2, X1= 1.0, x2=-1.0, x3=-1.2 Y=[2.2 0 -2.2 0] Key idea for wavelets is the concept of " SCALESCALE" We can take sum and difference again==> recursion

=> MultiresolutionMultiresolution Main idea of Wavelet analysis– analyze a function at Main idea of Wavelet analysis– analyze a function at

different scales– mother wavelet use to construct different scales– mother wavelet use to construct wavelet in different scale and translate each relative to wavelet in different scale and translate each relative to the function being analyzedthe function being analyzed

Z=[ 0 0 4.4 0 ] Reconstruct =====>compression 4:1

Page 13: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 14: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 15: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 16: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 17: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 18: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 19: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 20: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Real electricity consumptionReal electricity consumption peak in the center, followed by two drops, peak in the center, followed by two drops,

shallow drop, and then a considerably weaker shallow drop, and then a considerably weaker peakpeak

d1 d2 shows the noised1 d2 shows the noise d3– presents high value in the beginning and at d3– presents high value in the beginning and at

the end of the main peak, thus allowing us to the end of the main peak, thus allowing us to locate the corresponding peaklocate the corresponding peak

d4 shows 3 successive peak– this fits the d4 shows 3 successive peak– this fits the shape of the curve remarkablyshape of the curve remarkably

a1,a2 strong resemblancea1,a2 strong resemblance a3 reasonable---- a4 lost lots of informationa3 reasonable---- a4 lost lots of information

Page 21: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 22: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 23: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 24: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 25: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

JPEG (Joint Photographic Experts Group)JPEG (Joint Photographic Experts Group) 1. Color images ( RGB) change into luminance, chrominance, color 1. Color images ( RGB) change into luminance, chrominance, color

space space 2. color images are down sampled by creating low resolution pixels – 2. color images are down sampled by creating low resolution pixels –

not luminance part– horizontally and vertically, ( 2:1 or 2:1, 1:1)– 1/3 not luminance part– horizontally and vertically, ( 2:1 or 2:1, 1:1)– 1/3 +(2/3)*(1/4)= ½ size of original size+(2/3)*(1/4)= ½ size of original size

3. group 8x8 pixels called data sets– if not multiple of 8– bottom row 3. group 8x8 pixels called data sets– if not multiple of 8– bottom row and right col are duplicatedand right col are duplicated

4. apply DCT for each data set– 64 coefficients 4. apply DCT for each data set– 64 coefficients 5. each of 64 frequency components in a data unit is divided by a 5. each of 64 frequency components in a data unit is divided by a

separate number called quantization coefficients (QC) and then separate number called quantization coefficients (QC) and then rounded into integerrounded into integer

6. QC encode using RLE, Huffman encoding, Arithmetic Encoding 6. QC encode using RLE, Huffman encoding, Arithmetic Encoding ( QM coder)( QM coder)

7. Add Headers, parameters, and output the result7. Add Headers, parameters, and output the result• interchangeable format= compressed data + all tables need for interchangeable format= compressed data + all tables need for

decoderdecoder• abbreviated format= compressed data+ not tables ( few tables)abbreviated format= compressed data+ not tables ( few tables)• abbreviated format =just tables + no compressed data abbreviated format =just tables + no compressed data

DECODER DO THE REVERSE OF THE ABOVE STEPSDECODER DO THE REVERSE OF THE ABOVE STEPS

Page 26: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

JPEG 2000 or JPEG Y2kJPEG 2000 or JPEG Y2k divide into 3 colorsdivide into 3 colors each color is partitioned into rectangular, non-overlapping each color is partitioned into rectangular, non-overlapping

regions called tiles– that are compressed individuallyregions called tiles– that are compressed individually A tile is compressed into 4 main stepsA tile is compressed into 4 main steps

1. compute wavelet transform – sub band of wavelets– integer, fp,---L+1 1. compute wavelet transform – sub band of wavelets– integer, fp,---L+1 levels, L is the parameter determined by the encoder levels, L is the parameter determined by the encoder

2. wavelet coeff are quantized, -- depends on bit rate2. wavelet coeff are quantized, -- depends on bit rate 3. use arithmetic encoder for wavelet coefficients3. use arithmetic encoder for wavelet coefficients 4. construct bit stream– do certain region, no order4. construct bit stream– do certain region, no order

Bit streams are organized into layers, each layer contains Bit streams are organized into layers, each layer contains higher resolution image informationhigher resolution image information

thus decoding layer by layer is a natural way to achieve thus decoding layer by layer is a natural way to achieve progressive image transformation and decompressionprogressive image transformation and decompression

Page 27: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 28: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 29: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

H

V D

A

Page 30: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other
Page 31: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Lowpass Filter = Moving AverageLowpass Filter = Moving AverageLowpass Filter = Moving AverageLowpass Filter = Moving Average y(n)= x(n)/2 + x(n-1)/2 here h(0)=1/2 and h(1)=1/2y(n)= x(n)/2 + x(n-1)/2 here h(0)=1/2 and h(1)=1/2 Fits standard form for k=0,1 Fits standard form for k=0,1 x= unit impulsex= unit impulse x=( ...0 0 0 0 1 0 0 0...) then y=( ...0 0 1/2 1/2 0 0..)x=( ...0 0 0 0 1 0 0 0...) then y=( ...0 0 1/2 1/2 0 0..) average filter= 1/2 (identity) + 1/2 (delay)average filter= 1/2 (identity) + 1/2 (delay) Every linear operator acting on a single vector x can be rep by Every linear operator acting on a single vector x can be rep by

y=Hx y=Hx main diagonal come from identity--subdiagonal come from delaymain diagonal come from identity--subdiagonal come from delay we have finite ( two ) coefficients--> FIR we have finite ( two ) coefficients--> FIR finite impulse responsefinite impulse response low pass==> scaling functionlow pass==> scaling function It smooth out bumps in the signal(high freq componentIt smooth out bumps in the signal(high freq component

Page 32: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Highpass Filter Moving DifferenceHighpass Filter Moving DifferenceHighpass Filter Moving DifferenceHighpass Filter Moving Difference y(n)= 1/2[x(n)-x(n-1)]y(n)= 1/2[x(n)-x(n-1)] h(0)=1/2h(0)=1/2 h(1)=-1/2h(1)=-1/2 y=H1xy=H1x Filter Bank === Lowpass and HighpassFilter Bank === Lowpass and Highpass they separate the signal into frequency bank they separate the signal into frequency bank Problem:-- Signal length doubled, Problem:-- Signal length doubled, both are same size as signal ==> gives double size both are same size as signal ==> gives double size

of the original signalof the original signal Solution:-- Down SamplingSolution:-- Down Sampling

Page 33: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Down SamplingDown Sampling We can keep half of Ho and H1 and still recover xWe can keep half of Ho and H1 and still recover x Save only even-numbered components ( delete odd Save only even-numbered components ( delete odd

numbered elements) -- denoted by (numbered elements) -- denoted by (↓2)-- decimation↓2)-- decimation ((↓2)y = (... y(-4) y(-2)y(0)y(2).......)↓2)y = (... y(-4) y(-2)y(0)y(2).......) Filtering + Down samplingFiltering + Down sampling ==> Analysis Bank ( brings ==> Analysis Bank ( brings

half size signal)half size signal) Inverse of this process==> Inverse of this process==> Synthesis bankSynthesis bank i,e, i,e, Up sampling + FilteringUp sampling + Filtering Add even numbered components zeros ( It will bring Add even numbered components zeros ( It will bring

full size) denoted by (↑2)full size) denoted by (↑2) y = (y = (↓2 y)= (↓2 y)= (↑2)(↑2)(↓2 y)↓2 y)

Page 34: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Scaling function and WaveletsScaling function and Wavelets corresponding to low pass--> there is scaling function corresponding to low pass--> there is scaling function corresponding to high pass--> there is wavelet function corresponding to high pass--> there is wavelet function dilation equation--> scaling function dilation equation--> scaling function In terms of original low pass filtersIn terms of original low pass filters we have we have for h(0) and h(1) = 1/2 we have for h(0) and h(1) = 1/2 we have the graph compressed by 2 gives and shifted by the graph compressed by 2 gives and shifted by

1/2 gives 1/2 gives

By similar way the wavelet equation By similar way the wavelet equation

( )t( )t

0

( ) 2 ( ) (2 )N

k

t c k t k

0

( ) 2 ( ) (2 )N

k

t h k t k

( ) (2 ) (2 1)t t t

( )t (2 )t(2 1)t

( ) (2 ) (2 1)t t t

Page 35: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Wavelet PacketWavelet PacketWavelet PacketWavelet Packet Walsh-Hadamard transform-- complete binary tree --> wavelet

packet "Hadamard matrix"==> all entries are 1 and -1 and all rows are

orthogonalorthogonal-- divide two time by sqrt(2)==> orthogonal orthogonal & symmetricsymmetric Compare with wavelet-- computations

xx

sums y0 and y2sums y0 and y2

difference y1 and y3 difference y1 and y3

sums z0=0sums z0=0

sums z1=0.4sums z1=0.4

difference z2=4.4difference z2=4.4

difference z3=0difference z3=0

Page 36: What is Wavelet? ( Wavelet Analysis)   Wavelets are functions that satisfy certain mathematical requirements and are used to represent data or other

Filters and Filter BanksFilters and Filter Banks Filters and Filter BanksFilters and Filter Banks FilterFilter is a linear time-invariant operator It acts on input vector xx --- Out put vector yy is the convolution of

x with a fixed vector hh h--> contains filter coefficients-- our filters are digital not

analog-- h(n) are discrete time t= nT, T is sampling period assume it is 1 here x(n) and y(n) comes all the time t= 0, +_ 1.... y(n) = Σh(k) x(n-k) = convolution h* xh* x in the time domain

Filter BankFilter Bank= Set of all filters Convolution by hand--- arrange it as ordinary multiplication -- but don't carry

digits from one column to another

x= 3 2 4 h= 1 5 2 x * h = 3 17 20 24 8