0% found this document useful (0 votes)
67 views

THE Discrete Wavelet Transform

This document introduces the discrete wavelet transform (DWT) and compares it to the Fourier transform. The DWT uses compact basis functions localized in both time and frequency, allowing it to obtain both time and frequency information about a signal. In contrast, the Fourier transform basis functions are not localized in time. The DWT provides better time resolution at high frequencies and better frequency resolution at low frequencies through its tiling of the time-frequency plane. It represents a signal as a linear combination of wavelet basis functions at different scales or frequencies.

Uploaded by

Sandra Jean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

THE Discrete Wavelet Transform

This document introduces the discrete wavelet transform (DWT) and compares it to the Fourier transform. The DWT uses compact basis functions localized in both time and frequency, allowing it to obtain both time and frequency information about a signal. In contrast, the Fourier transform basis functions are not localized in time. The DWT provides better time resolution at high frequencies and better frequency resolution at low frequencies through its tiling of the time-frequency plane. It represents a signal as a linear combination of wavelet basis functions at different scales or frequencies.

Uploaded by

Sandra Jean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

.

4
THE
DISCRETE
WAVELET
TRANSFORM

4–1
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–2

§4.1 INTRODUCTION TO DISCRETE WAVELET THEORY


The best way to introduce wavelets is through their comparison to Fourier transforms, a common
signal analysis tool. Wavelet and Fourier transforms represent a signal through a linear combination
of their basis functions. For Fourier transforms, the basis functions are dilations of cosine and
sine signals (each spanning the entire time interval). For wavelet transforms, they are different
translations and dilations of one function termed the Mother wavelet along with a scaling function
(each spanning a logarithmically reduced subinterval). The dilations of both sets of basis functions
are possible due to their frequency localization, thus allowing us to obtain frequency information
about the signal being analyzed. This leads to the most important difference between the two sets
of basis functions, time localization. The wavelet transform basis functions are compact, or finite in
time, while the Fourier sine and cosine functions are not. This feature allows the wavelet transform
to obtain time information about a signal in addition to frequency information.

Figure4.1 STFT and DWT Frequency/Time Tiling

Fourier transforms are also capable of obtaining time information about a signal if a windowing
procedure is used to create a Short Time Fourier transform (STFT). The window is a square wave
which truncates the sine or cosine function to fit a window of a particular width. Since the same
window is used for all frequencies, the resolution is the same at all positions in the time-frequency
plane as seen in figure test. The discrete wavelet transform (DWT), on the other hand, has a
window size that varies frequency scale. This is advantageous for the analysis of signals containing
both discontinuities and smooth components. Short, high frequency basis functions are needed for
the discontinuities, while at the same time, long low frequency ones are needed for the smooth
components. This is exactly the type of time-frequency tiling you get from wavelet transforms.
Figure 4.1 depicts this relationship by showing how the time resolution gets finer as the scale (or

4–2
4–3 §4.1 INTRODUCTION TO DISCRETE WAVELET THEORY

(a)

t
t0

f f

t t
(b) t0 (c) t0

f f

t t
(d) t0 (e) t0

Figure4.2 Frequency/Time Tiling of a Discrete Signal. (a) Sine Signal with Discontinuity (b)
Identity Transform (c) Discrete Fourier Transform (d) Short Time Fourier Transform (e) Discrete
Wavelet Transform

frequency) increases. Each basis function is represented by a tile, where the shading corresponds
to the value of the expansion coefficient.
An example of this representation is provided by the analysis of a discrete sine signal (with a
discontinuity) portrayed in Fig. 4.2(a)-(d). The upper two figures, (b) and (c), display the identity
and discrete Fourier transform of the given signal. The first is able to isolate the location of the
impulse while the second is able to isolate the frequency band of the sine signal, neither is able
to do both. By using a windowing function with the Fourier transform (d) , one is now able to
see both the impulse and frequency of the sine signal, but with a loss of resolution. The wavelet

4–3
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–4

transform (e), on the other hand, is able to achieve better localization of the time-domain impulse
with a slightly inferior frequency resolution. For a higher-frequency sine function, however, the
frequency localization would be much worse when using a wavelet transform. From this example,
one can see some of the trade-offs between wavelet and Fourier transforms.
An important feature of both wavelet and Fourier transforms is the orthogonality of their basis
functions, which allows for a unique representation of the signal being analyzed. Orthogonality
enables any function, f , to be represented by:

!
f = < f, x > x (4.1)
x

where x are the basis functions and < f, x > is the inner product of f and x. Resulting from this is
Parseval’s theorem, which relates the energy of the original signal to that of the transformed signal:

