Wavelets ? Raghu Machiraju Contributions: Robert Moorhead, James Fowler, David Thompson, Mississippi State University Ioannis Kakadaris, U of Houston
Mar 13, 2016
Wavelets ?
Raghu MachirajuContributions:
Robert Moorhead, James Fowler, David Thompson, Mississippi State University
Ioannis Kakadaris, U of Houston
April 24, 2023 2
StateOfAffairs
Simulations, scanners
Presentation
Analysis
Representation
Retrospective
Concurrent
April 24, 2023 3
Why Wavelets?•We are generating and measuring larger datasets every year
•We can not store all the data we create (too much, too fast)
•We can not look at all the data (too busy, too hard)
•We need to develop techniques to store the data in better formats
April 24, 2023 4
Data Analysis
• Frequency spectrum correctly shows a spike at 10 Hz
• Spike not narrow  significant component at between 5 and 15 Hz.
•Leakage  discrete data acquisition does not stop at exactly the same phase in the sine wave as it started.
April 24, 2023 5
QuickFix
April 24, 2023 6
Windowing &Filtering
April 24, 2023 7
Image Example
• 8x8 Blocked Window (Cosine) Transform•Each DCT basis waveform represents a fixed frequency in two orthogonal directions
•frequency spacing in each direction is an integer multiple of a base frequency
April 24, 2023 8
Windowing & Filtering
Windows –
fixed in space and frequencies
Cannot resolve all features at all instants
April 24, 2023 9
I (x ) G(, x) I(x) G(,)I(x ) d
= 1 = 16 = 24 = 32
input
Linear Scale Space
April 24, 2023 10
Successive Smoothing
April 24, 2023 11
•Keep 1 of 4 values from 2x2 blocks
•This naive approach and introduces aliasing
•Subsamples are bad representatives of area
•Little spatial correlation
Subsampled Images
April 24, 2023 12
Image Pyramid
April 24, 2023 13
•Average over a 2x2 block
•This is a rather straight forward approach
•This reduces aliasing and is a better representation
•However, this produces 11% expansion in the data
Image Pyramid – MIP MAP
April 24, 2023 14
Image Pyramid – Another Twist
10 2 8 4 6 2 4 0
6 6 4 2
6 34.5
4 2 2 4
4 2 2 4 0 1
4 2 2 4 0 1 1.5
Average DifferencesAverage Sum
Pyramids
This is the Haar Wavelet Transform
April 24, 2023 15
time/space
Frequency
t
sin(nw0t)Impulse
t
Spectrum
Time Frequency Diagram
April 24, 2023 16
Ideally !Create new signal G such that FG =
April 24, 2023 17
Wavelet Analysis
D3
D2
D1
A1
A1 D1 D2 D3
x
D1
A2D3
D2
April 24, 2023 18
•We need to develop techniques to analyze data better through noise discrimination
•Wavelets can be used to detect features and to compare features
•Wavelets can provide compressed representations
•Wavelet Theory provides a unified framework for data processing
Why Wavelets? Because …
April 24, 2023 19
ScaleCoherent Structures
Coherent structure  frequencies at all scales
Examples  edges, peaks, ridges
Locate extent and assign saliency
April 24, 2023 20
Wavelets – Analysis
April 24, 2023 21
Wavelets – DeNoising
April 24, 2023 22
Wavelets – Compression
Original 50:1
April 24, 2023 23
Wavelets – Compression
Original 50:1
April 24, 2023 24
1/1 1/4 1/16
Wavelets – Compression
April 24, 2023 25
Yet Another Example
50%
7%
April 24, 2023 26
Final Example
100% 50% 2%
1%
April 24, 2023 27
Information Rate Curve
0.0 0.2 0.4 0.6 0.8 1.0normalized rate0.0
0.2
0.4
0.6
0.8
1.0
norm
alize
d in
form
atio
n(E
)
densityu momentumv momentumw momentumenergy
•Energy Compaction – Few coefficients can efficiently represent functions
•The Curve should be as vertical as possible near 0 rate
April 24, 2023 28
H
G
2
2
H
G
2
2
H
G
2
2
x0
x1
D1
x2
D2
x3
D3
Mallat’s Pyramid Algorithm
Filter Bank Implementation
G: High Pass Filter H: Low Pass Filter
April 24, 2023 29
10 2 8 4 6 2 4 0
3
H2
G2
G2
x3
d2
d3
x1
x0
H2
H = Summation FilterG = Difference Filter
(The Other Half) Synthesis Filter Bank
G2
H2
d1
x2
+ 
0 1
4 2 2 4
1.54.5
6
6
6 4 2
Synthesis Bank
April 24, 2023 30
x
A2
A1
A3
Successive Approximations
April 24, 2023 31
x
D2
D1
D3
Successive Details
April 24, 2023 32
x
D2
D1
A2
Wavelet Representation
April 24, 2023 33
Coefficients
D1D2D3A3
April 24, 2023 34
Lossey Compression
April 24, 2023 35
Lossey Compression
April 24, 2023 36
A Frame
Another Frame
Image Example
April 24, 2023 37
Average
Difference
Image Example
April 24, 2023 38
Rows
ColumnsApprox. at res. j
Low Row, High Column
High Row, Low Column
High Row, High Column
Approx.at res. j+1
Boxes have same meaning!
Wavelet Transform
April 24, 2023 39
LH1
HL1
0
/4
/2
/2 /4
HH1
LL1 LH1
HL1
HH2HL2
LL2 LH2
0
/4
/2
/2 /4
HH1
Frequency Support
April 24, 2023 40
LvLh LvHh
HvLhHvHh
Image Example
April 24, 2023 41
LvLh LvHh
HvLhHvHh
Image Example
April 24, 2023 42
f(x)=
+
+
+
Desired Goal!
A2
D2
D1
0 1
0 1
x 1 0 x 1
0 otherwise
=
x
1– 0 x 12
1 12 x 1
0 otherwise
=
How Does One Do This ?
April 24, 2023 43
Dilations•Rescaling Operation t > 2t
•Down Sampling, n > 2n
•Halve function support
•Double frequency content
•Octave division of spectrum Gives rise to different scales and resolutions
•Mother wavelet!  basic function gives rise to differing versions
j x 1
2
j2
 x2
