Documente Academic
Documente Profesional
Documente Cultură
Objectives
Define and illustrate the difference between a stationary
and non-stationary signal.
Describe the relationship between wavelets and subband coding of a signal using quadrature mirror filters
with the property of perfect reconstruction.
Illustrate the multi-level decomposition of a signal into
approximation and detail components using wavelet
decomposition filters.
Illustrate the application of wavelet analysis using
MATLAB to noise suppression, signal compression, and
the identification of transient features in a signal.
Wavelet Decomposition
Low-Pass
Filter
DownSample
2X
Approximation (A)
Signal
High-Pass
Filter
DownSample
2X
Detail (D)
Wavelet Reconstruction
The A and D coefficients can be used to
reconstruct the signal perfectly when run
through the mirror reconstruction filters of
the wavelet family
Wavelet Families
Wavelet families consist of a particular set
of quadrature mirror filters with the
property of perfect reconstruction.
These families are completely determined
by the impulse responses of the set of 4
filters.
Example:
Filter Set for the Daubechies-5 Wavelet Family
% Set wavelet name.
>> wname = 'db5';
% Compute the four filters associated with wavelet name given
% by the input string wname.
>> [Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(wname);
>> subplot(221); stem(Lo_D);
>> title('Decomposition low-pass filter');
>> subplot(222); stem(Hi_D);
>> title('Decomposition high-pass filter');
>> subplot(223); stem(Lo_R);
>> title('Reconstruction low-pass filter');
>> subplot(224); stem(Hi_R);
>> title('Reconstruction high-pass filter');
>> xlabel('The four filters for db5')
Example:
Filter Set for the Daubechies-5 Wavelet Family
Decomposition low-pass filter
1
0.5
0.5
0
0
-0.5
-0.5
0
10
-1
10
1
0.5
0.5
0
0
-0.5
-0.5
0
10
-1
5
The four filters for db5
10
Example:
Filter Set for the Daubechies-5 Wavelet Family
>> fvtool(Lo_D,1,Hi_D,1)
>> fvtool(Lo_R,1,Hi_R,1)
Magnitude Response
1.5
Magnitude Response
1.5
Magnitude
Magnitude
0.5
0.5
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Normalized Frequency ( rad/sample)
Decomposition Filters
0.8
0.9
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Normalized Frequency ( rad/sample)
Reconstruction Filters
0.8
0.9
A1
A2
A3
D1
D2
D3
Aj = Aj +1 + D j +1
A2
D1
D2
fs/8
fs/4
fs/2
5
0
-5
50
100
150
200
250
300
350
400
450
10
0
-10
50
100
150
200
250
200
250
2
0
-2
50
100
150
Original Signal
1
0
-1
100
200
The detail
coefficients reveal
the transitions in the
non-stationary signal
300
400
500
600
700
800
300
350
400
300
350
400
0
-2
50
100
150
200
250
0.2
0
-0.2
50
100
150
200
250
0
-10
5
0
-5
Original Signal
10
5
0
-5
5
0
-5
5
0
-5
50
100
150
200
250
300
350
Reconstructed Approximation - Level 1
400
450
50
100
150
200
250
300
350
Reconstructed Approximation - Level 2
400
450
50
100
150
200
250
300
350
Reconstructed Approximation - Level 3
400
450
50
100
150
200
250
300
350
Reconstructed Approximation - Level 4
400
450
50
100
400
450
150
200
250
300
350
3 sample discontinuity
at sample 302
Original Signal
Daubechies-8 wavelets
0
-5
50
100
150
200
250
300
350
400
450
10
0
-10
50
100
150
200
250
200
250
0.5
0
-0.5
50
100
150
Discontinuity response
in the 1st level detail
coefficients (sample
151 because of the 2X
down-sampling)
>> a3 = appcoef(C,L,w,3);
>> subplot(2,1,1),plot(x),axis([0,4000,100,600])
>> title('Original Signal')
>> subplot(2,1,2),plot(A3),axis([0,4000,100,600])
>> title('Approximation Reconstruction at Level 3 Using
the Daubechies-3 Wavelet')
>> (length(a3)/length(x))*100
ans =
12.5926
Original Signal
600
500
400
300
200
100
600
500
1000
1500
2000
2500
3000
3500
4000
500
400
300
200
100
500
1000
1500
2000
2500
3000
3500
4000
Compression by Thresholding
>> load leleccum
>> x=leleccum;
>> w = 'db3'; % Specify the Daubechies-4 wavelet
>> [C,L] = wavedec(x,4,w); % Multi-level decomposition to 4 levels.
>> a3 = appcoef(C,L,w,3); % Extract the level 3 approximation coefficients
>> d3 = detcoef(C,L,3);
% Extract the level 3 detail coefficients.
>> subplot(2,1,1), plot(a3),title('Approximation Coefficients at Level 3')
>> subplot(2,1,2), plot(d3),title('Detail Coefficients at Level 3')
Approximation Coefficients at Level 3
2000
1500
1000
500
0
100
200
300
400
500
600
500
600
50
-50
100
200
300
400
Compression by Thresholding
>> load leleccum
>> x=leleccum; % Uncompressed signal
>> w = 'db3';
% Set wavelet family
>> n=3;
% Set decomposition level
>> [C,L] = wavedec(x,n,w); % Find the decomposition
structure of x to level n using w.
>> thr = 10; % Set the threshold value
>> keepapp = 1; %Logical parameter = do not
threshold approximation coefficients
>> sorh='h'; % Use hard thresholding
>> [xd,cxd,lxd, perf0,perfl2]
=wdencmp('gbl',C,L,w,n,thr,sorh,keepapp);
600
400
In this compression
83% of the coefficients
were set to zero, but
99% of the energy in
the signal was
retained.
200
0
500
1000
1500
2000
2500
3000
3500
4000
4500
4000
4500
600
400
200
0
500
1000
1500
2000
2500
3000
3500
Compression by Thresholding
>> D1 = wrcoef('d',C,L,w,1);
>> D2 = wrcoef('d',C,L,w,2);
>> D3 = wrcoef('d',C,L,w,3);
>> d1 = wrcoef('d',cxd,lxd,w,1);
>> d2 = wrcoef('d',cxd,lxd,w,2);
>> d3 = wrcoef('d',cxd,lxd,w,3);
Original Detail - Levels 3 to 1
40
20
20
-20
2000
4000
6000
-20
40
40
20
20
-20
2000
4000
6000
-20
50
50
-50
2000
4000
6000
-50
2000
4000
6000
2000
4000
6000
2000
4000
6000
Zeroing of coefficients
by thresholding
results in effective
signal compression
Summary
Wavelet processing is based on the idea of subband decomposition and coding.
Wavelet families are characterized by the lowpass and high-pass filters used for
decomposition and perfect reconstruction of
signals.
Typical applications of wavelet processing
include elimination of noise, signal compression,
and the identification of transient signal features.