Title: Filter implementation of the Haar wavelet
1The Story of WaveletsTheory and Engineering
Applications
- Filter implementation of the Haar wavelet
- Multiresolution approximation in general
- Filter implementation of DWT
- Applications - Compression
2DWT Using Filtering
Note that at the next finer level, intervals are
half as long, so you need 2k to get the same
interval.
hn
yj-1,k
aj-1,k
Approx. coefficients at any level j can be
obtained by filtering coef. at level j-1 (next
finer level) by hn and downsampling by 2
3Filter Implementation of Haar Wavelet
We showed that aj,k can be obtained from aj-1,k
through filtering by using a filter
followed by a downsampling operation (drop every
other sample). Similarly, dj,k can also be
obtained from aj-1,k using the filter gn
followed by down sampling by 2
Detail coefficients at any level j can be
obtained by filtering approximation coefficients
at level j-1 (next finer level) by gn and
downsampling by 2
This is called decomposition in the wavelet
jargon.
4Decomposition Filters
- If we take the FT of hn and gn
LPF
HPF
5Decomposition / Reconstruction Filters
- We can obtain the coarser level coefficients aj,k
or dj,k by filtering aj-1,k with hn or gn,
respectively, followed by downsampling by 2. - Would any LPF and HPF work? No! There are certain
requirements that the filters need to satisfy. In
fact, the filters are obtained from scaling and
wavelet functions using dilation (two-scale)
equations (coming soon) - Can we go the other way? Can we obtain aj-1,k
from aj,k and dj,k from a set of filters. YES!.
This process is called reconstruction. - Upsample a(k,n) and d(k,n) by 2 (insert zeros
between every sample) and use filters hn?n
?n-1 and gn ?n- ?n-1. Add the filter
outputs !
6The Discrete Wavelet Transform
aj,k
aj,k
dj1,k
aj1,k
aj1,k
dj2,k
aj2,k
Decomposition
Reconstruction
We have only shown the above implementation for
the Haar Wavelet, however, as we will see later,
this implementation subband coding is
applicable in general.
7????
- We see that app. and detail coefficients can be
obtained through filtering operations, but where
do scaling and wavelet functions appear in the
subband coding DWT implementation? - Clearly, these functions are somehow hidden in
the filter coefficients, but how? - To find out, we need to know little bit more
about these scaling and wavelet functions
8MRA on Discrete Functions
- Lets suppose that the function f(t) is sampled
at N points to give the sequence fn, and
further suppose that kth resolution is the
highest resolution (we will compute
approximations at k1, k2, etc. Then - Multiplying and integrating
1
2
hk
gk
9From MRA to Filters
- This substitution gives us level j1
approximation and detail coefficients in terms of
level j coefficients - we can put the above expressions in
convolution (filter) form as
H
aj1,k
aj,k
1-level of DWT decomposition
G
dj1,k
hnh-n, and gng-n
So where do these filters really come from?
10Dilation / Two-scale Equations
- Two scale (dilation) equations for the scaling
and wavelet functions determine the filters
associated with these functions. In particular - The coefficients c(n) can be obtained as
- Recall that
- In some books, hk c(k)/v2. Then the two-scale
equation becomes
or more generally
11Dilation / Two-scale Equations
- Similarly, the two-scale equation for the wavelet
function - Then
In some books, gk b(k)/v2. Then the two-scale
equation becomes
12Two-Scale Equations
- These two equations determine the coefficients of
all 4 filters - hn Reconstruction, lowpass filter
- gn Reconstruction, highpass filter
- hn Decomposition, lowpass filter
- gn Decomposition, highpass filter
- The following observations can therefore be made
Note H(jw) H(jw)
13Quadrature Mirror Filters
- It can be shown that
- that is, h and g filters are related to
each other - in fact, that
is, h and g are mirrors of each other, with
every other coefficient negated. Such filters
are called quadrature mirror filters. For
example, Daubechies wavelets with 4 vanishing
moments..
14DB-4 Wavelets
- h -0.0106 0.0329 0.0308 -0.1870
-0.0280 0.6309 0.7148 0.2304 - g -0.2304 0.7148 -0.6309 -0.0280
0.1870 0.0308 -0.0329 -0.0106 - h 0.2304 0.7148 0.6309 -0.0280
-0.1870 0.0308 0.0329 -0.0106 - g -0.0106 -0.0329 0.0308 0.1870
-0.0280 -0.6309 0.7148 -0.2304
L filter length (8, in this case)
Matlab command wfilters() ? Use freqz() to see
its freq. response
15DWT implementationSubband Coding
xn
xn
Decomposition
Reconstruction
16DWT Decomposition
xn
Length 512 B 0 ?
gn
hn
Length 256 B 0 ?/2 Hz
Length 256 B ?/2 ? Hz
G(jw)
d1 Level 1 DWT Coeff.
gn
hn
Length 128 B 0 ? /4 Hz
w
Length 128 B ?/4 ?/2 Hz
-?
?/2
-?/2
?
d2 Level 2 DWT Coeff.
gn
hn
2
Length 64 B 0 ?/8 Hz
Length 64 B ?/8 ?/4 Hz
.
d3 Level 3 DWT Coeff.
17Applications
Detect discontinuities
18Applications
Detect hidden discontinuities
19Applications
Simple denoising
20Compression
- DWT is commonly used for compression, since most
DWT are very small, can be zeroed-out!
21Compression
22Compression
23Compression - ECG
24ECG - Compression
25ECG- Compression