Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends...

98
Wavelets (Chapter 7) CS474/674 – Prof. Bebis

Transcript of Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends...

Page 1: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Wavelets (Chapter 7)

CS474/674 – Prof. Bebis

Page 2: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

STFT (revisited)

• Time/Frequency localization depends on window size.• Once you choose a particular window size, it will be the same

for all frequencies.• Many signals require a more flexible approach - vary the

window size to determine more accurately either time or frequency.

Page 3: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

The Wavelet Transform

• Overcomes the preset resolution problem of the STFT by using a variable length window:

– Narrower windows are more appropriate at high frequencies (better time localization)

– Wider windows are more appropriate at low frequencies (better frequency localization)

Page 4: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

The Wavelet Transform (cont’d)

Wide windows do not provide good localization at high frequencies.

Page 5: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

The Wavelet Transform (cont’d)

A narrower window is more appropriate at high frequencies.

Page 6: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

The Wavelet Transform (cont’d)

Narrow windows do not provide good localization at low frequencies.

Page 7: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

The Wavelet Transform (cont’d)

A wider window is more appropriate at low frequencies.

Page 8: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

What is a wavelet?

• It is a function that “waves” above and below the x-axis; it has (1) varying frequency, (2) limited duration, and (3) an average value of zero.

• This is in contrast to sinusoids, used by FT, which have infinite energy.

Sinusoid Wavelet

Page 9: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Wavelets

• Like sine and cosine functions in FT, wavelets can define basis functions ψk(t):

• Span of ψk(t): vector space S containing all functions f(t) that can be represented by ψk(t).

( ) ( )k kk

f t a t

Page 10: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Wavelets (cont’d)

• There are many different wavelets:

MorletHaar Daubechies

Page 11: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

(dyadic/octave grid)

Basis Construction - Mother Wavelet

( ) jk t

Page 12: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Basis Construction - Mother Wavelet (cont’d)

scale =1/2j

(1/frequency)

/2( ) 2 2 j jjk t t k

j

k

Page 13: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Continuous Wavelet Transform (CWT)

1( , )

t

tC s f t dt

ss

translation parameter, measure of time

scale parameter (measure of frequency)

Mother wavelet (window)normalization

constant

ForwardCWT:

scale =1/2j=1/frequency

Page 14: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

CWT: Main Steps

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.

Page 15: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

CWT: Main Steps (cont’d)

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

Page 16: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

CWT: Main Steps (cont’d)

4. Scale the wavelet and repeat steps 1 through 3.

5. Repeat steps 1 through 4 for all scales.

Page 17: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Coefficients of CTW Transform

1( , )

t

tC s f t dt

ss

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

Page 18: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Continuous Wavelet Transform (cont’d)

• Inverse CWT:

1( ) ( , ) ( )

s

tf t C s d ds

ss

note the double integral!

Page 19: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

FT vs WT

weighted by F(u)

weighted by C(τ,s)

Page 20: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

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.

Page 21: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

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.

• Adaptability: Can represent functions with discontinuities or corners more efficiently.

• Linear-time complexity: many wavelet transformations can be accomplished in O(N) time.

1( ) ( , ) ( )

s

tf t C s d ds

ss

Page 22: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Discrete Wavelet Transform (DWT)

( ) ( )jk jkk j

f t a t

/2( ) 2 2 j jjk t t k

(inverse DWT)

(forward DWT)

where

*( ) ( )jkjkt

a f t t

Page 23: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

DFT vs DWT

• FT expansion:

• WT expansion

or

one parameter basis

( ) ( )l ll

f t a t

( ) ( )jk jkk j

f t a t

two parameter basis

Page 24: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Multiresolution Representation using

( ) ( )jk jkk j

f t a t

( )f t

( )jk t

j

finedetails

coarsedetails

wider, large translations

Page 25: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Multiresolution Representation using

( ) ( )jk jkk j

f t a t

( )f t

( )jk t

j

finedetails

coarsedetails

Page 26: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Multiresolution Representation using

( ) ( )jk jkk j

f t a t

( )f t

( )jk t

j

finedetails

coarsedetails

narrower, small translations

Page 27: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Multiresolution Representation using

high resolution

(more details)

low resolution

(less details)

( ) ( )jk jkk j

f t a t

( )f t

1ˆ ( )f t

2ˆ ( )f t

ˆ ( )sf t

( )jk t

j

Page 28: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Prediction Residual Pyramid - Revisited

• In the absence of quantization errors, the approximation pyramid can be reconstructed from the prediction residual pyramid.

• Prediction residual pyramid can be represented more efficiently.

(with sub-sampling)

Page 29: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Efficient Representation Using “Details”

