Wavelets Transformation

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

Wavelets transformation

Václav Hlaváč

Czech Technical University in Prague


Center for Machine Perception (bridging groups of the)
Czech Institute of Informatics, Robotics and Cybernetics and
Faculty of Electrical Engineering, Department of Cybernetics
http://people.ciirc.cvut.cz/hlavac, [email protected]
Deficiencies of Fourier transform
2/33

Fourier transform and similar ones have a principal disadvantage: only the


information about the frequency spectrum is provided, and no information is


available on the time in 1D (or location in the image in 2D) at which events
occur.
One solution to the problem of localizing changes in the signal (image) is to


use the short time Fourier transform, where the signal is divided into small
windows and treated locally as it were periodic.
The uncertainty principle provides guidance on how to select the windows to


minimize negative effects, i.e., windows have to join neighboring windows


smoothly.
The window dilemma remains—a narrow window yields poor frequency


resolution, while a wide window provides poor localization.


A more complex basis functions – wavelets
3/33

The wavelet transform goes further than the short time Fourier transform.


It also analyzes the signal (image) by multiplying it by a window function




and performing an orthogonal expansion, analogously to other linear integral


transformations.
Formally, a wavelet series represents a square-integrable function with


respect a complete, orthonormal set of basis functions called wavelets,


meaning a small wave.
There are two directions in which the analysis is extended with respect to


Fourier transformation.
1. The used basis functions (wavelets) are more complicated than sines
and cosines applied in Fourier transform.
2. The analysis is performed at multiple scales.
Wavelets
4/33

Wavelets provide a localization in time (space) to a certain degree.




The entire space-frequency localization is still not possible due to the




Werner Heisenberg’s uncertainty principle.


In 1D, the shape of five commonly used basis functions in a single scale of


many scales (mother wavelets) is illustrated pictorially in a qualitative


manner;

Haar Meyer Morlet Daubechies-4 Mexican hat


Multiple scales
5/33

Modeling a spike in a function (a noise dot in an image, for example) with a




sum of a huge number of functions will be hard because of the spike strict
locality.
Functions that are already local will be naturally suited to the task.


Such functions lend themselves to more compact representation via wavelets.




Sharp spikes and discontinuities normally take fewer wavelet bases to


represent as compared to the sine-cosine basis functions in Fourier transform.
Localization in the spatial domain together with the wavelet localization in


frequency yields a sparse representation of many practical signals (images).

Sparseness opens the door to successful applications in data/image




compression, noise filtering, detecting feature points in images, etc.


Parent and daughter wavelets
6/33

Mother wavelet Ψ, a wavelet function All other derived wavelets are called
daughter wavelets.
Characterizes the basic wavelet


shape. Daughter wavelets are defined in


terms of parent wavelets with the
Covers the entire domain of


help of.
interest.
the generating (basis)


Father wavelet Φ, a scaling function
function Ψs,τ (x), where
Characterizes the basic wavelet


scale. • s characterizes the scale of


a wavelet function,
Allow to express needed details


of the approximated function in • τ characterize shifts of a


the domain of interest. wavelet function.
Continuous wavelet transforms (CWT)
7/33

Continuous shift and scale parameters are considered.




A given input signal of a finite energy is projected on a continuous family of




frequency bands (subspaces of the function space Lp in functional analysis).


For instance the signal may be represented on every frequency band of the


form [f, 2f ] for all positive frequencies f > 0.


The original signal can be reconstructed by a suitable integration over all the


resulting frequency components.


The frequency bands are scaled versions of a subspace at scale 1.


This subspace is generated by the shifts of the mother wavelet Ψ.



The mother wavelet, the illustration example
8/33
For example, let us demonstrate the Shannon mother wavelet in one frequency
band [1, 2],
sin(2πt) − sin(πt)
Ψ(t) = .
πt
1D continuous wavelet transform
9/33

A function f (t) is decomposed into a set of generating (basis) functions




Ψs,τ (t), i.e. wavelets


Z
c(s, τ ) = f (t) Ψ∗s,τ (t) dt , s ∈ R+ − {0} , τ ∈R.
R

c(s, τ ) are wavelet coefficients. The complex conjugation is denoted by ∗.


The subscripts denote: s – scale, τ – shift (translation).


Wavelets are generated from the single mother wavelet Ψ(t) by scaling s


and shifting τ ; s > 1 dilates, s < 1 contracts the signal,


 
1 t−τ
Ψs,τ (t) = √ Ψ .
s s

The coefficient 1/ s is used because the energy has to be normalized


across different scales.


Meaning of wavelet coefficients c(s, τ )
10/33

The integral R f (t) Ψ∗s,τ (t) dt from the previous slide can be interpreted as
R


the scalar (inner) product of the signal f (t) and the particular wavelet (basis
function) Ψ∗s,τ (t).
This scalar product tells to what degree is the shape of the signal similar


(correlated) to the local probe given by the particular wavelet.


The space of scales s and shifts τ is discretized in real use. This