!
|| f ||2 = | < f, x > |2 (4.2)
x

The relation states that the energy of the original time series is preserved in the transform coeffi-
cients. This means that the choice of the orthogonal basis you use determines whether the energy
decomposition with respect to the transformed coefficients provides interesting information about
the original time series.
Using equation (4.1), a function, f , can be represented by either wavelet or Fourier basis functions:

!
W avelet : f (t) = < f (t), ψ(2 J t − k) > ψ(2 J t − k)
J,k
!
= b0 φ(t) + b2 J +k · ψ(2 J t − k)
J,k
! (4.3)
− jmω0 t − jmω0 t
Fourier : f (t) = < f (t), e >e
m
!
= am e− jmω0 t
m

where ψ are the dilated and translated wavelet basis functions, φ is the scaling function (also a
wavelet basis function), and e− jmω0 t are the Fourier basis functions. The result of the inner product
of f with the basis functions is the transform of that signal, a, termed either the wavelet or Fourier
coefficients. In order to understand the structure of the wavelet transform, we can arrange the
wavelet coefficients into the following form:

4–4
4–5 §4.1 INTRODUCTION TO DISCRETE WAVELET THEORY

f wav (t) = b0 φ(t) + b1 ψ(t)

" #
ψ(2t)
+ [b2 b3 ]
ψ(2t − 1)

  (4.4)
ψ(4t)
 ψ(4t − 1) 
+ [b4 b5 b6 b7 ]  +
ψ(4t − 2)
ψ(4t − 3)

+ .... + b(2 j +k) ψ(2 J t − k)

Observe that the first two terms associated with the scaling function φ(t) and mother wavelet ψ(t)
span the entire time, e.g., 0 ≤ t ≤ 1. The functions associated with the next two terms, viz., ψ(2t)
and ψ(2t − 1), span 0 ≤ t ≤ 1/2 and 1/2 ≤ t ≤ 1, respectively, and similarly for subsequent terms
with each spanning smaller and smaller intervals without overlap, thus revealing the orthogonality
of the local basis functions. Qualitatively speaking, the φ(t)-term associated with the coefficient
b0 is an averaged value of f (t) whereas the wavelet ψ(t) associated with the coefficient b1 may
be viewed as a differencing operator spanning the entire range of t. Similarly, the next-level terms
[ψ(2t) ψ(2t − 1)] associated with [b2 b3 ] are again differencing operators, each spanning half of
the range without overlap, and so on. Hence, each additional level added to the series picks out the
details left out from the series approximation.
Unlike the Fourier basis functions, there are an infinite number of possible sets of wavelet basis
functions. A wavelet is formed from a set of filter coefficients that must satisfy a given set of
conditions (see the four conditions in page xx of Strang and Nguyen). Any set of filter coefficients
which satisfy the given conditions can be used to create a wavelet function. The scaling function,
or Father wavelet, of order N is then created from a dilation equation:

N −1
!
φ(t) = ck φ(2t − k) (4.5)
k=0

where ck are the filter coefficients. The wavelet functions can then be generated via:

N −1
!
ψ(t) = (−1)k ck φ(2t + k − N + 1) (4.6)
k=0

whose scaling and the wavelet functions must also satisfy certain normalization and orthogonaliza-
tion constraints.
As mentioned previously, there are an infinite number of possible mother wavelets. Figure 4.3
shows four of the more common ones: the Haar wavelet (also Daubechies order 2 wavelet), the

4–5
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–6

Daubechies order 4 wavelet, the Coiflet order 3 wavelet, and the Symmlet order 8 wavelet. The
order indicates how smooth the wavelet is. It is apparent in Fig. 4.3, that a higher order, like the
Symmlet 8 wavelet, means a smoother function, but it also means less compactness in time. The
choice and order of the wavelet to be used should depend on the dominant features of the signal
being analyzed. The basis functions should match the signal as closely as possible.

Figure 4.3 Mother Wavelet Basis Functions

To demonstrate the need for an appropriate choice of wavelet and illustrate the time/frequency
nature of the wavelet transform, a Doppler signal is analyzed. Figure 4.4 shows the original signal
and the wavelet transform using both the Haar and Symmlet 8 wavelets. A plot of the wavelet
coefficients does not provide much insight. In order to get a better understanding, the individual
frequency levels are separated out and the wavelet coefficients plotted as a function of time as shown
in Figs. 4.5 and 4.6. Each frequency band spans the entire length of time, but with less and less
time resolution as the frequencies get lower. On the other hand, as the frequencies getthe width
of the frequency bands also decrease, meaning that more frequency resolution is provided. The
magnitude of each wavelet coefficient is indicated by the height of the line representing it. In the
Symmlet 8 transform, the nature of the Doppler signal is shown, the decrease in frequency with
time is apparent by the sliding of the wavelet coefficients with each increase in frequency level. The

