Wavelet Transform

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

Motivation

Some signals obviously have spectral


characteristics that vary with time
Criticism of Fourier Spectrum
It’s giving you the spectrum of the
‘whole time-series’

Which is OK if the time-series is stationary


But what if its not?

We need a technique that can “march along” a


timeseries and that is capable of:

Analyzing spectral content in different places


Detecting sharp changes in spectral character
Comparison
• Resolution
• Complexity
Given function f (t )

 sin ( 2 100t ) 0  t<0.5



f ( t ) = sin ( 2 200t ) 0.5  t<1
sin ( 2 400t ) 1  t<1.5

5
Comparison of resolution
• Fourier Transform

Fig. 17 the result using Fourier Transform

6
Comparison of resolution
• Windowed Fourier Transform

Fig. 18 the result using Windowed Fourier Transform

7
Comparison of resolution
• Discrete Wavelet Transform

Fig. 19 the result using Discrete Wavelet Transform

8
Fourier Analysis is based on an indefinitely long
cosine wave of a specific frequency

time, t
Wavelet Analysis is based on an short duration
wavelet of a specific center frequency

time, t
STFT - revisited
• Time - Frequency localization depends on window size.
• Wide window → good frequency localization, poor time localization.

• Narrow window → good time localization, poor frequency localization.


Wavelet Transform

• Uses a variable length window, e.g.:


• Narrower windows are more appropriate at high
frequencies
• Wider windows are more appropriate at low frequencies
What is a wavelet?
• A function that “waves” above and below the x-axis
with the following properties:
• Varying frequency
• Limited duration
• Zero average value
• This is in contrast to sinusoids, used by FT, which
have infinite duration and constant frequency.
Sinusoid Wavelet
Wavelet Transform

Inverse Wavelet Transform

All wavelet derived from mother wavelet


Inverse Wavelet Transform

time-series wavelet with


scale, s and time, t

coefficients
of wavelets

build up a time-series as sum of wavelets of different


scales, s, and positions, t
Wavelet Transform I’m going to
ignore the
complex
time-series
conjugate
from now
on, assuming
that we’re
using real
wavelets

coefficient of wavelet
complex conjugate of
with
wavelet with
scale, s and time, t
scale, s and time, t
Wavelet

normalization
shift in time

change in scale:
big s means long
wavelength
wavelet with
scale, s and time, t

Mother wavelet
Continuous Wavelet Transform (CWT)

translation parameter scale parameter scale =1/2j


(measure of time) (measure of frequency) (1/frequency)

1  t −t 
f ( t ) 
Forward
C (t , s) = 

 dt
CWT: s t  s 

mother wavelet (i.e.,


normalization window function)
constant
Illustrating CWT
1. Take a wavelet and compare it to a section at the start of the original signal.
2. Calculate a number, C, that represents how closely correlated the wavelet is
with this section of the signal. The higher C is, the more the similarity.

1  t −t 
C (t , s) =  f ( t )    dt
s t  s 
Illustrating CWT (cont’d)

3. Shift the wavelet to the right and repeat step 2 until you've
covered the whole signal.

1  t −t 
C (t , s) =  f ( t )    dt
s t  s 
Illustrating CWT (cont’d)

4. Scale the wavelet and go to step 1.

1  t −t 
C (t , s) =  f ( t )

  dt
s t  s 

5. Repeat steps 1 through 4 for all scales.


Visualize CTW Transform
• Wavelet analysis produces a time-scale view of the input signal or image.

1  t −t 
C (t , s) =  f ( t )

  dt
s t  s 
Shannon Wavelet

Y(t) = 2 sinc(2t) – sinc(t)

mother wavelet

t=5, s=2

time
Fourier spectrum of Shannon Wavelet

frequency, w

Spectrum of higher scale wavelets


Thus determining the wavelet coefficients at a
fixed scale, s

can be thought of as a filtering operation

g(s,t) =  f(t) Y[(t-t)/s] dt

= f(t) * Y(-t/s)