discretization yields discrete wavelet transformation DWT. We will deal with


the discretization later.
Inverse continuous wavelet transform
11/33

The inverse continuous wavelet transform serves to synthesize the 1D signal




f (t) of finite energy from wavelet coefficients c(s, τ ),


Z Z
f (t) = c(s, τ ) Ψs,τ (t) ds dτ .
R+ R

Note:


The wavelet transform was defined generally without the need to specify a
particular mother wavelet Ψ. The user can select or design mother
wavelet Ψ according to application needs. The mother wavelet is used to
create generating (basis) functions Ψs,τ (t) used in the expansion above.
Coefficients c(s, τ ) can be interpreted as the analogy to a frequency


spectrum (spectrogram) in Fourier transform. This is illustrated in the


following transparency.
Wavelet “spectrogram” example
12/33
Q: Can any function be a mother wavelet? A: No.
13/33

The mother wavelet should be oscillatory




Z ∞
Ψ(t) d t = 0 .
−∞

Mother wavelet has to have a finite energy




Z ∞
2
|Ψ(t)| d t ≤ ∞ .
−∞
Wavelet vs. Fourier transform
14/33

Wavelet transformation: spectral (‘frequency’) information and partly the




information about the event in time (spatial coordinated in 2D).


Fourier transformation: spectral (frequency) information only.


The ‘richness’ of the wavelet transformation with respect to Fourier


transformation is not for free.

Wavelets:
are not smooth, i.e. infinitely differentiable;


loose spectral accuracy when computing derivatives;




loose useful mathematical properties of Fourier transformation as, e.g., the




convolution theorem.
Dyadic (octave) grid for scale and shift (1)
15/33

The continuous change of scale s and shift τ parameters would lead to a




very redundant signal representation.


It is convenient to change scale and shift parameters in discrete steps.


This is step towards the discrete wavelet transformation (DWT).



Dyadic (octave) grid for scale and shift (2)
16/33

It is advantageous to use special values for shift τ and scale s while defining


the wavelet basis, i.e. introducing the scale step j and the shift step k:
s = 2−j and τ = k · 2−j ; j = 1, . . .; k = 1, . . . ;
−j
   
1 t−τ 1 t−k2 j
j

Ψs,τ (t) = √ Ψ =√ Ψ =2 Ψ 2 t−k .
2
s s 2−j 2−j
j
j

Ψj,k (t) = 2 Ψ 2 t − k .
2

Example (Shannon wavelet) expanded from the slide on the page 8:




(sin(2π(2j t + k)) − sin(π 2j t + k))


j
Ψj,k (t) = 2 2
j
.
π (2 t + k)
Example, Shannon wavelet, multiple scales, shifts
scale j 17/33

0 3 6 9 shift k
Computation of the
Discrete Wavelet Transformation 18/33

1. Begins at a finest scale and a zero shift.


2. The wavelet is placed at beginning of the signal,
the inner product of the signal and the wavelet
is calculated, and integrated for all times. Finest scale, zero shift.
The result is one value of c(j, k) providing the
‘local similarity’ of a part of a signal and the
wavelet.
3. The wavelet is shifted to the right and the
One of the shifts at finest scale.
step 2 is repeated until end of the signal.
4. The courser scale is used. Steps 2-3 repeated
until all scales are used.

The output is a matrix of c values for all scales and Repeated for coarser scales.
shifts, so called spectrogram.
Wavelets properties from a user point of view (1)
19/33

Simultaneous localization in time and in the ‘frequency’ spectrogram.


The location of the wavelet allows to explicitly represent the location of


events in time (with a theoretical limit given by Werner Heisenberg’s


uncertainty principle).
The shape of the wavelet allows to represent different detail or


resolution.
Sparsity of the representation – for practical signals: Many of the
coefficients c(j, k) in a wavelet representation are either zero or very small.
Linear computational time complexity – many 1D wavelet transformations
can be accomplished in O(N ) time.
Wavelets properties from a user point of view (2)
20/33

Adaptability – wavelets can be adapted to represent a wide variety of signals,


e.g., functions with discontinuities, functions defined on bounded domains.
Suited, e.g., for tasks involving closed or open curves, images, and very


different surfaces in 3D representation.


Wavelets can represent functions with discontinuities or corners (in


images) rather efficiently. Recall that some wavelets have discontinuities


themselves (or sharp corners in 2D case).
Discrete wavelet transformation (DWT)
21/33

Uses discrete dyadic (octave) grid for scale parameter j and shift


parameter k as introduced on the slide number 16.


Forward DWT:


X j
f (t) Ψ∗j,k (t) j

c(j, k) = , where Ψj,k (t) = 2 Ψ 2 t − k .
2

as was introduced on the slide number 16.


Inverse DWT:


XX
f (t) = c(j, k) Ψj,k (t) .
k j
A. Haar and I. Daubechies wavelets
Pictorial example 22/33

Haar wavelet


Daubechies wavelet