4–6
4–7 §4.2 FAST WAVELET TRANSFORM

good representation is due to the similarity between the smoothness of the wavelet basis functions
and the Doppler signal. On the opposite extreme, the Haar wavelet does not closely match the
Doppler signal at all. This is shown in Fig. 4.6, where the decreasing frequency as a function
of time is not nearly as apparent. The Haar transform does provide a good representation of how
the time resolution increases with an increase in frequency. Notice that the spacing between the
wavelet coefficients becomes smaller and smaller as the frequency bands increase.

Figure 4.4 Doppler Signal and Its Wavelet Transform

We can now see clearly an important comparison between the Fourier and the wavelet expansions
of f (t). The Fourier expansion may be advantageous in capturing frequency characteristics in
f (t) whereas the wavelet expansion directly captures the temporal properties of f (t). Hence, in
a typical signal processing of vibration data, the discrete Fourier expansion of f (t) involves first
the convolution integral in the frequency domain, usually via FFT, and then an inverse FFT. In
other words, in the Fourier expansion the data must be transformed from the time domain into the
corresponding frequency domain and then converted again back into time domain. On the other
hand, the wavelet expansion preserves the temporal nature of the data while also showing frequency
content during both the forward and inverse wavelet transforms.

4–7
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–8

S8 Wavelet Coefficients by Level


-3

-4

-5

-6

-7
Level

-8

-9

-10

-11

-12
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time

Figure 4.5 Time/Frequency Representation of Doppler Signal via S8 Wavelet Transform

§4.2 FAST WAVELET TRANSFORM


It is generally agreed that the widespread use of the FFT has been largely due to its computational
efficiency, that is, for the sampling size n = 2 J , the FFT has 12 n log2 n multiplications. In Fast
Wavelet Transform, for n data point value of f (t), viz.,

f = [ f (0), f (1), ..., f (2 J − 1)]T (4.7)

we would like to obtain the wavelet coefficients as expressed in (4.4), the wavelet coefficients
b = [b(0), b(1), ..., b(2 J − 1)]T or its inverse

b=Af ⇐ ⇒ f=Sb (4.8)

as efficiently as possible.

To this end, let us consider the Haar function which is perhaps the simplest wavelet basis function
as shown in Fig. 4.7 for L = 2 J , J = 2. The synthesis matrix S can be expressed as
 
1 1 1 0
1 1 −1 0 
S=  (4.9)
1 −1 0 1
1 −1 0 −1

4–8
4–9 §4.2 FAST WAVELET TRANSFORM

S8 Wavelet Coefficients by Level


-3

-4

-5

-6

-7
Level

-8

-9

-10

-11

-12
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time

Figure 4.6 Time/Frequency Representation of Doppler Signal via Haar Wavelet Transform

Note that the first column in the above matrix, S(1 : 4, 1) = [1, 1, 1, 1]T , corresponds to the
value of the scaling function {φ(t), 1 ≤ t < 1} as its magnitude remains for the entire time
interval. The second column S(1 : 4, 2) = [1, 1, −1, −1]T corresponds to the value of the wavelet
function {w(t), 1 ≤ t < 1} as its magnitude is 1 for {1 ≤ t < 1/2} and −1 for {1/2 ≤ t < 1}.
The third column S(1 : 4, 3) = [1, −1, 0, 0]T corresponds to the value of the wavelet function
{w(2t), 1 ≤ t < 1/2} as its magnitude is 1 for {1 ≤ t < 1/4} and −1 for {1/4 ≤ t < 1/2}. Finally,
the fourth column S(1 : 4, 4) = [0, 0, 1, −1]T corresponds to the value of the wavelet function
{w(2t − 1), 1/2 ≤ t < 1} as its magnitude is 1 for {1/2 ≤ t < 3/4} and −1 for {3/4 ≤ t < 1}.
For computational expediency as well as for incorporating
√ the Parseval theorem, let us introduce a
modified expression for S with a scale factor (1/ 2) as:

 
r2 r2 r 0
 r2 r2 −r 0 
S4 =  2  (4.10)
r −r 2 0 r
r2 −r 2 0 −r