details D2

L0

details D3

details D1

(without sub-sampling)

Page 30: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Efficient Representation Using Details (cont’d)

representation: L0 D1 D2 D3

A wavelet representation of a function consists of (1)a coarse overall approximation (2)detail coefficients that influence the function at various scales.

in general: L0 D1 D2 D3…DJ

Page 31: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Reconstruction (synthesis)H3=H2+D3

details D2

L0

details D3

H2=H1+D2

H1=L0+D1

details D1

(without sub-sampling)

Page 32: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example - Haar Wavelets

• Suppose we are given a 1D "image" with a resolution of 4 pixels:

[9 7 3 5]

• The Haar wavelet transform is the following:

L0 D1 D2 D3(with sub-sampling)

Page 33: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example - Haar Wavelets (cont’d)

• Start by averaging the pixels together (pairwise) to get a new lower resolution image:

• To recover the original four pixels from the two averaged pixels, store some detail coefficients.

1

[9 7 3 5]

Page 34: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example - Haar Wavelets (cont’d)

• Repeating this process on the averages (i.e., low resolution image) gives the full decomposition:

1

Harr decomposition:

Page 35: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example - Haar Wavelets (cont’d)

• We can reconstruct the original image by adding or subtracting the detail coefficients from the lower-resolution versions.

2 1 -1

Page 36: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example - Haar Wavelets (cont’d)

Detail coefficientsbecome smaller andsmaller as j increases.

Dj

Dj-1

D1L0

How tocompute Di ?

Page 37: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Multiresolution Conditions

• If a set of functions can be represented by a weighted sum of ψ(2jt - k), then a larger setlarger set, including the original, can be represented by a weighted sum of ψ(2j+1t - k):

low resolution

high resolution

j

Page 38: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Multiresolution Conditions (cont’d)

• If a set of functions can be represented by a weighted sum of ψ(2jt - k), then a larger set, including the original, can be represented by a weighted sum of ψ(2j+1t - k):

Vj: span of ψ(2jt - k): ( ) ( )j k jkk

f t a t

Vj+1: span of ψ(2j+1t - k): 1 ( 1)( ) ( )j k j kk

f t b t

1j jV V

Page 39: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Nested Spaces Vj

ψ(t - k)

ψ(2t - k)

ψ(2jt - k)

V0

V1

Vj

Vj : space spanned by ψ(2jt - k)

Multiresolution conditions nested spanned spaces:

( ) ( )jk jkk j

f t a t f(t) ϵ Vj

Basis functions:

i.e., if f(t) ϵ V j then f(t) ϵ V j+1

1j jV V

Page 40: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

How to compute Di ? (cont’d)

( ) ( )jk jkk j

f t a t f(t) ϵ Vj

IDEA: define a set of basisfunctions that span thedifference between Vj+1 and Vj

Page 41: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Orthogonal Complement Wj

• Let Wj be the orthogonal complement of Vj in Vj+1

Vj+1 = Vj + Wj

Page 42: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

How to compute Di ? (cont’d)

If f(t) ϵ Vj+1, then f(t) can be represented using basis functions φ(t) from Vj+1:

1( ) (2 )jk

k

f t c t k

( ) (2 ) (2 )j jk jk

k k

f t c t k d t k Vj+1 = Vj + Wj

Alternatively, f(t) can be represented using two sets of basis functions, φ(t) from Vj and ψ(t) from Wj:

Vj+1

Page 43: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Think of Wj as a means to represent the parts of a function in Vj+1 that cannot be represented in Vj

1( ) (2 )jk

k

f t c t k

( ) (2 ) (2 )j jk jk

k k

f t c t k d t k Vj Wj

How to compute Di ? (cont’d)

differencesbetweenVj and Vj+1

Page 44: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

How to compute Di ? (cont’d)

• using recursion on Vj:

( ) ( ) (2 )jk jk

k k j

f t c t k d t k

V0 W0, W1, W2, …basis functions basis functions

Vj+1 = Vj-1+Wj-1+Wj = …= V0 + W0 + W1 + W2 + … + Wj

if f(t) ϵ Vj+1 , then:

Vj+1 = Vj + Wj

Page 45: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Summary: wavelet expansion (Section 7.2)

• Wavelet decompositions involve a pair of waveforms (mother wavelets):

φ(t) ψ(t)encode lowresolution info

encode details orhigh resolution info

( ) ( ) (2 )jk jk

k k j

f t c t k d t k

scaling function wavelet function

Page 46: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

1D Haar Wavelets

• Haar scaling and wavelet functions:

computes average computes details

φ(t) ψ(t)

Page 47: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

