Signal Processing With Wavelet
Signal Processing With Wavelet
Objectives
• Define and illustrate the difference between a stationary
and non-stationary signal.
• Describe the relationship between wavelets and sub-
band 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.
Motivation for Wavelet Analysis
• Signals of practical interest are usually non-
stationary, meaning that their time-domain and
frequency-domain characteristics vary over short
time intervals (i.e., music, seismic data, etc)
• Classical Fourier analysis (Fourier transforms)
assumes a signal that is either infinite in extent
or stationary within the analysis window.
• Non-stationary analysis requires a different
approach: Wavelet Analysis
• Wavelet analysis also produces better solutions
to important problems such as the transform
compression of images (jpeg versus jpeg2000)
CHIRP SIGNALS
0.8 0.8
0.6 0.6
0.4 0.4
Magnitud
Magnitud
100 100
Magnitud
Magnitud
0.2 0.2
0 0
e
e
e
e
-0.2 -0.2
50 50
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
-1 0 -1 0
0 0.5 1 0 5 10 15 20 25 0 0.5 1 0 5 10 15 20 25
Time Frequency (Hz) Time Frequency (Hz)
A function of time
and frequency
DRAWBACKS OF STFT
• Unchanged Window
• Dilemma of Resolution
– Narrow window -> poor frequency resolution
– Wide window -> poor time resolution
• Heisenberg Uncertainty Principle
– Cannot know what frequency exists at what time intervals
3. Admissible condition | (t ) |
2
| (t ) | dt
2
1 t b
W ( a, b)
f (t ) *
|a| a
dt
Low-Pass Down-
Sample Approximation (A)
Filter 2X
Signal
Down-
High-Pass Sample
Detail (D)
Filter 2X
0.5
0.5
0
0
-0.5
-0.5 -1
0 5 10 0 5 10
0.5
0.5
0
0
-0.5
-0.5 -1
0 5 10 0 5 10
The four filters for db5
Example:
Filter Set for the Daubechies-5 Wavelet Family
>> fvtool(Lo_D,1,Hi_D,1)
>> fvtool(Lo_R,1,Hi_R,1)
1 1
Magnitude
Magnitude
0.5 0.5
0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Normalized Frequency ( rad/sample) Normalized Frequency ( rad/sample)
Signal
A1 D1
A2 D2
The decomposition tree
can be schematically
described as:
A3 D3
Aj = Aj + 1 + D j + 1
Multi-level Decomposition of a Signal with Wavelets
Frequency Domain (Sub-band Coding)
A2 D2 D1
Original Signal
5
-5
0 50 100 150 200 250 300 350 400 450
10
One Level Approximation Single level discrete
wavelet decomposition
0
with the Daubechies-8
-10
0 50 100 150 200 250 wavelet family
One Level Detail
2
-2
0 50 100 150 200 250
One-Level Decomposition of a Non-Stationary Signal
-1
0 100 200 300 400 500 600 700 800
One Level Approximation
2
The detail 0
coefficients reveal -2
0 50 100 150 200 250 300 350 400
the transitions in the One Level Detail
0.2
non-stationary signal
0
-0.2
0 50 100 150 200 250 300 350 400
De-Noising a Signal with Multilevel Wavelet Decomposition
0
with the level-4 approximation -5
0 50 100 150 200 250 300 350 400 450
coefficients (Daubechies-8 5
Reconstructed Approximation - Level 3
0
wavelets) -5
0 50 100 150 200 250 300 350 400 450
Reconstructed Approximation - Level 4
5
0
-5
0 50 100 150 200 250 300 350 400 450
Finding Signal Discontinuities
>> x=analog(100,4,40,10000);
>> x(302:305)=.25; 3 sample discontinuity
>> [A,D]=dwt(x,'db8'); at sample 302
>> subplot(3,1,1),plot(x),title('Original Signal')
>> subplot(3,1,2),plot(A),title('First Level Approximation')
>> subplot(3,1,3),plot(D),title('First Level Detail')
Original Signal
5
Daubechies-8 wavelets
0
-5
0 50 100 150 200 250 300 350 400 450
First Level Approximation
10
-10
Discontinuity response
0 50 100 150 200 250
First Level Detail in the 1st level detail
0.5
coefficients (sample
0
151 because of the 2X
-0.5
0 50 100 150 200 250
down-sampling)
Simple Signal Compression Using a Wavelet
Approximation
>> load leleccum >> a3 = appcoef(C,L,w,3);
>> x=leleccum; >> subplot(2,1,1),plot(x),axis([0,4000,100,600])
>> w = 'db3'; >> title('Original Signal')
>> [C,L] = wavedec(x,4,w); >> subplot(2,1,2),plot(A3),axis([0,4000,100,600])
>> A4 = wrcoef('a',C,L,'db3',4); >> title('Approximation Reconstruction at Level 3 Using
>> A3 = wrcoef('a',C,L,'db3',3); the Daubechies-3 Wavelet')
>> A2 = wrcoef('a',C,L,'db3',2); >> (length(a3)/length(x))*100
>> A1 = wrcoef('a',C,L,'db3',1); ans =
12.5926
Original Signal
600
500
400
300
The wavelet approximation at
200 level-3 contains only 13 % of the
100
0 500 1000 1500 2000 2500 3000 3500 4000
original signal values because of
Approximation Reconstruction at Level 3 Using the Daubechies-3 Wavelet
the wavelet down-sampling, but
600
still retains the important signal
500
400
characteristics.
300
200
100
0 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')
1500
These are the A3 and D3
1000 coefficients for the signal.
500 Many of the D3
0 coefficients could be
0 100 200 300 400 500 600
“zeroed” without losing
Detail Coefficients at Level 3
50 much signal information or
power
0
-50
0 100 200 300 400 500 600
Compression by Thresholding
400
200
In this compression
83% of the coefficients 0
0 500 1000 1500 2000 2500 3000 3500 4000 4500
were set to zero, but Compressed Signal (Detail Thresholding)
99% of the energy in 600
retained.
200
0
0 500 1000 1500 2000 2500 3000 3500 4000 4500
Compression by Thresholding
20 20
0 0
-20
0 2000 4000 6000
-20
0 2000 4000 6000
Zeroing of coefficients
40 40 by thresholding
20 20
results in effective
0 0
signal compression
-20 -20
0 2000 4000 6000 0 2000 4000 6000
50 50
0 0
-50 -50
0 2000 4000 6000 0 2000 4000 6000
MULTIRESOLUTION ANALYSIS
(MRA)
• Wavelet Transform
– An alternative approach to the short time Fourier transform
to overcome the resolution problem
– Similar to STFT: signal is multiplied with a function
• Multiresolution Analysis
– Analyze the signal at different frequencies with different
resolutions
– Good time resolution and poor frequency resolution at high
frequencies
– Good frequency resolution and poor time resolution at low
frequencies
– More suitable for short duration of higher frequency; and
longer duration of lower frequency components
COMPARSION OF
TRANSFORMATIONS
Better
frequency
resolution;
Poor time Time
resolution
• Each box represents a equal portion
• Resolution in STFT is selected once for entire
analysis
Summary
• Wavelet processing is based on the idea of sub-
band decomposition and coding.
• Wavelet “families” are characterized by the low-
pass 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.