You are on page 1of 25

CH.

5
Wavelet Transform
WT
• OVERVIEW
❑ Fourier Analysis .
❑ its limitations.
➢ Cannot not provide simultaneous time and frequency
localization.
❑ Example in matlab
❑ Short Time Fourier Transform (STFT).
❑ Example in matlab
❑ Choosing Window W(t):STFT Window Size

• Wide window → good frequency resolution,


poor time resolution.
• Narrow window → good time resolution, poor
frequency resolution.
• Another disadvantage of the STFT deals with the nature of the basis
functions used.in.the.FT .i.e. complex exponentials.

The term 𝑒 −j2.πft describes sinusoidal variations in.real and complex spaces
.
1

0.5 35

0 30

-0.5 25

20

amplitude
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
15

150 10

5
100
0
20
18
50 16
500
14 450
12 400
10 350
8 300
0 6
250
❑ EXAMPLE IN MATLAB :SHOW size of window.
❑ Choosing Window W(t)

• What shape should it have?


– Rectangular, Gaussian, Elliptic…?
• How wide should it be?
– Window should be narrow enough to make sure that the
portion of the signal falling within the window is
stationary.
– Very narrow windows do not offer good localization in
the frequency domain.
❑ These two disadvantages of the STFT lead us to the definition
of the WT that is Extremely useful for biomedical applications
❑ Wavelet Transform: wavelets use multiple window sizes to
deal with this issue.
❑ Time-frequency representation (e.g. STFT, Wavelet) is the
representation that combine the features of f(t) and f(w)
into a single function.
Time, Frequency, STFT, and
Wavelet Representation
Key wavelet concepts:
1:scaling :”high frequency → Low scale factor”
Wavelet 2 4 8 16
scale equ.
Freq. Feq\2 F eq \4 F eq\8 F eq\16

2:shifting.
5.3 ONE-DIMENSIONAL CONTINUOUS WAVELET
TRANSFORM
Before introducing WT we need to take a closer look at the basic definition of “frequency”as.the.fundamental
concept.of.the.FT..We.need.to.focus.on.the.definition of frequency.at this.point.because.we are to.use.time-
limited.basis.functions for the new transform as opposed to the periodic.time-unlimited functions used in the FT.
therefore,we.need.to invent.a.new.concept that.can.represent.a.concept.similar.to.frequency
to.fnd.a.replacement.for.frequency, we need to see what.interesting features are captured by frequency
Consider.a.sinusoidal.basis.function.with.frequency.0.1.Hz..Having.a.basis.function.with.this.frequency,.another
basis.function.in.the.Fourier.decomposition.of.the.signal.would.be.the.second.harmonic.of this. basis. function,.
i.e.,. a. sinusoidal. basis function. with. frequency. 0.2.Hz..
The.Harmonic relation.among.the.basis.signals is the.fundamental.concept of signal
Transformation and decomposition. Therefore,. the. relation. among. harmonics is
something.that.we need to somehow represent by our new concept that will replace
frequency.
Replacing the time axis “t”.in.the original signal with “2t”.time.axis.results.in.the
second harmonic..This.is.essentially “scaling”.the signal
In time to.generate other basis functions.

The interesting.part.is.that unlike frequency that is defned only for periodic signals,
scale is.equally applicable to nonperiodic signals This proves that we.have found a.new
concept .i.e.,scale to replace frequency Using.scale as a variable, the new transform
which will.be based on.time-limited basis function can be meaningfully applied to both
time-unlimited and time-limited signals.

With the. introduction. provided. earlier,. we. are ready to defne the continuous.
wavelet.transform.(CWT).of.a.time.signal.x(t).as.follows:

This function is often.referred.to as the mother wavelet


Now that we.have discussed the.analysis.equation.or.the.CWT,.it.is.the.best.time.
to.describe.the.synthesis.equation.that.allows.forming.the.time.signal.based.on.its.
WT..The inverse continuous wavelet transform or ICWT.is.defned.as

Any choice.of the.mother.wavelet.gives.certain.unique.properties.that.make.the.


resulting.transformation.a.suitable.choice.for.a.particular.task..A.mother.wavelet
called a Mexican hat is.shown.in. this Figure
The most logical question at this point is how to choose a
mother wavelet for aparticular application?

This question to the most part is an open problem,.and.it.does.