1D Haar Wavelets (cont’d)

• V0 represents the space of one pixel images

• Think of a one-pixel image as a function that is constant over [0,1)

Example:0 1

width: 1

Page 48: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

1D Haar Wavelets (cont’d)

• V1 represents the space of all two-pixel images

• Think of a two-pixel image as a function having 21 equal-sized constant pieces over the interval [0, 1).

• Note that

Examples: 0 ½ 1

0 1V V

= +

width: 1/2

e.g.,

Page 49: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

1D Haar Wavelets (cont’d)

• V j represents all the 2j-pixel images

• Functions having 2j equal-sized constant pieces over interval [0,1).

• Note that

Examples: width: 1/2j

ϵ Vj ϵ Vj

1j jV V

e.g.,

Page 50: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

1D Haar Wavelets (cont’d)

V0, V1, ..., V j are nested

i.e.,

VJ

V1

V0coarse details

fine details

1j jV V

Page 51: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Vj

• Mother scaling function:

• Let’s define a basis for V j :

0 1

note alternative notation: ( ) ( )ji jix x

1

Page 52: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Vj (cont’d)

Page 53: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Wj (cont’d)

• Mother wavelet function:

• Let’s define a basis ψ ji for Wj :

1-1

0 1/2 1

( ) ( )ji jix x note alternative notation:

Page 54: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Wj

Notethat the dotproductbetween basisfunctions in Vj

and Wj is zero!

Page 55: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Wj (cont’d)

Basis functions ψ ji of W j

Basis functions φ ji of V j

form a basis in V j+1

Page 56: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Wj (cont’d)

V3 = V2 + W2

Page 57: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Wj (cont’d)

V2 = V1 + W1

Page 58: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Define a basis for Wj (cont’d)

V1 = V0 + W0

Page 59: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example - Revisited

f(x)=

V2

Page 60: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

φ2,0(x)

φ2,1(x)

φ2,2(x)

φ2,3(x)

Example (cont’d)

V2

f(x)=

Page 61: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (cont’d)

V1and W1

V2=V1+W1

φ1,0(x)

φ1,1(x)

ψ1,0(x)

ψ1,1(x)

(divide by 2 for normalization)

Page 62: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (cont’d)

Page 63: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (cont’d)

V2=V1+W1=V0+W0+W1

V0 ,W0 and W1

φ0,0(x)

ψ0,0(x)

ψ1,0 (x)

ψ1,1(x)

(divide by 2 for normalization)

Page 64: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example

Page 65: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (cont’d)

Page 66: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Filter banks

• The lower resolution coefficients can be calculated from the higher resolution coefficients by a tree-structured algorithm (i.e., filter bank).

h0(-n) is a lowpass filter and h1(-n) is a highpass filter

Subbandencoding(analysis)

Page 67: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (revisited)

[9 7 3 5]low-pass,down-sampling

high-pass, down-sampling

(9+7)/2 (3+5)/2 (9-7)/2 (3-5)/2 V1 basis functions

Page 68: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Filter banks (cont’d)

Next level:

Page 69: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (revisited)

[9 7 3 5]

high-pass, down-sampling

low-pass,down-sampling

(8+4)/2 (8-4)/2

V1 basis functions

Page 70: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Convention for illustrating 1D Haar wavelet decomposition

x x x x x x … x x

detail

average

re-arrange:

re-arrange:

V1 basis functions

Page 71: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Examples of lowpass/highpass (analysis) filters

Daubechies

Haarh0

h1

h0

h1

Page 72: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Filter banks (cont’d)

• The higher resolution coefficients can be calculated from

the lower resolution coefficients using a similar structure.

Subbandencoding(synthesis)

Page 73: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Filter banks (cont’d)

Next level:

Page 74: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Examples of lowpass/highpass (synthesis) filters

Daubechies

Haar (same as for analysis):

+

g0

g1

g0

g1

Page 75: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar Wavelet Transform

• The 2D Haar wavelet decomposition can be computed using 1D Haar wavelet decompositions.– i.e., 2D Haar wavelet basis is separable

• Two decompositions (i.e., correspond to different basis functions):– Standard decomposition

– Non-standard decomposition

Page 76: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Standard Haar wavelet decomposition

• Steps

(1) Compute 1D Haar wavelet decomposition of each row of the original pixel values.

(2) Compute 1D Haar wavelet decomposition of each column of the row-transformed pixels.

Page 77: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Standard Haar wavelet decomposition (cont’d)

x x x … xx x x … x

… … .x x x ... x

(1) row-wise Haar decomposition:

detail

average

… … .

… … .

re-arrange terms

Page 78: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Standard Haar wavelet decomposition (cont’d)