where the filter Y(-t/s) is has a band-limited


spectrum, so the filtering operation is a bandpass
filter
not any function, Y(t) will work
as a wavelet

admissibility condition:

Implies that Y(w)→0


both as w→0 and w→,
so Y(w) must be band-
limited
a desirable property is g(s,t)→0 as s→0

p-th moment of Y(t)

Suppose the first n moments are zero (called the


approximation order of the wavelet), then it can be
shown that g(s,t)sn+2. So some effort has been put into
finding wavelets with high approximation order.
Continuous Wavelet Transform (cont’d)

1  t −t 
Forward CWT: C (t , s) =  f ( t ) 

 dt
s t  s 

1 t −t
Inverse CWT:
f (t ) =
s t s C (t , s) ( s )dt ds

Note the double integral!


Fourier Transform vs Wavelet Transform

weighted by F(u)
Fourier Transform vs Wavelet Transform
weighted by C(τ,s)

1 t −t
f (t ) =
s t s C (t , s) ( s )dt ds
Properties of Wavelets
• Simultaneous localization in time and scale
- The location of the wavelet allows to explicitly represent
the location of events in time.
- The shape of the wavelet allows to represent different
detail or resolution.
Properties of Wavelets (cont’d)

• Sparsity: for functions typically found in practice,


many of the coefficients in a wavelet representation
are either zero or very small.
1 t −t
f (t ) =
s t s C (t , s) ( s )dt ds
Properties of Wavelets (cont’d)
1 t −t
f (t ) =
s t s C (t , s) ( s )dt ds

• Adaptability: Can represent functions with


discontinuities or corners more efficiently.

• Linear-time complexity: many wavelet


transformations can be accomplished in O(N) time.
Discrete Wavelet Transform (DWT)

a jk =  f (t ) *jk (t ) (forward DWT)


t

f (t ) =   a jk jk (t ) (inverse DWT)


k j

where  jk (t ) = 2 j / 2 ( 2 j t − k )
DFT vs DWT
• DFT expansion: one parameter basis

or f (t ) =  a l l (t )
l

• DWT expansion two parameter basis

f (t ) =  a jk jk (t )
k j
Multiresolution Representation Using Wavelets

f (t )

fine
details
wider, large translations

j
f (t ) =  a  jk (t )
jk
k j

coarse
details
Discrete wavelets:
choice of scale and sampling in time
sj=2j
Scale changes
and by factors of 2

tj,k = 2jkDt
Sampling widens by factor of 2
for each successive scale
Then g(sj,tj,k) = gjk

where j = 1, 2, …
k = -… -2, -1, 0, 1, 2, …
APPLICATIONS OF WT
Terms and Definitions (Continued)

• Scale-Varying Basis Functions : A basis function varies in


scale by chopping up the same function or data space using
different scale sizes.
• Consider a signal over the domain from 0 to 1
• Divide the signal with two step functions that range
from 0 to 1/2 and 1/2 to 1
• Use four step functions from 0 to 1/4, 1/4 to 1/2, 1/2
to 3/4, and 3/4 to 1.
• Each set of representations code the original signal with
a particular resolution or scale.
• Fourier Transforms: Translating a function in the time
domain into a function in the frequency domain
Applied Fields Using Wavelets
• Astronomy • Speech discrimination,
• Acoustics • Optics
• Nuclear engineering • Fractals,
• Sub-band coding • Turbulence
• Earthquake-prediction
• Signal and Image
processing • Radar
• Neurophysiology • Human vision
• Pure mathematics
• Music applications such as solving
• Magnetic resonance partial differential
imaging equations
Fourier Transforms

• Fourier transform have


single set of basis
functions
• Sines
• Cosines
• Time-frequency tiles
• Coverage of the time-
frequency plane
Wavelet Transforms

• Wavelet transforms have


a infinite set of basis
functions
• Daubechies wavelet
basis functions
• Time-frequency tiles
• Coverage of the time-
frequency plane
How do wavelets look like?

• Trade-off between how