not.appear.to.have.a.defnite.answer..However,.two.intuitive.rules.of.thumb.are.widely.
followed.when.choosing.a.mother.wavelet:.
(1)complex.mother wavelets.are needed.for.
complex.signals.(as.discussed.earlier).and
(2)the.mother wavelet that resembles the
general.shape.of.the.signal.to.be.analyzed.would.be.a.more.suitable choice
➢ A.closer.look.at.the.CWT.reveals.that.this.transformation.requires.the.calculations.
based on.all.continuous.shifts and all continuous scales. This
obviously.makes.the.computational.complexity.of.the.CWT and the ICWT unsuitable
for many practically important Applications This leads us to the discrete version
of this transform.
ONE-DIMENSIONAL DISCRETE WAVELET TRANSFORm

Discrete.wavelet.transform.(DWT).accepts.continuous.signals.and.applies.only.discrete
.shifts.and.scales.to.form.the.transform..This.means.that.if.the.original.signal.
is.sampled.with.a suitable.set.of.scaling.and shifting,.the.entire.continuous.signal.
can.be.reconstructed from the DWT In.order.to.see.how this is done,.we start with
Providing the equations.for.the.DWT..Defne
where.Ψ(t).is.the.continuous.mother.wavelet,.0.≤.j.≤.N.-.1,.and.0.≤.k.≤.M.-.1..Then
the.coeffcients.of.the.DWT.are.calculated.as

From this equation.calculates.a.fnite.set.of.discrete.coeffcients.


directly.from.a.continuous.signal..This.makes.the.DWT.somewhat.different.from.the.
DFT.that.accepts.only.discrete.signals.as.its.input..The.beauty.of.the.DWT.becomes.
clearer.from.the.synthesis.equation.in.the.following:

In.this.equation,.c.is.a.constant.that.depends.on.the.exact.choice.of.the.mother.wavelet..
The.interesting.thing.about.this.equation.is.the.fact.that.we.can.reconstruct.the.continuos
signal.directly.from.a.set.of.discrete.coeffcients..This.capability.makes.the.DWT.and.the.
IDWT.particularly.interesting.and.useful.for.the.applications.where.a.continuous.signal.
must.be.decomposed.to.and.reconstructed.from.a.fnite.set.of.discrete.values.
A.relevant.question.at.this.point.is.how.to.choose.the.number.of.basis.functions.
for.a.given.signal..Specifcally,.how.many.shifted.and.scaled.versions.of.the.mother.
wavelet.are.needed.to.decompose.a.signal..We.start.this.discussion.by.describing the
difference.between.a.frame.and.a.basis..

This.set.can.be.minimal.or.nonminimal,.i.e.,.if.the.number.
of.basis.functions.in.the.frame.is.minimal.and.any.other.frame.would.need.the.same.
number.or.more.basis.functions,.the.frame.is.called.a.basis
To.see.the.differences.between.a.
frame.and.a.basis.more.clearly,.consider.the.energy.of.a.signal.x(t):

Now. consider. a. frame. Formed Based on the. functions.Ψjk(t) defned earlier For
such a frame,.it.can.be.proved.that.there.exist.some.bounded.positive.values.A.and.
B such.that
This.relation.intuitively.means.that.the.energy.of.the.wavelet.coeffcients.for.a.frame.
is.bounded.on.both.upper.and.lower.sides.by.the.true.energy.of.the.signal..In.the.case.
of.a.basis.(i.e.,.a.minimal.frame),.the.values.A.and.B.in.the.aforementioned.inequality.
become.the.same,.i.e.,.A.=.B..This.means.that.for.a.basis.we.have

This.indicates.the.energy.of.the.coeffcients.is.exactly.the.same.as.the.energy.of.the
signal.
Despite.the.usefulness.of.DWT.computed.from.continuous.signals,.this.transformation is
not very.popular..This.is.due.to.the.fact.that.the.original.time.signals.are.
often.discrete.and.not.continuous..As.a.result,.the.next.defnition.of.the.WT.that.is.
computed.over.discrete.signals.is.more popular.
5.4.1 Discrete wavelet transform on Discrete Signals

All practical.applications,.signals are


Formed of.discrete.measurements,.and.therefore.in.practice.we.normally.deal.with.
sampled.signals..This.means.that.we.need.to.focus.on.calculating.DWT.from.discrete
signals..At.this.point,.we.assume.that.the.discrete.signal,.if.sampled.from.a.continuous
signal,.has been sampled according.to the Nyquist rate (or faster) This guarantees.that
all information of the continuous.signal.is.preserved.in.the.discrete signal.