which gives unit vectors in the columns and rows since 2r 2 = and 4r 4 = 1.
The key aspect that leads to the Fast Wavelet Transform is because, like in the FFT, A can be
rearranged as a product of two matrices:

4–9
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–10

Figure 4.7 Haar Scaling Function and Wavelets

     
r r 0 0 1 0 0 0 r r 0 0
r −r 0 0  0 0 1 0   r −r 0 0
S4 =  · · 
0 0 r r 0 1 0 0 0 0 1 0
0 0 r −r 0 0 0 1 0 0 0 1
(4.11)
⇓⇓

" # " # " #


S2 0 S 0 r r
S4 = · P4 · 2 , S2 =
0 S2 0 I2 r −r

For the case of 8 samples, we have

4–10
4–11 §4.2 FAST WAVELET TRANSFORM

 
r3 r3 r2 0 r 0 0 0
3 3 2
 r r r 0 −r 0 0 0 
 3 3 2 
r r −r 0 0 r 0 0 
 3 3 2 
r r −r 0 0 −r 0 0 
S8 =  3  (4.12)
r −r 3 0 r2 0 0 r 0 
 3 
r −r 3 0 r2 0 0 −r 0 
 3 3 
r −r 0 −r 2 0 0 0 r
r 3 −r 3 0 −r 2 0 0 0 −r
which can be decomposed into two-matrix product:

 
r2 0 r2 0 r 0 0 0
 r2 0 r2 0 −r 0 0 0 
 2 
" # r 0 −r 2 0 0 r 0 0 
 2 
S 0 r 0 −r 2 0 0 −r 0 0 
S8 = W8 · 2 , W8 =   (4.13)
0 I6 0 r2 0 r2 0 0 r 0 
 
0 r2 0 r2 0 0 −r 0 
 
0 r2 0 −r 2 0 0 0 r
0 r2 0 −r 2 0 0 0 −r
The matrix W8 can be expressed as
 
1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0
 
" # 0 0 0 0 1 0 0 0
 
S4 0 0 0 0 0 1 0 0
W8 = · P8 , P8 =   (4.14)
S4 0 1 0 0 0 0 0 0
 
0 0 0 1 0 0 0 0
 
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
Using (4.11), S8 can be decomposed as
"S 0
# "
S2 0
# 
2 " #
· P4 ·
 0 S2 0 I2 " # " # S2 0
S8 =   · P8 · (4.15)
S2 0 S 0 0 I6
· P4 · 2
0 S2 0 I2

For S16 , a similar decomposition leads to


" # " #
S8 S 0
S16 = · P16 · 2 (4.16)
S8 0 I14

Now, extensions to an arbitrary number of samples, L = 2 J is straightforward. Finally, it should


be pointed that the real utility of the above decompositions is to obtain the wavelet-transformed
coefficients b. This can be accomplished by invoking the relation:

4–11
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–12

b = A f, A = ST (4.17)

It must be emphasized that the fast wavelet transform algorithm detailed above for the Haar wavelet
is applicable to other wavelets.

§4.3 MALLAT’S PYRAMID ALGORITHM


In the preceding section we have presented the Fast Wavelet Transform in terms of linear algebra.
A more appealing procedure was presented by S. Mallat in 1989 that utilizes the decomposition
of the wavelet transform in terms of low pass (averaging) filters and high pass (differencing)
filters. To illustrate Mallat’s pyramid algorithm, let’s reconsider the case of 8 samples. Since
{2J = 8 → J = 3}, we need three filters each for both low and high pass filters, which for the
case of Haar wavelet are expressed as

Low Pass Filters:


1
L1 = 2[1 1]
" #
1 1 1
L2 = 2 1 1
 
1 1
1  1 1 
L3 = 2  
1 1
1 1
(4.18)
High Pass Filters:
1
H1 = 2[ −1 1 ]
" #
1 −1 1
H2 = 2 −1 1
 
−1 1
1  −1 1 
H3 =  
2 −1 1
−1 1

First, we group the wavelet transformed coefficient vector b into three transform levels:

bT = [ a0 , b0 , b1 , b2 ] = [ [b0 ], [b1 ], [b2 , b3 ], [b4 , b5 , b6 , b7 ] ] (4.19)

In the pyramid algorithm, we first compute the third-level wavelet transform coefficients b J −1 =
[b4 , b5 , b6 , b7 ]T via
b2 = H3 a3 , a3 = x (4.20)

Second, we obtain the second-level averaging vector a J −1 via

a2 = L3 a3 (4.21)

4–12
4–13 §4.3 MALLAT’S PYRAMID ALGORITHM