compactly the basis
functions are localized in
space and how smooth they
are.
• Classified by number of
vanishing moments
• Filter or Coefficients
• smoothing filter (like a
moving average)
• data's detail information
Applications of Wavelets In Use

Computer and Human FBI Fingerprint


Vision Compression
AIM: Artificial vision for AIM:Compression of 6MB for
robots pair of hands
• Marr Wavelet:intensity • Choose the best wavelets
changes at different scales
in an image • Truncate coefficients below
a threshold
• Image processing in the
human has hierarchical • Sparse coding makes
structure of layers of wavelets valuable tool in
processing data compression.
Applications of Wavelets In Use

Denoising Noisy Data Musical Tones


AIM:Recovering a true signal AIM: Sound synthesis
from noisy data • Notes from instrument
• Wavelet shrinkage and decomposed into wavelet
Thresholding methods packet coefficients.
• Signal is transformed using • Reproducing the note
Coiflets , thresholded and requires reloading those
inverse-transformed coefficients into wavelet
• No smoothing of sharp packet generator
structures required, one • Wavelet-packet-based music
step forward synthesizer
2-D WT Example

Boats image WT in 3 levels

46
WT-Application in Denoising

Boats image Noisy image (additive Gaussian noise)

47
WT-Application in Denoising

Boats image Denoised image using hard thresholding

48
IMAGE COMPRESSION
7 Simulation Result
DCT-based Wavelet-based
Original image image compression image compression

CR = 11.2460 CR = 10.3565
RMS = 4.1316 RMS = 4.0104

50
7 Simulation Result
DCT-based Wavelet-based
Original image image compression image compression

CR = 27.7401 CR = 26.4098
RMS = 6.9763 RMS = 6.8480

51
7 Simulation Result
DCT-based Wavelet-based
Original image image compression image compression

CR = 53.4333 CR = 51.3806
RMS = 10.9662 RMS = 9.6947

52
Compression Example
◼ A two dimensional (image)
compression, using 2D wavelets
analysis.
◼ The image is a Fingerprint.
◼ FBI uses a wavelet technique to
compress its fingerprints database.
Fingerprint compression

Wavelet: Haar
Level:3
Results (1)

Original Image Compressed Image

Threshold: 3.5
Zeros: 42%
Retained energy:
99.95%
Successive Wavelet/Subband
Decomposition
UMCP ENEE631 Slides (created by M.Wu © 2001/2004)

Successive lowpass/highpass filtering and downsampling


• on different level: capture transitions of different frequency bands
• on the same level: capture transitions at different locations

Figure from Matlab Wavelet Toolbox Documentation


ENEE631 Digital Image Processing
Lec14 – Wavelet Coding [56]
(Spring'04)
2-D Example
UMCP ENEE631 Slides (created by M.Wu © 2004)

From Usevitch (IEEE


Sig.Proc. Mag. 9/01)

ENEE631 Digital Image Processing (Spring'04) Lec14 – Wavelet Coding [58]


Review: Filterbank & Multiresolution
Analysis
UMCP ENEE631 Slides (created by M.Wu © 2004)

ENEE631 Digital Image Processing


Lec14 – Wavelet Coding [59]
(Spring'04)
Key Concepts in EZW
• Parent-children relation among coeff.
• Each parent coeff at level k spatially correlates
with 4 coeff at level (k-1) of same orientation
UMCP ENEE631 Slides (created by M.Wu © 2001)

• A coeff at lowest band correlates with 3 coeff.


• Coding significance map via zero-tree
• Encode only high energy coefficients
• Need to send location info.
➔ large overhead
• Encode “insignificance map” w/ zero-trees
• Successive approximation quantization
• Send most-significant-bits first and
gradually refine coeff. value
• “Embedded” nature of coded bit-stream
• get higher fidelity image by adding extra
refining bits From Usevitch (IEEE
Sig.Proc. Mag. 9/01)

ENEE631 Digital Image Processing


Lec14 – Wavelet Coding [60]
(Spring'04)

You might also like