Properties of Ingrid Daubechies’ wavelets
23/33

Ingrid Daubechies, Communications Pure Applied Math. 41 (1988), 909-996.


Compact support.


• Finite number of filter parameters / fast implementations.


• High compressibility.
• Fine scale amplitudes are very small in regions where the function is
smooth / sensitive recognition of structures.
Identical forward / backward filter parameters.


• Fast, exact reconstruction.


• Very asymmetric.
Mallat’s filter scheme
Fast Wavelet Transform 24/33

Stephane G. Mallat: A Theory for Multiresolution Signal Decomposition:




The Wavelet Representation, IEEE Transactions on Pattern Analysis and


Machine Intelligence, Vol. 11, No. 7, July 1989, pp. 674-693.
S.G. Mallat was the first who implemented the dyadic grid scheme for


wavelets using a well known filter design method called ‘two channel sub
band coder’.
This yielded a ‘Fast Wavelet Transform’.

Fast Wavelet Transform
25/33

Consider a discrete 1D signal given by the sequence s of length N which has




to be decomposed into wavelet coefficients c.


The Fast Wavelet Transform consists of log2 N steps at most.


The first decomposition step takes the input and provides two sets of


coefficients at level 1: approximation coefficients cA1 and detail coefficients


cD1.
The vector s is convolved with a low-pass filter for approximation and with a


high-pass filter for detail.


Dyadic decimation follows which down samples the vector by keeping only


its even elements. Such down sampling will be denoted by ↓ 2 in block


diagrams.
Fast Wavelet Transform, filter bank
26/33

The coefficients at level j + 1 are calculated from the coefficients at level j,




which is illustrated in the bottom-left figure.


This procedure is repeated recursively to obtain approximation and detail


coefficients at further levels. This yields a tree-like structure of filters called


filter bank.
The structure of coefficients for level j = 3 is illustrated in the bottom-right


figure.

cAj+1 cD1
low pass filter 2 s cD2
cAj
cA1 cD3
cDj+1 cA2
high pass filter 2 cA3
level j level j+1
Fast inverse Wavelet Transformation
27/33

The Fast Inverse Wavelet Transform takes as an input the approximation




coefficients cAj and detail coefficients cDj and inverts the decomposition
step.
The vectors are extended (up sampled) to double length by inserting zeros


at odd-indexed elements and convolving the result with the reconstruction


filters. Analogously to down sampling, up sampling is denoted ↑ 2 in the
block diagrams.

cAj
2 high pass filter
reconstruction cAj-1
filter
cDj
2 low pass filter

level j level j-1


Wavelets generalized to 2D
28/33

Similar wavelet decomposition and reconstruction algorithms were developed for


2D signals (images). The 2D discrete wavelet transformation decomposes a single
approximation coefficient at level j into four components at level j + 1:
1. the approximation coefficient cAj+1 and detail coefficients at three
orientations:
h
2. horizontal cDj+1 ,
v
3. vertical cDj+1 ,
d
4. and diagonal cDj+1 .

The symbol (col ↓ 2) represents down-sampling columns by keeping only even


indexed columns. Similarly, (row ↓ 2) means down-sampling rows by keeping only
evenly indexed rows. (col ↑ 2) represents up-sampling columns by inserting zeros
at odd-indexed columns. Similarly, (row ↑ 2) means up-sampling rows by
inserting zeros at odd-indexed rows.
2D discrete wavelet transform
A decomposition step 29/33

columns
cAj+1
low pass filter col 2
rows
low pass filter row 2 h
columns
cD j+1
high pass filter col 2
cAj
v
cD j+1
columns
low pass filter
col 2
rows
high pass filter
row 2 d
columns
cD j+1
high pass filter col 2

level j level j+1


Example, 2D wavelet decomposition
30/33

Right side. Four quadrants. The undivided southwestern, southeastern and northeastern
quadrants correspond to detailed coefficients of level 1 at resolution 128 × 128 in vertical,
diagonal and horizontal directions, respectively. The northwestern quadrant displays the same
structure for level 2 at resolution 64 × 64. The northwestern quadrant of level 2 shows the same
structure at level 3 at resolution 32 × 32. The lighter intensity 32 × 32 image at top left
corresponds to approximation coefficients at level 3.
Example, 2D wavelet decomposition,
another view 31/33

Another view of the same data as on previous slide. It illustrates the level of
decomposition at different levels of resolution.
2D inverse discrete wavelet transform.
A reconstruction step. 32/33

columns
cAj+1
low pass filter col 2
rows
low pass filter row 2 h
columns
cD j+1
high pass filter col 2
cAj
v
cD j+1
columns
low pass filter
col 2
rows
high pass filter
row 2 d
columns
cD j+1
high pass filter col 2

level j level j+1


Use of filter bank, illustration
33/33

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

PP
f1(t) = c(1, k) Ψ1,k (t)
k j

PP
f0(t) = c(0, k) Ψ0,k (t)
k j

You might also like