Wavelet Based Compression
Wavelet Based Compression
15 Wavelet-Based Compression
1
Origins and Applications
The Wavelet Transform (WT) is a signal processing tool that is replacing the Fourier
Transform (FT) in many (but not all!) applications.
WT theory has its origins in ideas in three main areas and now is being applied in
countless different areas of application.
Signal Decompositions
Wavelets Filter Banks
Wavelets
Applications
Data Compression Sonar/Radar Turbulence
Computer Vision Biomedical Proc. Geophysical Proc.
Denoising Signals Communications Music Processing
Etc. Etc. Etc.
2
Next
So, Whats Wrong With The FT?
First, recall the FT:
X ( f ) x (t )e j 2 ft dt
x (t ) X ( f )e j 2 ft df
Weight @ f Component @ f
Remember: An integral is like a summation So, the second equation says that
we are decomposing x(t) into a weighted sum of complex exponentials
(sinusoids!) The first equation tells what each weight should be.
3
Next
DFT Basis Functions and Time-Freq Tiles
Freq
Time
4
Next
Example: Frequency-Hopping Chirped Pulses
DFT tries to build from
freq components that
last 10 sec
Spectrogram = |X(f,t)|2
7
Illustration of Time-Frequency Resolution Trade-Off
cos(2 10t ) 0t5
cos(2 25t ) 5 t 10
x (t )
cos(2 50t ) 10 t 15
cos(2 100t ) 15 t 20
http://en.wikipedia.org/wiki/Short-time_Fourier_transform 8
STFT View of Tiling the T-F Plane
Generally only compute the STFT for discrete values of t and f
X ( f m , tn )
x ( )h( nT )e j 2 ( mF ) d
9
STFT Basis Functions and Time-Freq Tiles
Freq
Time
10
Next
STFT Disadvantages and Advantages
The fact that the STFT tiles the plane with cells having the same
t and f is a disadvantage in many application
Especially in the data compression!
This characteristic leads to the following:
If you try to make the STFT be a non-redundant decomposition (e.g.,
ON like is good for data compression
You necessarily get very poor time-frequency resolution
This is one of the main ways that the WT can help
It can provide ON decompositions while still giving good t-f resolution
However, in applications that do not need a non-redundant
decomposition the STFT is still VERY useful and popular
Good for applications where humans want to view results of t-f
decomposition
11
So What IS the WT???
Basis Functions
So X(f,t) is computing by comparing x(t) to each of these basis functions
And it also causes the problems with the non-redundant form of the STFT
So we need to find a new way to make T-F basis functions that dont have
these problems!!!
12
The WT comes about from replacing frequency shifting by time scaling
Start with a prototype signal (t) and time scale it:
(t / s ) s ( sf )
Increasing s: Stretches the signal Decreasing s: Scrunches the signal
Scrunches the spectrum Stretches the spectrum
(t)
Small s t Large s
|( f )|
(t/s) (t/s)
f
t t
f f
13
This shows some typical t-f cells for wavelets
Narrower in Time
Wider in Frequency
Higher Frequency
Wider in Time
Narrower in Frequency
Lower Frequency
1
We still need to satisfy the uncertainty principle: ( t )( f )
4
But now t and f are adjusted depending on what region of frequency
is being probed. 14
Next
All this leads to The Wavelet Transform:
1 t (t) is called the
X ( s, t ) s s d , s 0
x ( )
Mother Wavelet
(t )dt
2
Finite Energy: (t ) L ( )
2 2
( ) d
Parseval
2
( )
Admissibility Condition:
0
| |
d
16
Next
Example of a WT
log2(1/s)
17
Next
Non-Redundant Form of WT
It is often desirable to use a discrete form of the WT that is non-redundant
that is, we only need X(s,t) on a discrete set of s and t values to reconstruct x(t).
Under some conditions it is possible to do this with only s and t taking these
values: s 2 m t n 2 m for m 3, 2, 1,0,1, 2,3, In practice you
truncate the range
n 3, 2, 1,0,1, 2,3,
of m and n
n d , m, n
t
m /2 m
X ( s, t ) x ( ) 1s X m ,n x ( ) 2 2
d
s m , n ( )
19
Next
WT Tiling and Basis Functions
Freq
Time
20
Next
Example #1
A synthetic Chirp Signal
Frequency decreases with time
Amplitude increases with time
Notice that
High frequency components dominate early
Low frequency components dominate later
Low frequency components are stronger
Signal Wavelet Transform
log2(1/s)
WT Coefficients are
shown as spikes on an
axis for each 1/s value
time time
21
Next
Example #2
Speech Signal
22
Next
Example #3: Effectiveness of WT T-F Localization Properties
Seismic Trace Signal
Keep 100 largest DCT coefficients
Large Error
especially at start of transient
23
Next
Summary So Far: What is a Wavelet Transform?
Note that there are many ways to decompose a signal. Some are:
Fourier series: basis functions are harmonic sinusoids;
Fourier transform (FT): basis functions are nonharmonic sinusoids;
Walsh decomposition: basis functions are harmonic square waves;
Karhunen-Loeve decomp: basis functions are eigenfunctions of covariance;
Short-Time FT (STFT): basis functions are windowed, nonharmonic sinusoids;
Provides a time-frequency viewpoint
Wavelet Transform: basis functions are time-shifted and time-scaled versions of
a mother wavelet m ,n (t ) 2 m /2 2 m t n
Provides a time-scale viewpoint
x (t ) X
m n
m ,n t
m ,n X m ,n x( ) m ,n ( )d ,
25
Next
Why are Wavelets Effective?
Provide a good basis for a large signal class
wavelet coefficients drop-off rapidly
thus, good for compression, denoising, detection/recognition
goal of any expansion is
have the coefficients provide more info about signal than time-domain
have most of the coefficients be very small (sparse representation)
FT is not sparse for transients WT is sparse for many signals
Accurate local description and separation of signal characteristics
Fourier puts localization info in the phase in a complicated way
STFT cant give localization and orthogonality
Wavelets can be adjusted or adapted to application
remaining degrees of freedom are used to achieve goals
Computation of wavelet coefficient is well-suited to computer
no derivatives or integrals needed
turns out to be a digital filter bank as we will see.
26
Next
The Discrete-Time WT
Recall the formula for the WT coefficients:
X m ,n
x ( )
2 m /2
2
m
n d , m, n ()
m , n ( )
X m ,n x ( ) 2 m /2 2 m n d ,
x ( )
2 m /2
2 m
( n 2 m
) d ,
m n 2m
x ( ) m n 2m d ,
x * m n 2
m x(t) m (t ) X m ,n
t n 2m
28
Next
This leads to a filterbank:
m (t )
o
X mo ,n
t n 2mo
x(t) m 1 (t )
o
X ( mo 1),n
( mo 1)
t n2
M (t ) X M ,n
t n2M
m ( f ) M mo+2 mo+1 mo
f
It IS possible to implement this filterbank in DT
but in general it is not possible to efficiently implement it 29
Consider a Special Case, Though
Let x(t) be bandlimited to B Hz. Choose the mother wavelet to be a modulated
sinc function and mo such that the spectrum is as below
( f )
Signal
Spectrum is
zero above B
30
Next
Now consider the relationship
between the filter spectrum and X( f )
spectra of the scaled versions of
the mother wavelet
( f )
(2 f )
Dont have to go to
finer scale (i.e.,
smaller s more
negative m) because (4 f )
the BL signal has no
power there!
Finest scale we need
is on the order of 1/FS
31
Next
Note that for these ideal filters
we can do this X( f )
n4T
(4 f ) (4f )
(t/2) (t/4)
(4f )
(t/4) Etc.
32
Next
Note that we can do this in
terms of DT processing S()
h1[n ] 2
x[n]
H0() H1()
h0 [n ] h1[n ] 4
h0 [n ]
h1[n ] 8 /2
Etc. H0(2) H1(2)
???
The tildes are used to indicate filter s
that correspond to a time-scaled version
of the filter w/o the tilde /4 /2
h1[n] and h0[n] implement the DT versions of (t) and (t), respectively.
The change in notation to h is to allow for the general non-sinc case
where the DT filters used are not simply DT versions of the CT filters (like
they are here for the sinc case). 33
Next
Modification of DT approach:
S()
h1[n ] 2
x[n] H() H0() H1()
h0 [n ] 2 h1[n ] 2
/2
h0 [n ] 2 H0() H1()
Etc.
/2
This development is valid for the sinc wavelet
But the general development is not as straight- After
forward as this example might indicate!!! Dec by 2
34
Next
WT
Coefficients
X1n
X2n
X3n
X4n
Y4n
This structure is the final result of this
development although the way we did the
development is easily applicable only to the sinc What are
wavelet case the result holds true but is better these??
developed using the so-called multi-resolution
viewpoint which we will develop next.
35
Next
X1n
X2n
X3n
X4n
36
Next
Multi-Resolution Viewpoint
Provides solid development of
DT Filter Bank Implementation
37
Next
Multi-Resolution Approach
Stems from image processing field
consider finer and finer approximations to an image
Define a nested set of signal spaces
V 2 V1 V0 V1 V2 L2
We build these spaces as follows:
Let V0 be the space spanned by the integer translations of a fundamental
signal (t), called the scaling function: spanned by (t k)
So far we can use just about any function (t), but well see that to get the
nesting only certain scaling functions can be used.
38
Next
Multiresolution Analysis (MRA) Equation
Now that we have V0 how do we make the others and ensure that they
are nested?
If we let V1 be the space spanned by integer translates of (2t) we get
the desired property that V1 is indeed a space of functions having
higher resolution.
Now how do we get the nesting?
We need that any function in V0 also be in V1; in particular we need
that the scaling function (which is in V0 ) be in V1, which then requires
that
(t ) h0 [n ] 2 (2t n )
n
h0[n] (t)
n t
MRA
Equation
h0[n] must
satisfy some
conditions
40
Next
Whence the Wavelets?
The spaces Vj represent increasingly higher resolution spaces
To go from Vj to higher resolution Vj+1 requires the addition of
details
These details are the part of Vj+1 not able to be represented in Vj
This can be captured through the orthogonal complement of Vj w.r.t
Vj+1
Call this orthogonal complement space Wj
all functions in Wj are orthogonal to all functions in Vj
That is:
j , k (t ), j ,l (t ) j , k (t ) j ,l (t ) dt 0 j , k , l Z
(t)
h1[n]
n t
Wavelet
Equation
(WE)
h1(n) must
satisfy some
conditions
42
Next
Wavelet-Scaling Function Connection
There is a fundamental connection between the scaling function and its
coefficients h0[n] , the wavelet function and its coefficients h1[n]:
h0[n] (t)
n MR t
Equation
(MRE)
How are h1[n] and
h0[n] related?
(t)
h1[n]
n t
Wavelet
Equation
(WE)
43
Next
Relationship Between h1[n] and h0[n]
We state here the conditions for the important special case of
finite number N+1 of nonzero h0[n]
ON within V0: (t ) (t k )dt (k )
ON between V0 and W0 :
(t ) (t k )dt (k )
Given the h0[n] that define the desired scaling function, then the h1[n]
that define the wavelet function are given by
44
Next
The Resulting Expansions
Suppose we have found a scaling function (t) that satisfies the MRE
Then (t - k) is an ON basis for V0
More generally, an ON basis for V jo is 2 (2 t k )
jo /2 jo
k
V 2 V1 V0 V1 V2 L2
45
Next
The Resulting Expansions (cont.)
Weve set things up so that for some jo and its space Vjo we have that
L2 V j0 W j0 W j0 1 W j0 2
2 (2 t k )k
jo /2
We know that an ON basis for V jo is jo
L2 W 2 W1 W0 W1 W2
d j ,k x (t ), j ,k (t )
x (t )2 j /2 (2 jo t k )dt
47
Next
The Expansion Coefficients cj0(k) and dj(k)
c j0 ,k x (t ), j0 ,k (t ) x (t ) j0 ,k (t ) dt
d j ,k x (t ), j ,k (t ) x (t ) j ,k (t ) dt
48
Next
Filter Banks and DWT
49
Next
Generalizing the MRE and WE
Here again are the MRE and the WE:
We get:
MRE WE
(2 j t k ) h0 [m 2k ] 2 (2 j 1 t m ) (2 j t k ) h1[m 2k ] 2 (2 j 1 t m )
m m
50
Next
Linking Expansion Coefficients Between Scales
Start with the Generalized MRA and WE:
(2 j t k ) h0 [m 2k ] 2 (2 j 1 t m ) (2 j t k ) h1[m 2k ] 2 (2 j 1 t m )
m m
c j ,k x (t ), j ,k (t ) d j ,k x (t ), j ,k (t )
c j ,k h0 [m 2k ] x (t ), 2( j 1)/2 (2 j 1 t m ) d j ,k h1 [m 2k ] x (t ), 2( j 1)/2 (2 j 1 t m )
m m
c j1 (m)
c j ,k h [m 2k ] c
0 j 1, m
d j ,k h1[m 2k ] c j 1,m
m m
51
Next
Convolution-Decimation Structure
c j ,k h [m 2 k ] c
0 j 1, m
d j ,k h1[m 2k ] c j 1,m
m m
Convolution
y0 [n ] c j 1[n ] h0 [ n ] y1[n ] c j 1[n ] h1[ n ]
h0 [m n ] c j 1[m] h1[m n ] c j 1[m ]
m m
Decimation
n=0 1 2 3 4 5 6 7 8 9
k=0 1 2 3 4
n = 2k = 0 2 4 6 8
52
Next
Computing The Expansion Coefficients
The above structure can be cascaded:
given the scaling function coefficients at a specified level all the lower
resolution cs and ds can be computed using the filter structure
HPF dj,k
2
h1(-n) Wj
cj+1,k
Vj+1
LPF Cj,k HPF dj-1,k
2 2
h0(-n) Vj h1(-n) Wj-1
LPF cj-2,k
2
h0(-n) Vj-2
53
Next
Filter Bank Generation of the Spaces
Vj-1
Vj
Vj+1
Vj-2 Wj-2 Wj-1 Wj
/8 /4 /2
HPF dj,k
2
h1(-n) Wj
cj+1,k
Vj+1
LPF Cj,k HPF dj-1,k
2 2
h0(-n) Vj h1(-n) Wj-1
LPF cj-2,k
2
h0(-n) Vj-2
54
Next
WT Coefficients
How do we get HPF
h1(-n)
2
d0,k
c1,k
these???!!!
LPF c0,k HPF d-1,k
2 2
h0(-n) h1(-n)
c1,k x(t )2 (2t k )dt
1/2
k
Conjecture: c j 1,k x LPF
2
c-2,k
X( f )
( f/2 )
kT
(t)
x(t)
k2T
(t) (t/2) ( f ) (f) (f)
55
Next
(2t k ) sinc(2 Bt k )
n
First, prove this: x x(t )sinc(2 Bt k )dt
2 B
x (t 2kB )t 0
x ( 2kB ) 56
Next
So now we can change this
WT Coefficients d0,k
HPF
2
h1(-n)
c1,k
LPF c-2,k
2
h0(-n)
Into this
WT Coefficients d0,k
HPF
2
h1(-n)
x[n]
X mn x (t ) 2 2 t n dt
m /2 m
x (t ) X mn 2 m /2 2 m t n
m n
Compute dj(k) & cj(k)
x (t ) d j ( k )
2 j /2
2 j
t k
using filter bank k j
x (t ) c j0 ,k 2 j0 /2
(2 t k )
j0
d j ,k 2 j /2 (2 j t k )
k k j j0
End 58
59
Next
60
Next
61
Next
Computational Complexity of DWT
For a signal of length N: # of Multiplies & Adds is O(N)
Lower order than the FFT which is O(Nlog2N)
But watch out for the multiplicative constant!
Each Filter has length L << N
# of Mult. < NL 2 m 2 NL
m 0
62
Next
63
Next
WT-BASED COMPRESSION EXAMPLE
Side Info
Time
64
Next
Original Fingerprint Image Decoded Fingerprint Image after 26:1 CR
From http://www.amara.com/IEEEwave/IW_fbi.html
See also http://www.c3.lanl.gov/~brislawn/FBI/FBI.html 65
Next
66
Next
67
Next
End
68