j =
April 24, 2023 44
box(t)
box (2t)
Finer Resolution, j+1
Coarser Resolution, j
0
sin 2t
sin t
fn = sin an
fn = sin a2n
Rescaling DownSampling
0 1/2
0 1
t
Dilations
April 24, 2023 45
Successive Approximations
f(x)
A2
A1
A3
April 24, 2023 46
box (x1)
box (2x1)
box (x)
box (2x1)
Finer Resolution, j+1
Coarser Resolution, j
x
freq
Translations•Covers spacefrequency diagram
•Versions are
jk x 1
2
j2
 x k–
2j =
April 24, 2023 47
D1D2D3A3
spectrum
V3
V2 =
+W3
Wavelet Decomposition
•Induced functional Space  Wj.
•Related to Vjs
•Space Wj+1 is orthogonal to Vj+1
•Also
•Jlevel wavelet decomposition 
Vj Vj 1+ Wj 1+=
Wj 1+ Vj
Vj Vj 2+ Wj 2+ Wj 1+ =
V0 VJ WJ WJ 1– WJ 2– W1+ + + + +=
April 24, 2023 48
Successive Differences
April 24, 2023 49
•Wavelet expansion (Tiling j: scale, k: translates), Synthesis
•Orthogonal transformation, Coarsest level of resolution  J
•Smoothing function  , Detail function 
•Analysis:
•Commonly used wavelets are Haar, Daubechies and Coiflets
f x aJkJk x k djkjk x
k
j 1=
J+=
aJk f x( )Jk x( ) td–= d jk f x( )jk x( ) td–
=
Wavelet Expansion
April 24, 2023 50
Scaling Functions•Compact support
•Bandlimited  cutoff frequency
•Cannot achieve both
•DC value (or the average) is defined
•Translates of are orthogonal
x xd 1=
x x k– xd k =
spectrum
c
April 24, 2023 51
h(0) = 1/2, h(1) = 1/2
0 1/4 1/2 3/4 1 t
Dilation Equation
coarset
t
t
Scaling Functions
•Nested smooth spaces
•Dilation Equation  Haar
•Generally –
•Frequency Domain
L V V V
t 2h 0 2t 2h 1 2t 1– +=
t 2hk 2t k– =
12
 H2
