Wavelet Transform
Wavelet Transform
Wavelet Transform
• Fourier Transform
• Wavelet Transform
2
How Does FT Work?
• FT uses complex exponentials (sinusoids) as building blocks.
e jt cost j sin t
• For each frequency of complex exponential, the sinusoid at
that frequency is compared to the signal.
• If the signal consists of that frequency, the correlation is high
large FT coefficients.
j t 1 j t
F ( ) f (t )e dt f (t ) F ( ) e d
2
• If the signal does not have any spectral component at a
frequency, the correlation at that frequency is low / zero,
small / zero FT coefficient.
3
FT At Work
Complex exponentials
(sinusoids) as basis
functions:
j t
X ( j ) x(t ) e dt
1 j t
x(t )
2 X ( j ) e dt
4
An ultrasonic A-scan using 1.5 MHz transducer, sampled at 10 MHz
FT At Work
x1 (t ) cos(2 5 t )
x2 (t ) cos(2 25 t )
x3 (t ) cos(2 50 t )
5
FT At Work
x1 (t ) F X 1 ( )
x2 (t ) F X 2 ( )
x3 (t ) F X 3 ( )
6
FT At Work
x4 (t ) cos(2 5 t )
cos(2 25 t )
cos(2 50 t )
x4 (t ) F X 4 ( )
7
Stationary and Non-stationary Signals
• FT identifies all spectral components present in the signal, however it
does not provide any information regarding the temporal (time)
localization of these components. Why?
• Stationary signals consist of spectral components that do not change
in time
– all spectral components exist at all times
– no need to know any time information
– FT works well for stationary signals
• However, non-stationary signals consists of time varying spectral
components
– How do we find out which spectral component appears when?
– FT only provides what spectral components exist , not where in
time they are located.
– Need some other ways to determine time localization of
spectral components 8
Stationary and Non-stationary Signals
x4 (t ) cos(2 5 t )
cos(2 25 t )
cos(2 50 t )
• Non-stationary signals
have time varying spectra
x5 (t ) [ x1 x2 x3 ]
Concatenation
9
Non-stationary Signals
5 Hz 20 Hz 50 Hz
10
FT Shortcomings
• Complex exponentials stretch out to infinity in time
– They analyze the signal globally, not locally
– Hence, FT can only tell what frequencies exist in the
entire signal, but cannot tell, at what time instances
these frequencies occur
– In order to obtain time localization of the spectral
components, the signal need to be analyzed locally
– HOW ?
11
Short Time Fourier Transform
(STFT)
1. Choose a window function of finite length
2. Put the window on top of the signal at t=0
3. Truncate the signal using this window
4. Compute the FT of the truncated signal, save.
5. Slide the window to the right by a small amount
6. Go to step 3, until window reaches the end of the signal
• For each time location where the window is centered, we obtain
a different FT
– Hence, each FT provides the spectral information of a
separate time-slice of the signal, providing simultaneous time
and frequency information
12
STFT
13
STFT
Time Frequency Signal to
parameter FT Kernel
parameter be analyzed (basis function)
STFTx ( , ) x (t ) W (t ) e j t
dt
t
STFT of signal x(t): Windowing
Computed for each function Windowing function
window centered at t = (Analysis window) centered at t = 15
(localized spectrum)
16
17
Time-Frequency Resolution
• Closely related to the choice of analysis window
– Narrow window good time resolution
– Wide window (narrow band) good frequency resolution
• Two extreme cases:
(T)=(t) excellent time resolution, no frequency
resolution
(T)=1 excellent freq. resolution (FT), no time info!!!
– How to choose the window length?
• Window length defines the time and frequency resolutions
• Heisenberg’s inequality
– Cannot have arbitrarily good time and frequency
resolutions. One must trade one for the other.
18
Frequency
STFT - Time-Frequency Resolution
Time
19
STFT Example
at 2 / 2
(t ) e 20
STFT Example
a=0.01 21
STFT Example
a=0.001 22
STFT Example
a=0.0001 23
STFT Example
a=0.00001 24
Time – Frequency Resolution
• Time – frequency resolution problem with STFT
– Analysis window dictates both time and frequency
resolutions, once and for all
– Narrow window Good time resolution
– Narrow band (wide window) Good frequency
resolution
• When do we need good time resolution, when do
we need good frequency resolution?
25
Heisenberg Principle
1 t
CWTx ( , s ) x ( , s )
s t
xt dt
s
Scale = 1/frequency
28
WT at Work
High frequency (small scale)
29
Scale & Translation
• Translation time shift
• f(t) f(at) a>0
– If 0<a<1 dilation, expansion lower frequency
– If a>1 contraction higher frequency
• f(t)f(t/a) a>0
– If 0<a<1 contraction low scale (high frequency)
– If a>1 dilation, expansion large scale (lower
frequency)
• Scaling Similar meaning of scale in maps
– Large scale: Overall view, long term behavior
– Small scale: Detail view, local behavior
30
1
1:44,500,000 scale 1:2,500,000
frequency
31
1:375,500 1:62,500
The Mother of All Oscillatory Little Basis Functions
( ) 1 t b
CWTx (a, b) W (a, b)
a
x(t ) dt
a
33
ECG Waveform (Normal)
34
Amplitude Computation of CWT
Amplitude
W (1 b0 ) W (10 b0 ) W (10 bN )
b0 bN time b0 bN time
W (1 bN )
Amplitude
Amplitude
W (5 b0 ) W ( 25 b0 ) W ( 25 bN )
W (5 bN )
b0 bN time b0 bN time
1 t b
CWTx( ) ( a, b)
a
W ( a, b) x (t ) dt 35
a
• We require that the wavelet functions, at a
minimum, satisfy the following:
Wave…
(t )dt 0
2
(t )
…let
dt
36
The CWT as a Correlation
• Recall that in the L2 space an inner product is defined as
f (t ), g (t ) f (t ) g (t )dt
38
Examples
39
40
41
42
43
44
Frequenc
y
What Is Wavelet Analysis ?
• And…what is a wavelet…?
Symmetric Asymmetric/symmetric
Smooth Irregular
46
Wavelet Analysis Vs. Fourier Analysis
• Fourier analysis:
Consists of breaking up a signal into sine
waves of various frequencies.
• Wavelet analysis:
Consists of breaking up a signal into shifted
and scaled version of the original wavelet.
(called: mother wavelet)
47
Number Of Dimensions
• Like the Fourier analysis, the wavelet analysis
can also be applied to two-dimensional data
(such as images) or higher dimensions, and
preserve its unique features.
48
The Continuous Wavelet Transform
• A mathematical representation of the Fourier
transform:
z
j t
F ( ) f ( t )e dt
50
Wavelet Transform (Cont’d)
• Similarly, the continuous wavelet transform
(CWT) is defined as the integral over all time
of the signal, multiplied by scaled and shifted
versions of the wavelet function :
z
52
Scaling
• Wavelet analysis produces a time-scale
view of the signal.
• Scaling means stretching or compressing of
the signal.
• Scale factor (a) for sine waves:
f ( t ) sin(t ) ; a 1
f ( t ) sin(2t ) ; a 1 2
f ( t ) sin(4t ) ; a 1 4
53
Scaling (Cont’d)
• Scale factor works exactly the same with
wavelets:
f ( t ) (t ) ; a 1
f ( t ) ( 2t ) ; a 1 2
f ( t ) ( 4t ) ; a 1 4
54
Scaling Factor
• For sinusoid, sin( t) the scale factor a is
inversely related to the radian frequency
55
Shifting
• Shifting means to delaying or hastening its
starting point.
f(t-k) is f(t) delayed by k :
Step 1:
Take a Wavelet and compare
it to a section at the start
of the original signal
57
CWT: The Process (Cont’d)
Step 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.
59
CWT: The Process (Cont’d)
• Step 4: scale (stretch) the wavelet and
repeat steps 1-3
60
CWT: The Process (Cont’d)
• Step 5: repeat steps 1-4 for all scales...
61
And When You Are Done...
• You’ll get the coefficients produced at different
scales by different sections of the signal:
62
Scale And Frequency
• In the former example, the “scale” run from
1 to 31, when higher scale correspond to
the most “stretched” wavelet.
• The more stretched the wavelet - the longer
the portion of the signal with which it is
being compared, and thus, the coarser the
signal features being measured by the
wavelet coefficient.
64
Why Scale ?
• Time-scale is a different way to view data…
but it is more than that !
65
The main advantage: Local analysis
• Local analysis: to analyze a localized area of
a larger signal
• Eg. : Discontinuity caused by a noisy switch
66
Local Analysis (Cont’d)
Wavelet analysis
68
Shift Smoothly Over The
Analyzed Function
69
Continuous versus
Discrete Wavelet transform
70
71
• In CWT, we find wavelet coefficients for every(a,b)
combination.
72
73
74
75
References
1. M. Vetterli, J. Kovacevic, “Wavelets and subband coding" Prentice Hall
Inc, 1995
2. J.C. Goswami and A. K. Chan, “Fundamentals of wavelets: Theory,
Algorithms and Applications" Wiley-Interscience Publication, John Wiley
& Sons Inc., 1999.
3. R. M. Rao and A. Bopardikar, “Wavelet transforms: Introduction to
theory and applications" Addison-Wesley, 1998.
4. Wavelet Tutorial : Parts I to IV, by Robi Polikar, Iowa State Unty.
5. K.P. Soman, An insight into Wavelets
76