(1) row-wise Haar decomposition:

detail

average

…… … .

… … . …

row-transformed result

Page 79: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Standard Haar wavelet decomposition (cont’d)

(2) column-wise Haar decomposition:

detail

average

…… … .

…… … .

row-transformed result column-transformed result

Page 80: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example

…… … .

row-transformed result

… … .

re-arrange terms

Page 81: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (cont’d)

…… … .

column-transformed result

Page 82: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar basis for standard decomposition

To construct the standard 2D Haar wavelet basis, consider all possible outer products of 1D basis functions.

φ0,0(x)

ψ0,0(x)

ψ1,0(x)

ψ1,1(x)

V2=V0+W0+W1

Example:

Page 83: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar basis for standard decomposition

To construct the standard 2D Haar wavelet basis, consider all possible outer products of 1D basis functions.

φ00(x), φ00(x) ψ00(x), φ00(x) ψ10(x), φ00(x)

( ) ( )ji jix x ( ) ( )j

i jix x

Page 84: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar basis of standard decomposition

( ) ( )ji jix x

( ) ( )ji jix x

V2

Page 85: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Non-standard Haar wavelet decomposition

• Alternates between operations on rows and columns.

(1) Perform one level decomposition in each row (i.e., one step of horizontal pairwise averaging and differencing).

(2) Perform one level decomposition in each column from step 1 (i.e., one step of vertical pairwise averaging and differencing).

(3) Repeat the process on the quadrant containing averages only (i.e., in both directions).

Page 86: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Non-standard Haar wavelet decomposition (cont’d)

x x x … xx x x … x

… … .x x x . . . x

one level, horizontalHaar decomposition:

… … .

… … .

one level, vertical Haar decomposition:

Page 87: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Non-standard Haar wavelet decomposition (cont’d)

one level, horizontalHaar decompositionon “green” quadrant

one level, vertical Haar decompositionon “green” quadrant

……

… … .

……

re-arrange terms

…… … .

Page 88: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example

……

… … .

……

re-arrange terms

Page 89: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Example (cont’d)

…… … .

Page 90: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar basis for non-standard decomposition

• Defined through 2D scaling and wavelet functions:

( , ) ( ) ( )

( , ) ( ) ( )

( , ) ( ) ( )

( , ) ( ) ( )

x y x y

x y x y

x y x y

x y x y

000 ( , ) ( , )

( , ) 2 (2 ,2 )

( , ) 2 (2 ,2 )

( , ) 2 (2 ,2 )

j j j jkf

j j j jkf

j j j jkf

x y x y

x y x k y f

x y x k y f

x y x k y f

Page 91: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar basis for non-standard decomposition (cont’d)

( ) ( )ji jix x

( ) ( )ji jix x

V2

Page 92: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Haar basis for non-standard decomposition (cont’d)

000 ( , ) ( , )

( , ) 2 (2 ,2 )

( , ) 2 (2 ,2 )

( , ) 2 (2 ,2 )

j j j jkf

j j j jkf

j j j jkf

x y x y

x y x k y f

x y x k y f

x y x k y f

LL

LH: intensity variations along columns (horizontal edges)

HL: intensity variations along rows (vertical edges)

HH: intensity variations along diagonals

LL: average Detail coefficients

• Three sets of detail coefficients (i.e., subband encoding)

Page 93: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D DWT using filter banks (analysis)

LL LH

HL HH

Page 94: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D DWT using filter banks (analysis)

LLH LHV HLD HH

The wavelet transform is applied again on the LL sub-image

LL LLLH

HL HH

Page 95: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D DWT using filter banks (analysis)

Page 96: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

2D Inverse DWT using filter banks (synthesis)

H LHV HLD HH

Page 97: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Wavelets Applications

• Noise filtering

• Image compression– Fingerprint compression

• Image fusion

• RecognitionG. Bebis, A. Gyaourova, S. Singh, and I. Pavlidis, "Face Recognition by Fusing Thermal Infrared and Visible Imagery", Image and Vision Computing, vol. 24, no. 7, pp. 727-742, 2006.

• Image matching and retrieval Charles E. Jacobs Adam Finkelstein David H. Salesin, "Fast

Multiresolution Image Querying", SIGRAPH, 1995.

Page 98: Wavelets (Chapter 7) CS474/674 – Prof. Bebis. STFT (revisited) Time/Frequency localization depends on window size. Once you choose a particular window.

Fast Multiresolution Image Querying

painted low resolution target

queries

Charles E. Jacobs Adam Finkelstein David H. Salesin, "Fast Multiresolution Image Querying", SIGRAPH, 1995.