0 1
=
) ) )
April 24, 2023 52
g(0) = 1/2, g(1) = 1/2
0 1/2 1
0 1/2
Wavelet Functions•Wavelet Equation  Haar System: G Filter
•Generally t 2g 0 2t 2g– 1 2t 1– =
t 2gk 2t k– =
April 24, 2023 53
G2
H2
G
H 2
General Case G
2
22
Perfect Reconstruction
•Synthesis and Analysis Filter Banks
•Synthesis Filters  Transpose of Analysis filters•For compact scaling function
h n 2=
April 24, 2023 54
Orthogonal Filter Banks
•Alternating Flip
•Not symmetric  h is even length!
•Example
•Orthogonality conditions
g k 1– kh N k– =
H h0 h1 h2 h3 = HT h3 h2 h1 h0
=
G h3 h2– h1 h0– = GT h0– h1 h2– h3 =
h2 n k = h n g n 2k– 0=
H 2H + 2
+ 2= H2
1=
April 24, 2023 55
h 0 h 1 + 2=
h2 0 h2 1 + 1=
h 0 12
= h 1 12
=
Examples
Haar
h 0 h 1 h 2 h 3 + + + 2=
h2 0 h2 1 h2 2 h 3 + + + 1=h 0 h 2 h 1 h 3 + 0=
h 0 1 3+4 2
= h 1 3 3+4 2
=
h 2 3 3–4 2
= h 0 1 3–4 2
=
Daubechies(2)
April 24, 2023 56
Approximation: Vanishing Moments Property
•Function is smooth  Taylor Series expansion
•Wavelets with m vanishing moments
•Function with m derivatives can be accurately represented!
f x fp
0 xp
p!
p 0==
W f x ; fp
0 tp
p!
p m 1+ ==
April 24, 2023 57
Design of Compact Orthogonal Wavelets
•Compute scaling function
•Use Refinement Equation
•N vanishing moments property  H() has a zero of order N at =
•P(y) is pth order polynomial (Daubechies 1992)
•Maxflat filter
12
 H2
0 1
=
) ) )
H 1 e i–+2
 p
Q =
Q P2 2sin
=
) )
)
April 24, 2023 58
Example
N=4
April 24, 2023 59
N=16
Example
April 24, 2023 60
Noise•Uncorrelated Gaussian noise is correlated
•Region of correlation is small at coarse scale
•Smooth versions  no noise
•Orthogonal transform  uncorrelated
April 24, 2023 61
Noise Across Scales
April 24, 2023 62
Denoising
•Statistical thresholding methods [Donohoe]
•Assuming Gaussian Noise
•Universal Threshold
•Smoothness guaranteed
•Hard
•Soft
•Works for additive noise since wavelet transform is linear
2 n log=
yhard t x t x t =
ysoft t x t x t –sgn x t =
W a b f ;+ W a b f ; W a b ; +=
April 24, 2023 63
April 24, 2023 64
D1
D3
D2
A3
Discontinuity
April 24, 2023 65
Multiscale Edges •Mallat and Hwang
•Location  maximas (edges) of wavelet coefficients at all scales
•Maxima chains for each edge
•Ranking  compute Lipschitz coefficient at all points
•Representation  store maximas
•Reconstruction approximate but works in practice
April 24, 2023 66
BiOrthogonal Filter Banks•Analysis/synthesis different
•Aliasing  overlap in spectras
•Alias cancellation
•Distortion Free (phase shift l)
•Alternating Flip condition valid
•Can be odd length, symmetric
H1 H0
+ G1 G0
+ + 0=
H1 H0
G1 G0
+ 2e jl–=
G12
H12
G0 2
H0 2
April 24, 2023 67
BiOrthogonal Wavelets•Governing equations
•Spline Wavelets  Many choices of either H0 or H1
•Choose H 0 as spline and solve equations to generate H1
g n 1– nh1 N n– =
g1 n 1– nh N n– =
h n h1 n 2k+ n k =
2
22
21,2,11,2,6,2,1
1,2,11,2,6,2,1
April 24, 2023 68
Biorthogonal: Lifting Scheme•Lazy wavelet transform: split data in 2 parts
•Keep even part; predict (linear/cubic) odd part
•Lifting  update j+1 with j+1: Maintain properties (moments, avg.)
•Synthesis is just flip of analysis

+
split predictupdate
j,k
j+1,k
j+1,k
April 24, 2023 69
Summary Wavelets have good representation property They improve on image pyramid schemes Orthogonal and biorthogonal filter bank
implementations are efficient Wavelets can filter signals They can efficiently denoise signals The presence of singularities can be detected from
the magnitude of wavelet coefficients and their behavior across scales