The question here. is. How to.form such basis sets Systematically?.. The. method.
described.next, called Mallat pyramidal algorithm or quadrature mirror filter (QMF)
allows systematic.creation.of.an.unlimited.number of orthogonal.basis.sets for.DWT.
Based.on the QMF.algorithm,.the.DWT.for.a.one-dimensional.(1-D).signal.is.
systematically.calculated as follows .Assuming.a.digital.flter.h(n),.we.form.another.
filter.g(n) as.follows:
Before.describing.the.IDWT,.let.us.answer.a.simple.but.fundamental.question
“What is the mother wavelet of the QMF algorithm?”. It seems that. we were so
emerged.in.the.description.of.the.algorithm.using.the.low-pass.flter.h(n).that.we.
did.not.notice.the.apparent absence of the.mother.wavelet.involved.in.the.process
The.QMF.is.indeed.based.on.a.mother.wavelet.that.is.represented.by.the.low-pass.
flter.h(n)..In.reality,.each.choice.of.this.flter.results.to.one.specifc.discrete.mother.
wavelet.Ψ(n).according.to.the.following.iterative.relations:
 Another.question,.which.is.to.the.most.part.an.open.problem,.is.as.follows:.
 “How Many decomposition levels are needed for a suitable transform?”. An. intuitive
criterion to choose.the.level of.the.decomposition.would
be.continuing.decomposition.until.the highest.known frequencies.in.the
signal.of.interest.are extracted and identified Loosely speaking,if
one.needs.to.have.more.detailed decomposition
Of the signal.in.higher.frequencies,.he or she.would.need.to.calculate.higher.levels.of.
decomposition..This simply.would.allow.more.specifc.description.of.high-frequency.
components.of.a.signal.
As. expected,. the. IDWT. is. formed. in. a. similar. multilevel. process. shown. in.
Figure.5.10
In the diagram.of.IDWT,.the.filters.h1(n).and g1(n) are defned based on h(n) and
g(n) as.follows:

As can be.seen,the.structure.and.operations in IDWT.are.very.similar.to.those.of.DWT,


and therefore,.with.some.minor.changes,the same codes written to calculate DWT.can
be.used to calculate IDWT.

An interesting feature of the DWT and IDWT is the possibility of reconstructing.


The signal only based on a few of the levels (scales) of decomposition.
• Example In Matlab “QMF”
5.6 MAIN APPLICATIONS OF DWT

The main applications of DWT.in.biomedical signal.and.image.processing.are


filtering, denoising, compression, and extraction. of. scale-based. features..
Filtering and Denoising are very similar in the sense that they both deal with
eliminating some
scales.(frequencies)from.the.signal.and.extracting.some.targeted.components..
We start.the.discussion with.denoising.and.filtering
5.6.1 filtering And Denoising
As.mentioned earlier,.it.is.often.the case.that.noise exists in.high.frequencies.
(i.e.,low.scales) of signals and.images..For instance,.electromagnetic.drifts.that.appear.
in. the. wires. and. electrodes. are. high-frequency. noise.. Such. a. noise. appears. in.
almost all.biomedical signals such.as electroencephalogram.and electrocardiogram
Example in Matlab
Two main types of DWT-based denoising are used in signal processing:
hard.thresholding.and.soft.thresholding..In.hard.thresholding,.all coeffcients.of.some
particular Levels of decomposition that.are.less.than a.threshold.are set to zero,
and.the.remaining.coeffcients.are.used.for.reconstruction.of.the.signal..In.other.words,
denoting.the.
threshold.value.as.ξ.and.the.original.coeffcients.j.at.level.k.as.djk,.the.coeffcients.after.
hard.thresholding.are.calculated.according.to.the.following.criterion:
5.6.2 compression
In.many.biomedical.applications,.long.signals.and.large.images.are.created..The.storage.o
f.all.these.signals.and.images.creates.a.serious.issue..The.main.objective.here.is.
to.design.techniques.to.reduce.the.size.of.a.signal.or.image.without.compromising.the.
information.contained.in.the.signal.or.image.
The.second.rule.for.compression.states.that.since.noise.often.corrupts.the.highfrequency.
components,.by.eliminating.too-high-frequency.components,.the.useful.
information.in.a.signal.would.not.change.considerably.
The.third.rule.for.compression.states.that.too-low-frequency.components.may.not.
contain.vital.information,.and.their.corresponding.coeffcients.can.be.eliminated.or.
reduced.in.the.compression.process.

5.7 DISCRETE WAVELET TRANSFORM IN MATLAB


Wavedemo helps the reader understand the
different DWT commands.and.options provided by.MATLAB,wavemenu provides
the means to visually conduct.almost all.aforementioned.applications of.the.DWT

You might also like