Upload
others
View
7
Download
0
Embed Size (px)
Citation preview
PhD Course- Prague, October 2003Dr.Ing. David Cuesta [email protected] University of Valencia- Spain
Pattern Recognition Techniques Applied to Biomedical Signal Processing
Pattern Recognition Techniques Applied to Biomedical Signal Processing
Author: David Cuesta Frau 2
• Pattern Recognition Systems.
Sensors Preprocessing FeatureExtraction Clustering
DissimilarityMeasures
Course Syllabus
WaveletTransform
Amplitude samplesTrace segmentation
Polygonal aprox.Wavelet Transform
Max-Mink-Means
k-Medians
Dynamic Time Warping
Hidden MarkovModels
Author: David Cuesta Frau 3
Schedule
15:30•Hidden Markov Models
10.30•Feature extraction •Clustering algorithms14.30•Dynamic Time Warping
14.30•Wavelet transform
17/10/200316/10/200315/10/200314/10/200313/10/2003
10/10/200309/10/200308/10/200307/10/200306/10/2003
Author: David Cuesta Frau 4
Course Structure
•Lectures.
•Laboratory exercises.
•Assignments.
•Total Credits:1-2
Signal ProcessingSignal Processing
Introduction to Wavelets
Dr.Ing. David Cuesta FrauPolytechnic University of Valencia(Spain)[email protected]
Author: David Cuesta Frau 6
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 7
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 8
1.- Introduction.• Signal Processing.
– Extract information from a signal.– Time domain is not always the best choice.– Frequency domain: Fourier Transform:
– Easily implemented in computers: FFT.
Introduction to Wavelets
( ) ( )∫∞
∞−
−= dtetxfX ftj π2
Author: David Cuesta Frau 9
1.- Introduction.• Fourier Analysis.
– Can not provide simultaneously time and frequency information:Time information is lost.
– Small changes in frequency domain cause changes everywhere in the time domain.
– For stationary signals: the frequency content does not change intime, i.e.:
Introduction to Wavelets
0f f
( )tx
t
( )fX
Author: David Cuesta Frau 10
1.- Introduction.• Fourier Analysis.
– Basis Functions are set: sinusoids. – Many coefficients needed to describe an “edge” or discontinuity.– If the signal is a sinusoid, it is better localized in the frequency
domain.– If the signal is a square pulse, it is better localized in the time
domain.
Introduction to Wavelets
Short Time Fourier Transform.
t
( )tx
f
( )fX
Author: David Cuesta Frau 11
1.- Introduction.• Short Time Fourier Analysis.
– Time-Frequency Analysis.– Windowed Fourier Transform (STFT).
Introduction to Wavelets
FT Basis Functions STFT Basis Functions
Author: David Cuesta Frau 12
1.- Introduction.• Short Time Fourier Analysis.
– Discrete version very difficult to find.– No fast transform.– Fixed window size (fixed resolution):
• Large windows for low frequencies.• Small windows for high frequencies.
– Wavelet Transform.
Introduction to Wavelets
( ) ( ) ( ) ( )dttttgtftSTFT 0000 sin, ωω −= ∫
Author: David Cuesta Frau 13
1.- Introduction.• Wavelet Transform.
– Small wave.– Energy concentrated in time: analysis of non-
stationary, transient or time-varying phenomena.– Allows simultaneous time and frequency analysis.
Introduction to Wavelets
Author: David Cuesta Frau 14
1.- Introduction.• Wavelet Transform.
– Fourier: localized in frequency but not in time.– Wavelet:
• local in both frequency/scale (via dilations) and in time (via translations).
• Many functions are represented in a more compact way. For example: functions with discontinuities and/or sharp spikes.
– Fourier transform: O(nlog2(n)).– Wavelet transform: O(n).
Introduction to Wavelets
Author: David Cuesta Frau 15
1.- Introduction.Introduction to Wavelets
STFT Basis Functions WT Basis Functions
( ) ( ) dta
bttfbaWT
−= ∫ ψ,
• Wavelet Transform.
Author: David Cuesta Frau 16
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 17
2.- Definitions.• Mathematical Background.
– Topic of pure mathematics, but great applicability in many fields.
– Linear decomposition of a function:( ) ( )∑=
iii tctf ψ
( ) SetExpansion tsCoefficienExpansion
sum infiniteor finite for theindex Integer
≡≡≡
tci
i
i
ψ
( ) ( )tfti for Basis≡ψ
Introduction to Wavelets
– Decomposition Unique:
Author: David Cuesta Frau 18
2.- Definitions.• Mathematical Background.
– Basis orthogonal:
( ) ( ) ( ) ( )∫ ≠== lkdttttt lklk ,0, ψψψψ
Introduction to Wavelets
– Then the coefficients can be calculated by :
– Since:
( ) ( ) ( ) ( )∫== dtttfttfc kkk ψψ,
( ) ( ) ( ) ( )∫ ∑∫ =
==
kkkii
iik cdtttcdtttf ψψψ
( ) ( )∫ == lkdttt lk ,1ψψ
Author: David Cuesta Frau 19
2.- Definitions.• Mathematical Background.
– Linear decomposition of a vector:
Introduction to Wavelets
( )123 ,,−=ar
( ) ( ) ( )100101020013 ,,,,,, +−=ar
( ) ( ) ( ) 100010001 ,,,,,,,,
Generator systemin R3
IndependentOrthogonal Basis in R3
( )123 ,,− Coordinatesin R3
Normal
Author: David Cuesta Frau 20
2.- Definitions.
( ) ( ) ( ) ( )∫ ≠== nmdttttt nmnm where,, If 0ψψψψ
( ) ( )tfforBasisOrthogonalti ≡ψ
Introduction to Wavelets
• Mathematical Background.
( ) ( ) ( ) ( )∫== ttfttfc iii ψψ,
:Otherwise( ) ( ) ( )tfforBasisalBiorthogontt ii ~, ≡ψψ
( ) ( )ttfc ii ψ~,= ( ) ( )∑=i
ii tctf ψ
Author: David Cuesta Frau 21
2.- Definitions.• Mathematical Background.
– Example of linear decomposition of a function:
Introduction to Wavelets
( )tf
t
2
1
1−1 2 3
( )tψ
t
1
1( ) ( )itti −=ψψ
t
1
i 1+i...
( ) ( )∫ = mnnm dttt δψψ
( ) ( ) ( ) 1== ∫ dtttt mmm*ψψψ
Author: David Cuesta Frau 22
2.- Definitions.• Mathematical Background.
– Example of linear decomposition of a function:
Introduction to Wavelets
( )tf
t
2
1
1−1 2 3
( ) ( ) ( ) ( )212 −−−+= ttttf ψψψ
otherwise , 01
21
2
1
0
=−=
==
icccc
Author: David Cuesta Frau 23
2.- Definitions.Introduction to Wavelets
• Example:• Four dimensional space (four non-null coefficients).
Synthesis Formula:
( ) ( )∑=i
ii tctf ψ
( )( )( )( )
( )( )( )( )
( )( )( )( )
( )( )( )( )
( )( )( )( )
+
+
+
=
3210
3210
3210
3210
3210
3
3
3
3
3
2
2
2
2
2
1
1
1
1
1
0
0
0
0
0
ψψψψ
ψψψψ
ψψψψ
ψψψψ
cccc
ffff
Author: David Cuesta Frau 24
2.- Definitions.Introduction to Wavelets
• Example:
( )( )( )( )
( ) ( ) ( ) ( )( ) ( ) ( ) ( )( ) ( ) ( ) ( )( ) ( ) ( ) ( )
=
3
2
1
0
3210
3210
3210
3210
3333222211110000
3210
cccc
ffff
ψψψψψψψψψψψψψψψψ
ψcf =
Author: David Cuesta Frau 25
2.- Definitions.Introduction to Wavelets
• Example:
( ) ( ) ( ) ( )( ) ( ) ( ) ( )( ) ( ) ( ) ( )( ) ( ) ( ) ( )
( )( )( )( )
=
3210
3210321032103210
3333
2222
1111
0000
3
2
1
0
ffff
cccc
ψψψψψψψψψψψψψψψψ
~~~~~~~~~~~~~~~~
fψc T~=
Author: David Cuesta Frau 26
2.- Definitions.Introduction to Wavelets
• Example:
fψc T~=
ψcf =fψψf T~= 1T ψψ −=~
Dual Basis
If columns are orthonormal:fIψψ =T fψψf T= TT ψψ =~
Single Basis
Author: David Cuesta Frau 27
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 28
3.- Multiresolution Analysis.• Problem definition:
Time scale change.
Introduction to Wavelets
( )tf 2
t
2
1
1−1 2
( )tψ
t
1
1
?
Author: David Cuesta Frau 29
• Multiresolution Formulation.– Rationale: if a set of signals can be represented by a
weighted sum of ϕ(t-k), a larger set (including the original), can be represented by a weighted sum of ϕ(2t-k).
– Signal analysis at different frequencies with different resolutions.
– Good time resolution and poor frequency resolution at high frequencies.
– Good frequency resolution and poor time resolution at low frequencies.
– Used to define and construct orthonormal wavelet basis for L2.
– Two functions needed: the Wavelet and a scaling function.
Introduction to Wavelets
3.- Multiresolution Analysis.
Author: David Cuesta Frau 30
• Multiresolution Formulation.– Effect of changing the scale. Scaling function:– To decompose a signal into finer and finer details.
Introduction to Wavelets
( )tϕ
( ) 2Ltf ∈( ) 2
0 Ltspank
k ⊂= ϕν :Subspace
( ) ( ) ( ) 0νϕ ∈∀= ∑ tftctfk
kk
– Increase the size of the subspace changing the time scale of the scaling functions:
( ) ( )ktt jjk
j
−= −−
22 2 ϕϕ
3.- Multiresolution Analysis.
Author: David Cuesta Frau 31
• Multiresolution Formulation.
Introduction to Wavelets
( ) ( ) 22 Ltspantspan jkj
kj ⊂== ϕϕν :Subspace
( ) ( ) ( ) jk
jk tfktctf νϕ ∈∀+= ∑ 2
– The spanned spaces are nested:2
21012 L⊂⊂⊂⊂⊂⊂⊂ −− ...... ννννν( ) ( ) 12 +∈⇔∈ jj tftf νν
( ) ( ) ( ) Znntnhtn
∈−= ∑ ,22ϕϕ
3.- Multiresolution Analysis.
Author: David Cuesta Frau 32
• Multiresolution Formulation.
Introduction to Wavelets
– Example: Haar Scaling Function.
( ) ( ) ( )122 −+= ttt ϕϕϕ
( )tϕ
( )t2ϕ ( )12 −tϕ
( )2
10 =h
( )2
11 =h
3.- Multiresolution Analysis.
Author: David Cuesta Frau 33
• Multiresolution Formulation.
Introduction to Wavelets
– Increasing j, the size of the subspace spanned by the scaling function, is also increased.
– Wavelets span the differences between spaces wi. More suitable to describe signals.
– Wavelets and scaling functions should be orthogonal: simple calculation of coefficients.
...
...
⊕⊕⊕=
⊕⊕=⊕=
1002
1002
001
wwL
www
ν
νννν
3.- Multiresolution Analysis.
Author: David Cuesta Frau 34
• Multiresolution Formulation.
Introduction to Wavelets
0ν0w1w2w
( ) [ ] ( ) ℵ∈−= ∑ nntnhtn
, 221 ϕψ
( ) ( )ktt jjk
j
−= −−
22 2 ψψMother Wavelet
3.- Multiresolution Analysis.
[ ] [ ] [ ]∑ ∈−=l
Zllnlhn ,22ϕϕ Scale Function
Author: David Cuesta Frau 35
• Multiresolution Formulation.
Introduction to Wavelets
3.- Multiresolution Analysis.
( )( ) ( ) ( )
1norm for accounts
tscoefficien function scaling
=≡
−−=
≡
2
111 nhnh
nhn
( ) ( ) ( )
( ) ( ) ( ) ( ) ( )tgduugdttgdttgtg
dttgdttgtg
t
tu
t
t
21
2222
121
1
0
2
20
22
0
22
====
==
∫∫∫
∫∫
=
∞+
∞−
∞+
∞−
Author: David Cuesta Frau 36
• Multiresolution Formulation.
Introduction to Wavelets
( ) ( ) ( )122 −−= ttt φφψ
– Example: Haar Wavelet (the oldest and simplest!).
3.- Multiresolution Analysis.
( )
( )
( )
( )211
210
211
210
1
1
−=
=
=
=
h
h
h
h
Author: David Cuesta Frau 37
• Multiresolution Formulation.
Introduction to Wavelets
ZkZjjk ∈∈ ,,ψ
– Haar Wavelet and Scaling Function:
3.- Multiresolution Analysis.
( ) [ [[ [
∈−∈
=1,,1
,0,1
2121
tt
tψ ( ) ( )ktt jjk
j
−= −−
22 2 ψψ
( ) [ [1,0,1 ∈= ttϕ
2LOrthonormal basis of
Zkjjjkkj ∈≥ ,, 0,0ψϕ
Author: David Cuesta Frau 38
• Multiresolution Formulation.
Introduction to Wavelets
( ) ( ) ( )∑ ∑∑∞
=
∞
−∞=
∞
−∞=+=
0j kjkjk
kkk tdtctf ψϕ
3.- Multiresolution Analysis.
...⊕⊕⊕= 1002 wwL ν
Scale Function Wavelet
( ) ( )
( ) ( )ttfd
ttfc
jkjk
kk
ψ
ϕ
,
,
=
= Approximation
Details
Author: David Cuesta Frau 39
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 40
Introduction to Wavelets
• Wavelet Transform:• Building blocks to represent a signal.• Two dimensional expansion. Wavelet set:
• Time-Frequency localization of the signal.• The calculation of the coefficients can be done
efficiently.
( )tjkψ
( ) ( )∑∑=k j
jkjk tctf ψ
( )tfc jk of Transform WaveletDiscrete≡
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 41
Introduction to Wavelets
• Wavelet Transform:• Wavelet Systems are generated from a mother
Wavelet by scaling and translation.
• Multiresolution conditions satisfied.• Filter bank: the lower resolution coefficients can
be calculated from the higher resolution coefficients by a tree-structured algorithm.
( ) ( ) Zkjktt jjk
j
∈−= −−
, , 22 2 ψψ
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 42
Introduction to Wavelets
• Wavelet Transform:• The effect of the Wavelet Transform is a
convolution to measure the similarity between a translated and scaled version of the Wavelet and the signal under analysis.
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 43
Introduction to Wavelets
• Wavelet Transform:• Wavelet Transform representation: Time-Scale
Plane:
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 44
Introduction to Wavelets
• Wavelet Transform:
Time-Scale Plane tSignal
Scale
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 45
Introduction to Wavelets
• Some Mother Wavelets:
4.- Discrete Wavelet Transform.
Compact Support
Author: David Cuesta Frau 46
Introduction to Wavelets
• Effect of choosing different Mother Wavelets:
The Wavelet transform in essence performs a correlation analysis, therefore the output is expected to be maximal when the input signal most resembles the mother wavelet.
Depending on the application, mother wavelet should be as similar as possible to the signal or to the signal portion under analysis. For example, the Mexican Hat Wavelet is the optimal detector to find a Gaussian.
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 47
Introduction to Wavelets
• Effect of choosing different Mother Wavelets:
4.- Discrete Wavelet Transform.
Adaptive Approach.
t
t
( )tx
( )tx
( )tx
t
Author: David Cuesta Frau 48
Introduction to Wavelets
• Wavelet Transform Calculation: 1. Choose a mother wavelet.2. Given two values of j and k, calculate the coefficient
according to:
3. Translate the Wavelet and repeat step 2 until the whole signal is analyzed.
4. Scale the Wavelet and repeat steps 2 and 3.
( )( ) ( ) ( )dtttfctfWT jkjk ψ∫∞
∞−==
( )
−=jkt
jtjk ψψ 1
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 49
Introduction to Wavelets
• Discrete Wavelet Transform Calculation: • Follow steps 1-4 defined previously.• Change the expressions:
[ ] [ ]∑==n
jkjk nnfcDWT ψ
[ ] [ ]knn jjk
j
−= −−
22 2 ψψ
[ ] [ ]∑ ∑∈ ∈
− ==Nj Nk
jkjk ncnfDWT ψ1
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 50
Introduction to Wavelets
• Discrete Wavelet Transform Calculation: • Using Multiresolution Analysis:
[ ]( )[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
==
===
∑
∑
njkjkjk
nkkk
nnfnnfd
nnfnnfcnfDWT
ψψ
ϕϕ
,
,
[ ] [ ] [ ]
[ ] ( ) [ ]lhlh
Zllnlhn
ll
−−=
∈−= ∑
11
22
1
1 ,ϕψ
[ ] [ ] [ ]∑ ∈−=l
Zllnlhn ,22ϕϕ
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 51
Introduction to Wavelets
• Discrete Wavelet Transform Calculation: • Using Multiresolution Analysis:
[ ] [ ] [ ]∑ ∑∑∞
=
∞
−∞=
∞
−∞=
− +===0
1
j kjkjk
kkk ndncnfIDWTDWT ψϕ
[ ] [ ] [ ]∑ ∑∑∞
=
∞
−∞=
∞
−∞=
− +===0
00
1
jj kjkjk
kkjkj ndncnfIDWTDWT ψϕ
Dyadic grid:
...,...,, ,...,,
84014200
=⇒==⇒=
kjkj
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 52
Introduction to Wavelets
• Discrete Wavelet Transform Calculation: • Example:
• Haar Scaling Function:
[ ] 111232111 ,,,,,,,,=nf
( )tϕ
t
1
1
[ ] [ ] [ ]1−+= nnn δδϕ
n
1
1
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 53
Introduction to Wavelets
• Discrete Wavelet Transform Calculation: • Haar Wavelet:
[ ]n2ϕ
n
1
[ ] [ ] [ ]122 −−= nnn ϕϕψ
[ ]nψ
n
1
( )
( )
( )
( )211
210
211
210
1
1
−=
=
=
=
h
h
h
h
1−
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 54
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
[ ]( )[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
==
===
∑
∑
njkjkjk
nkkk
nnfnnfd
nnfnnfcnfDWT
ψψ
ϕϕ
,
,
[ ] [ ] [ ]( ) [ ] [ ][ ] [ ] [ ]( ) [ ] [ ][ ] [ ][ ] [ ] 01176
1235413232
0101
06
04
02
00
=−=−==−=−=
−=−=−−−==−=−−=
ffdffd
ffnnnfdffnnnfd
δδδδ
[ ] 11232111 ,,,,,,,=nf[ ] [ ] [ ]1−−= nnn δδψ
4.- Discrete Wavelet Transform.
64200 ,,,, For == kj
Author: David Cuesta Frau 55
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
[ ] [ ] [ ]( ) [ ] [ ][ ] [ ] [ ]( ) [ ] [ ][ ] [ ] [ ]( ) [ ] [ ][ ] [ ] [ ]( ) [ ] [ ] 27676
5545433232
2101
6
4
2
0
=+=−+−==+=−+−==+=−+−=
=+=−+=
ffnnnfcffnnnfcffnnnfc
ffnnnfc
δδδδδδ
δδ
[ ] 11232111 ,,,,,,,=nf
[ ] [ ] [ ]1−+= nnn δδϕ
4.- Discrete Wavelet Transform.
64200 ,,,, For == kj
Author: David Cuesta Frau 56
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
4.- Discrete Wavelet Transform.
n
nn
kc0
kd0
[ ]nf
Author: David Cuesta Frau 57
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
4.- Discrete Wavelet Transform.
401 ,, For == kj[ ] [ ] [ ] [ ] [ ]( )
[ ] [ ] [ ] [ ][ ] [ ] [ ] [ ] [ ]( )
[ ] [ ] [ ] [ ] 3112376547654
121113210321
14
10
=−−+=−−+=−−−−−+−=
−=−−+=−−+=−−−−−+=
ffffnnnnnfd
ffffnnnnnfd
δδδδ
δδδδ
[ ]nψ
n
1
1−
[ ]2nψ
n
1
1−
[ ] [ ]knn jjk
j
−= −−
22 2 ψψ
Author: David Cuesta Frau 58
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
4.- Discrete Wavelet Transform.
[ ]nϕ
n
1
1
[ ]2nϕ
n
1
1 2 3
[ ] [ ]knn jjk
j
−= −−
22 2 ϕϕ
401 ,, For == kj
[ ] [ ] [ ] [ ] [ ]( )[ ] [ ] [ ] [ ] [ ]( ) 711237654
52111321
14
10
=+++=−+−+−+−==+++=−+−+−+=
nnnnnfcnnnnnfcδδδδ
δδδδ
Author: David Cuesta Frau 59
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
Complete Decomposition (without factor ):
4.- Discrete Wavelet Transform.
01-103-1-212
01-103-175
01-102532
11232111[ ]nf
kc0
kc1
kc2 kd2
kd1
kd0
22j−
Author: David Cuesta Frau 60
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:Reconstruction:
4.- Discrete Wavelet Transform.
From level j=0:
[ ] [ ] [ ]
( ) [ ]nf
ndncnfk
kkk
kk
2224642220011110022553322
642000
642000
⇒=−−+
=+= ∑∑==
,,,,,,,),,,,,,,(),,,,,,,(
,,,,,,ψϕ
[ ] [ ] [ ]∑ ∑∑∞
=
∞
−∞=
∞
−∞=+=
000
jj kjkjk
kkjkj ndncnf ψϕ
Author: David Cuesta Frau 61
Introduction to Wavelets
• Discrete Wavelet Transform Calculation:
4.- Discrete Wavelet Transform.
0.035226-0.085441-0.1350110.4598770.8068910.332671Daubechies-6
Daubechies-4
1.01.0Haar
543210Wavelet
( )3141 + ( )334
1 + ( )3341 − ( )314
1 −
Order of the Wavelet: number of nonzero coefficients.Value of wavelet coefficients is determined by constraints of orthogonality and normalization.
Author: David Cuesta Frau 62
Introduction to Wavelets
• Discrete Wavelet Transform Calculation: • Calculation to be implemented in a
computer. • Is there any method, such as FFT, for DWT
efficient calculation?
Pyramid Algorithm
• Basic Idea: DWT (direct and inverse) can be thought of as a filtering process.
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 63
Introduction to Wavelets
• Pyramid Algorithm:
[ ] [ ] [ ] [ ]∑∞
−∞=−=∗
kknhkfnhnf
[ ]( )[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
==
===
∑
∑
njkjkjk
nkkk
nnfnnfd
nnfnnfcnfDWT
ψψ
ϕϕ
,
,
Filtering:
Sampling Frequency: π2
Bandwidth:π
Signal is passed through a half-band lowpass filterSignal is passed through a half-band highpass filter
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 64
Introduction to Wavelets
• Pyramid Algorithm:• After filtering, half of the samples can be
eliminated: subsample the signal by two.• Subsampling: Scale is doubled.• Filtering: Resolution is halved.
• Decomposition is obtained by successive highpass and lowpass filtering.
[ ] [ ] [ ]
[ ] [ ] [ ]∑
∑
∞
−∞=
∞
−∞=
−=
−=
klow
khigh
knhkfny
kngkfny
2
2
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 65
Introduction to Wavelets
• Pyramid Algorithm:• Filters h and g are not independent.• Relation between filters:
Quadrature Mirror Filters.
• Signal length must be a power of 2 (due to downsampling by 2).
• Maximum decomposition level depends on signal length.
[ ] ( ) [ ] ( )length filter ≡−=−− LnhnLg n11
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 66
Introduction to Wavelets
• Pyramid Algorithm:[ ]nf
[ ]ng [ ]nh
↓2 ↓2
[ ]ng [ ]nh
↓2 ↓2
... ...
DetailsLevel 1
DetailsLevel 2
ApproximationLevel 1
ApproximationLevel 2
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 67
Introduction to Wavelets
• Pyramid Algorithm:Operators notation.
[ ] [ ]
[ ] [ ]∑
∑
∞
−∞=
∞
−∞=
−=
−=
k
k
knhkfHf
kngkfGf
2
2
4.- Discrete Wavelet Transform.
Author: David Cuesta Frau 68
Introduction to Wavelets
• Pyramid Algorithm:
Ω
1D
1A
2D
2A
3D4D
3A
4A
[ ]ΩX
4.- Discrete Wavelet Transform.
π2π
4π
Author: David Cuesta Frau 69
Introduction to Wavelets
• Pyramid Algorithm: Reconstruction.
4.- Discrete Wavelet Transform.
...
ApproximationLevel 1
[ ]nf
↑2
[ ]ng [ ]nh
DetailsLevel 1
↑2
[ ]ng [ ]nhDetailsLevel 2
Author: David Cuesta Frau 70
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 71
5.1.- Denoising.
[ ] [ ] [ ] 10 −≤≤+= Nnnrnxny , σ
Standard Deviation
Signal
Observations of x + noise
Introduction to Wavelets
• Finite Length Signal with Additive Noise:
[ ] ( )10,~ :Noise Nnr
Author: David Cuesta Frau 72
5.1.- Denoising.
RXY σ+=
Introduction to Wavelets
In the Transformation Domain:
where: (W transform matrix).WyY =
estimate of fromX X YDiagonal linear projection:
( ) [ ]10110 , , ,...,, ∈=∆ − iNdiag δδδδ
Estimate: WyWYWXWx ∆=∆== −−− 111 ˆˆ
Author: David Cuesta Frau 73
5.1.- Denoising.Introduction to Wavelets
General Method:1) Compute2) Perform Thresholding in the Wavelet
Domain.3) Compute
Questions:Which Thresholding Method?Which Threshold?
WyY =
XWx ˆˆ 1−=
Author: David Cuesta Frau 74
5.1.- Denoising.Introduction to Wavelets
Thresholding Method (Diagonal Linear Projection):
Author: David Cuesta Frau 75
5.1.- Denoising.Introduction to Wavelets
Threshold:
Stein’s Unbiased Risk Estimate (SURE).
Donoho: n:Sample sizeσ:noise scale
MinimaxAdaptive: based on singular or smooth regions(in practice, heuristic indep. of sample size)
( )nlog2σλ =
Author: David Cuesta Frau 76
Introduction to Wavelets
5.1.- Denoising.Practical considerations:
• Signal normalization to avoid amplitude influence over the process.
• Noise can vary along the signal: windowed threshold.
Author: David Cuesta Frau 77
http://www-dsp.rice.edu/edu/wavelet/denoise.html
Introduction to Wavelets
5.1.- Denoising.
Author: David Cuesta Frau 78
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 79
5.2.- Abrupt Change Detection.Introduction to Wavelets
• Low level details contain information of high frequency components.
• Small support wavelets are better suited to detect such changes.
• Noise makes it difficult.• Application: QRS
complex detection.
Author: David Cuesta Frau 80
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 81
5.3.- Long-Term Evolution.Introduction to Wavelets
• Foundations:– Slow changes which take place in the signal, i.e.,
low frequency variations.– In the time domain: Wavelet transform has high
resolution in time at low frequencies.– In the frequency domain: the higher the
approximation level, the narrower the low pass filter is.
– Problem: depending on the baseline(trend) frequency, the approximation level may change.
– The baseline is considered as additive ‘noise’.
Author: David Cuesta Frau 82
5.3.- Long-Term Evolution.
[ ] [ ] [ ] 10 −≤≤+= Nnnbnxny ,
Introduction to Wavelets
Baseline
Signal
Observations of x + baseline
• Finite Length Signal with baseline variation:
Author: David Cuesta Frau 83
5.3.- Long-Term Evolution.
[ ]( ) [ ]
[ ] [ ] [ ]nbnynx
nbnyWT
ˆˆ
ˆ
−=
=
Introduction to Wavelets
• With the Wavelet Approximation of certain level, we estimate the baseline.
• It can be used as extra information about the signal or to reduce the baseline oscillation.
Author: David Cuesta Frau 84
0 2 4 6 8 10 12 14 16x 104
-2000
-1900
-1800
-1700
-1600
-1500
-1400
-1300
Introduction to Wavelets
• Application: Electrocardiogram baseline wandering reduction.
5.3.- Long-Term Evolution.
Author: David Cuesta Frau 85
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 86
5.4.- Compression.Introduction to Wavelets
• Methods:– Quantization in the Wavelet domain. The set of
possible coefficients values is reduced:
jc
jc
Author: David Cuesta Frau 87
5.4.- Compression.Introduction to Wavelets
• Methods:– Discard those coefficients considered
‘insignificant’: Threshold.– Basis choice is very important.
Coefficients Histogram:
Author: David Cuesta Frau 88
5.4.- Compression.Introduction to Wavelets
• Application: ECG compression.
Author: David Cuesta Frau 89
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 90
6.- The Matlab Wavelet Toolbox.Introduction to Wavelets
Matlab: GUI (type wavemenu).
Author: David Cuesta Frau 91
Introduction to Wavelets
Matlab: Command Line.
6.- The Matlab Wavelet Toolbox.
Author: David Cuesta Frau 92
Introduction to Wavelets
Functions:DWT: Single-level 1-D wavelet decomposition.
[CA,CD] = DWT(X,'wname');
ApproximationCoefficients
DetailCoefficients
Signal MotherWavelet
Example:X=[1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1];
[CA,CD] = DWT(X,‘haar');
CA = 1.4142 0.7071 0 1.4142 0.7071 0 1.4142 1.4142
CD = 0 0.7071 0 0 0.7071 0 0 0
6.- The Matlab Wavelet Toolbox.
Author: David Cuesta Frau 93
Introduction to Wavelets
Functions:IDWT: Single-level 1-D wavelet reconstruction.
X = IDWT(CA,CD,'wname');
WAVEINFO: Provides information about the wavelets in thetoolbox.
WAVEINFO(‘wname');
DWTMODE: Sets extension mode to handle border distortion.
DWTMODE(‘status');
sym,zpd,sp0,sp1,ppd
6.- The Matlab Wavelet Toolbox.
Author: David Cuesta Frau 94
Introduction to Wavelets
Functions:WAVEDEC: Multiple-level 1-D wavelet decomposition.
[C,L] = WAVEDEC(X,N,'wname')
6.- The Matlab Wavelet Toolbox.
APPCOEF: Extracts 1-D approximation coefficients.
A = APPCOEF(C,L,'wname',N)
DETCOEF: Extracts 1-D detail coefficients.
D = DETCOEF(C,L,N)
Author: David Cuesta Frau 95
Introduction to Wavelets
Functions:WRCOEF: Reconstructs single branch from 1-D coefficients.
X = WRCOEF('type',C,L,'wname',N)
6.- The Matlab Wavelet Toolbox.
WDEN: Automatic 1-D denoising using wavelets.
[XD,CXD,LXD] = WDEN(X,TPTR,SORH,SCAL,N,'wname')
Denoisedsignal
Noisy signal
MotherWavelet
DecompositionLevel
Thresholdselection rule:rigrsureheursuresqtwolog
Soft ‘s’ or hard ‘h’ thresholding
Thresholdrescalingoneslnmln
Author: David Cuesta Frau 96
Introduction to Wavelets
Example:Denoising an ECG signal using Wavelets (WaveletExample).
6.- The Matlab Wavelet Toolbox.
Author: David Cuesta Frau 97
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 98
7.- Other Topics.Introduction to Wavelets
Wavelet Packets.
Author: David Cuesta Frau 99
7.- Other Topics.Introduction to Wavelets
2D Wavelet Transform.Application to bidimensional signals: images. Noise reduction, compression, etc.Image is considered a matrix: Wavelet transform is applied on rows and columns.
Author: David Cuesta Frau 100
7.- Other Topics.Introduction to Wavelets
Computer Graphics.Image illumination computation.Figure animation.Surface modelling.Image compression.Image query.Etc.
Author: David Cuesta Frau 101
7.- Other Topics.Introduction to Wavelets
Self-Similarity Detection(Fractals).
Author: David Cuesta Frau 102
7.- Other Topics.Introduction to Wavelets
Feature Extraction.
[ ]( )[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
==
===
∑
∑
njkjkjk
nkkk
nnfnnfd
nnfnnfcnfDWT
ψψ
ϕϕ
,
,
Approximation of the input signal
[ ] [ ] [ ] [ ] ( )NccNfffnf kk <<⇒−= 110 ,...,,
Author: David Cuesta Frau 103
7.- Other Topics.Introduction to Wavelets
Applications in electrocardiology:
• ECG Compression.• ECG Pattern Recognition: detection and classification
of ECG waves, discriminating normal and abnormal cardiac patterns.
• ST segment analysis. Change detection.• Heart rate variability: ECG is assumed to be
nonstationary.• High resolution electrocardiography: detection of late
potentials.
Author: David Cuesta Frau 104
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 105
8.- Summary.Introduction to Wavelets
• Fourier transform is not suitable to obtain time and frequency information: Wavelet Transform.
• Multiresolution analysis. It is possible to change time and scale.• Discrete Wavelet Transform. Pyramidal Algorithm: Efficient
algorithm to calculate the Wavelet Transform in a computer.• Applications in signal processing: noise reduction, long-term
evolution, compression, abrupt changes.• Very important to the analysis of biological signals since most of
the statistical characteristics of such signals are nonstationary-• Matlab Wavelet Toolbox: definitions and functions to work with
Wavelets.• Many other topics: Wavelet packets, Computer graphics, etc.
Author: David Cuesta Frau 106
Index1.- Introduction.2.- Definitions.3.- Multiresolution Analysis.4.- Discrete Wavelet Transform.5.- Applications in Signal Processing.
5.1.- Denoising.5.2.- Abrupt Change Detection.5.3.- Long-Term Evolution.5.4.- Compression.
6.- The Matlab Wavelet Toolbox.7.- Other Topics.8.- Summary.9.- Bibliography.
Introduction to Wavelets
Author: David Cuesta Frau 107
9.- Bibliography.Introduction to Wavelets
1. C.S.Burrus et al. “Introduction to Wavelets and Wavelet Transforms”. Prentice Hall (1998).2. The Wavelet Tutorial. Robi Polikar. http://www.public.iastate.edu/~rpolikar/wavelets3. T. Edwards. “Discrete Wavelet Transforms: Theory and Implementation”. (1991)4. Michael L. Hilton, "Wavelet and Wavelet Packet Compression of Electrocardiograms", IEEE
Trans. on Biomedical Engineering, Vol. 44, pp.394—402 , (1997).5. Matlab Wavelet Toolbox User’s Manual.6. I.Provaznik et al., “Wavelet Transform in ECG signal Processing”. Proceedings of the 15th
Biennial Eurasip Conference BIOSIGNAL 2000. pp. 21-25, (2000).7. M. Unser, “Wavelets, statistics, and biomedical applications”. Proceedings of 8th IEEE
Signal Processing Workshop on Statistical Signal and Array Processing. pp. 244-249, (1996)
8. Cuiwei Liyet al., “Detection of ECG Characteristic Points Using Wavelet Transforms”, IEEE Transactions on Biomedical Engineering, vol. 42, no.1 , pp. 21-28. (1995)
9. A. Bezarienas et al. “ Selective Noise filtering of High Resolution ECG Through Wavelet Transform “, Computers in Cardiology pp 637-640, (1996)
10. H. Inoue; A. Miyazaki, “A Noise Reduction Method for ECG Signals Using the Dyadic Wavelet Transform”, IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, pp. 1001-1007, (1998)
11. Donoho D., “De-noising by soft-thresholding”, IEEE Trans. Information Theory, vol. 41, no. 3, pp.612-627, (1995)
Author: David Cuesta Frau 108
9.- Bibliography.Introduction to Wavelets
12. B.Vidakovic and P. Müller, “Wavelets for Kids. A Tutorial Introduction”. Duke University.13. J.P. Couderc and W. Zareba, “Contribution of the Wavelet Analysis to the Non-Invasive
Electrocardiology”. University of Rochester.14. M.V. Wickerhauser, “Lectures on Wavelet Packet Algorithms”. Department of Mathematics,
Washington University (1991).15. K.Berkner and R.O.Wells, “Wavelet Transforms and Denoising Algorithms”. Department of
Mathematics, Rice University. IEEE (1998).16. L.V.Novikov, “Adaptive Wavelet Analysis of Signals”.17. M. Kanapathipillai et al.,”Adaptive Wavelet Representation and Classification of ECG
Signals”. IEEE (1994).18. B.Jawerth and W.Sweldens, “An Overview of Wavelet Based Multiresolution Analysis”.
Department of Mathematics, University of South Carolina.19. R.R.Coifman and M.V. Wickerhauser, “Entropy-Based Algorithms for Best Basis Selection”.
Department of Mathematics, Yale University.
Author: David Cuesta Frau 109
Signal ProcessingSignal Processing
Introduction to Wavelets
•Laboratory Exercises
•Assignments