The first-level wavelet transform coefficients b1 is now obtained by

b1 = [b3 , b3 ]T = H2 a2 = H2 L3 x (4.22)

We then compute the first-level averaging coefficients a0 via

a1 = L2 a2 = L2 L3 x (4.23)

The zeroth-level wavelet transform coefficient b0 is obtained by

b0 = b1 = H1 a1 = H1 L2 L3 x (4.24)

Finally, the zeroth-level coefficient that corresponds to the scaling function is obtained by

a0 = b0 = L1 a1 = L1 L2 L3 x (4.25)

There are wavelets whose scaling functions require more than two parameters. For example, the
Daubechies D4 wavelet scaling and wavelet functions:

!
3
D4
φ (t) = ck φ(2t − k)
k=0
1 √ 1 √
c0 = (1 + 3), c1 = (3 + 3)
4 4
1 √ 1 √
c2 = (3 − 3), c3 = (1 − 3)
4 4

(4.26)
!
3
D4
ψ (t) = h k φ(2t − k)
k=0
1 √ 1 √
h 0 = −c3 = (1 − 3), h 1 = c2 = (3 − 3)
4 4
1 √ 1 √
h 2 = −c1 = (3 + 3), h 3 = c0 = (1 + 3)
4 4

4–13
Chapter 4: THE DISCRETE WAVELET TRANSFORM 4–14

The corresponding low and high pass filters are constructedd as

Low Pass Filters:


1
L1 = [ c3 c2 c1 c0 ] ⇒ 12 [ c3 + c1 c2 + c0 ] (due to wrap around)
2
" # " #
1 c3 c2 c1 c0 1 c3 c2 c1 c0
L2 = 2 ⇒2 (wrap around)
c3 c2 c1 c0 c1 c0 c3 c2
 
c3 c2 c1 c0
 c3 c2 c1 c0 
L 3 = 12  
c3 c2 c1 c0
c1 c0 c3 c2
(4.27)
High Pass Filters:
1
H1 = 2[ h 3 h 2 h 1 h 0 ] ⇒ 12 [ h 3 + h 1 h 2 + h 0 ] (due to wrap around)
" # " #
1 h3 h2 h1 h0 1 h3 h2 h1 h0
H2 = 2 ⇒2
h3 h2 h1 h0 h1 h0 h3 h2
 
h3 h2 h1 h0
 h3 h2 h1 h0 
H3 = 12  
h3 h2 h1 h0
h1 h0 h3 h2

For the Daubechies wavelet, the Mallat algorithm detailed in (4.20) - (4.25) is equally applicable.
We now formalize Mallat’s pyramid algorithm for a data set with 2 J samples:

Decomposition (to obtain the wavelet transform coefficients b):


Initialize a J = x. For j = J, (J − 1), ..., 1 compute (4.28)
a j−1 = L j a j and b j−1 = H j a j

Eventually, after carrying out the necessary complex computations such as de-noising and convo-
lutions, one would like to reconstruct the desired signal for subsequent signal processing or future
applications. The reconstruction is simply a transposition of the decomposition, which can be
summarized as

Reconstruction (to obtain the enhanced signal x):


Start with a0 and b0 , b1 , ..., b J −1 . For j = 1, 2, ..., J compute
a j = LTj a j−1 + HTj b j−1
(4.29)

x̂ = a J
where x̂ is the reconstructed signal

4–14
4–15 §4.3 MALLAT’S PYRAMID ALGORITHM

References for Wavelet Transforms

1. Graps, Amara, Summer 1995, “An Introduction to Wavelets,” IEEE Computational Sciences
and Engineering, 2, n.2, pp 50-61.

2. Strang, G., 1993, “Wavelet Transforms vs. Fourier Transforms,” Bulletin (New Series) of AMS,
28(2), pp. 288-305.

3. Mallat, S.G., 1989, “A theory for multiresolution signal decomposition: the wavelet represen-
tation,” IEEE Trans. PAMI, 11, 674-693.

4. Williams, John R., Amaratunga, Kevin, 1994, “Introduction to Wavelets in Engineering,”


International Journal for Numerical Methods in Engineering, 37, 2365-2388.

5. Daubechies, I., 1992, Ten Lectures on Wavelets, SIAM, Philadelphia, PA.

6. Daubechies, I., 1988, “Orthonormal bases of compactly supported wavelets,” Commun. Pure
Appl. Math., 41, 909-996.

7. Vetterli, M. and Kovacevic, J., 1995, Wavelets and Subband Coding, Prentice Hall, Englewood
Cliffs, NJ.

4–15

You might also like