Académique Documents
Professionnel Documents
Culture Documents
F. ASAMOAH
Department of Electrical and Computer Engineering, University of the West
Indies, T rinidad. E-mail: fasamoah@eng.uwi.tt
1 INTRODUCTION
Signal analysis has traditionally been studied by Fourier methods. However,
in recent times another concept has emerged which is increasingly being used
as an alternative to the Fourier approach; this new method is based on wavelets.
A wavelet is a wave of very short duration which has its energy concentrated
in time. Wavelet analysis is more efficient particularly where the signal being
analyzed has transients or discontinuities. Wavelet analysis is increasingly being
applied in diverse fields, including medicine and biology, geophysical signal
processing and numerical methods1–3. This paper discusses a simple decompo-
sition and reconstruction of a given discrete signal using Mallat’s algorithm4.
The field of wavelets is still being researched in universities, colleges and
industry. However, it is increasingly being taught in graduate and undergrad-
uate courses in mathematics digital signal processing and communications. The
Electrical and Computer Engineering Department of The University of the
West Indies has begun a course with final year undergraduate projects in
wavelet-based analysis of electroencephalograms (EEG) and speech waveforms.
We hope to start teaching the basics as part of the discrete signal processing
course from the next academic year. The paper presents an easy-to-implement
program (available on request) for the analysis of any one-dimensional signal.
255
H
1 0≤x≤1
Q (x)= (4)
0 0 x>1
The numerical values of c may be computed using the properties of the scaling
k
function. These values are available in the literature5,6. These coefficients are
used in the subsequent derivations. In particular, we shall use Daubechies
coefficients of order 8, D8 in the computations which follow. This is without
loss of generality. These are given below:
D8 coeYcients
c =0.325803428051 c =1.010945715092
0 1
c =0.892200132846 c =−0.039575026236
2 3 (5)
c =−0.264507167369 c =0.043616300475
4 5
c =0.046503601071 c =−0.014986989330
6 7
The D8 wavelet is shown in Fig. 1.
3 SIGNAL DECOMPOSITION
One of the main applications of wavelets is the decomposition of a signal into
levels or scales. (This is similar to the decomposition of a signal into its Fourier
components or harmonics.) The number of levels depends on the length of the
signal. A signal with 2N values is decomposed into (N+1) levels.
Let the signal be denoted by g(x). Then the decomposed signal is given by
3
g(x)=a Q(x)+a W (2x)+ ∑ a W [2x−(i−2)]
0 1 i
i=2
7 2N−1−1
+ ∑ a W [4x−(i−4)]+ ··· + ∑ a W [2N−1x−(i−2N−1)] (6)
i i
i=4 i=2N−1
i.e.
g(x)=g (x)+g (x)+g (x)+ ··· +g (x) (7)
1 2 3 N+1
where g (x), i=1, 2, ..., N+1 represents the decomposed signal at the ith level.
i
The coefficients, a , are calculated using Mallat’s algorithm4.
i
4 TRANSFORMATION MATRICES
The calculation of the coefficients a requires the transformation matrices L
i i
and H , i=1, 2, ..., N, where the dimensions of L and H are (2i−1×2i). L and
i i i
H are formed from the low-pass and high-pass Daubechies filter coefficients
respectively.
Let
c=[c c c c c c c c ] (8)
0 1 2 3 4 5 6 7
The elements of the first row of L are the same as the elements of c in the
i
same order as given in (8). Whenever the coefficients spill over the number of
columns of L the remaining elements are wrapped around and the terms in
i
the same column are added. If the length of the column is greater than columns
of c, the elements in the remaining columns are all zero.
A subsequent row is obtained from the previous row by shifting the elements
two columns to the right (equivalent to down-sampling). Wrap-around is
applied whenever necessary.
Example
L =[c +c +c +c c +c +c +c ] (9)
1 0 2 4 6 1 3 5 7
C D
c +c c +c c +c c +c
L = 0 4 1 5 2 6 3 7 (10)
2 c +c c +c c +c c +c
2 6 3 7 0 4 1 5
As the dimensions of L increase it becomes impractical to write down the
i
matrix as done above. However, a simple computer program can be written to
form the required matrix. As an example, consider the formation of L which
10
L10=zeros(512,1024);
c=[c0 c1 c2 c3 c4 c5 c6 c7];
for k=1:509
L10(k,2*k−1:2*k+6)=c;
end
for k=1:3
L10(k+509,2*k+1017:1024)=c(1:8−2*k);
L10(k+509,1:2*k)=c(9−2*k:8);
end
d=[−c c −c c −c c −c c ] (11)
7 6 5 4 3 2 1 0
Each H is exactly the same as the corresponding L but with each element c(i)
i i
replaced by d(i).
Example
H =[d +d +d +d d +d +d +d ] (12)
1 0 2 4 6 1 3 5 7
A B
N
A =H a L , k=0, 1, 2, ..., N−1
k k i (15)
i=k+1
H =A , H =1
N N 0
The wavelet coefficients are computed as follows:
a(1)=(1/2N)A y
0
a(2)=(1/2N)A y
1
[a(3) a(4)]T=(1/2N−1)A y
2 (16)
e
[(a(2N−3+1) ··· a(2N−2)]T=(1 )A y
4 N−1
[a(2N−2+1) ··· a(2N)]T=(1 )A y
2 N
This can also be written in compact form, as shown below.
Define the (2N×2N) matrix G as
CD
A
0
A
1
G= e (17)
A
N−1
A
N
Then
a=DGy (19)
Then
y =(A )Ta(1)
1 0
y =(A )Ta(2)
2 1
C D
a(3)
y =(A )T
3 2 a(4)
(20)
e
C D
a(2N−1+1)
y =(A )T e
n+1 N
a(2N)
Then the (N+1) levels of the decomposed signal are given by the [(N+1)×2N]
matrix U, where
U=FPG (22)
Row 1 of U gives level 1 of the decomposed signal, row 2, level 2, etc. Let V
be a [1×(N+1)] row vector, and Y, the reconstructed signal. Then Y is given
by
Y =V U (23)
6 EXAMPLE
Fig. 2 is a 512 (=29) data represented as a triangular waveform. The above
derivations and equations were implemented using MATLAB. Fig. 3 shows the
ten levels of the decomposed signal. Fig. 4 is the reconstructed signal, obtained
by adding all ten levels. A 3-dimensional plot of the matrix U is shown in
(j)
FIG. 3 Decomposed signals: (a) level 1; (b) level 2; (c) level 3; (d) level 4;
(e) level 5; (f) level 6; (g) level 7; (h) level 8; (i) level 9; (j) level 10.
Fig. 5. This shows the relative contributions of all the levels. It can be seen
that the contributions from levels 8, 9, and 10 are insignificant; Fig. 6 is the
approximate reconstructed signal, neglecting these levels. Fig. 7 shows levels 8,
9, and 10 plotted with the vertical axis expanded. The transition points are
clearly shown in these plots. This property of wavelets can be used in appli-
cations such as edge detection, and determination of regions of sudden changes
in a set of data.
FIG. 7 Expanded y-axis for (a) level 8; (b) level 9; (c) level 10.
7 CONCLUSIONS
Matrix equations have been derived for the wavelet coefficients of a signal of
length 2N. The levels of the decomposed signal have also been expressed as a
simple matrix equation. These two equations can be applied to any signal of
length 2N. Once the signal wavelet coefficients have been obtained, applications
such as approximation, denoising, etc. can be implemented.
In the example given, it can be seen that the waveform can be reconstructed
to give a reasonable approximation by summing levels 1 to 7 only. Thus the
approximate signal is obtained by using only 64 out of the 512 wavelet
coefficients. If this signal were to be transmitted, it implies that the total
transmission time would be one-eighth (1/8) of the time required compared
with the transmission of the original 512-point data. The signal would then be
reconstructed at the receiving end by using the reconstruction equation.
A more realistic case is where the coefficients to be transmitted are located
randomly. In such a situation two sets of numbers would have to be transmitted:
the value of the actual coefficient, and an integer value giving its position. The
coefficients are then placed at their exact locations to form the matrix P at the
receiving end. The received signal would then be reconstructed from equa-
tion (22) but now all the (N+1) rows are added together.
The approach discussed in this paper can be extended to two-dimensional
data such as images with slight modifications. This would be similar to the
extension of one-dimensional FFT to two-dimensional FFT.
REFERENCES
[1] Rioul, O. and Vetterli, M., ‘Wavelets and signal processing’, IEEE Spectrum, 10, pp. 14–38
(1991)
[2] Bruce, M., Donoho, D. and Gao, H.-Y., ‘Wavelet analysis’, IEEE Spectrum, 10, pp. 26–35
(1996)
[3] Akay, M., ‘Wavelet applications in medicine’, IEEE Spectrum, 5, pp. 50–56 (1997)
[4] Mallat, S., ‘A theory of multiresolution signal decomposition, the wavelet representation’,
IEEE T rans. Pattern Anal. Machine Intelligence, 11, pp. 674–93 (1989)
[5] Newland, D. E., An Introduction to Random V ibrations, Spectral and Wavelet Analysis, John
Wiley, Ch. 17, pp. 295–339 (1994)
[6] Daubechies, I., ‘Orthonormal bases of compactly supported wavelets’, Comm. Pure Appl.
Maths, 41, pp. 909–996 (1988)