Filter implementation of the Haar wavelet Multiresolution approximation in general Filter implementation of DWT Applications - Compression The Story of Wavelets Theory and Engineering Applications
DWT Using Filtering a(j-1,2k) a(j-1, 2k+1) f(t) f j-1 (t) f j (t) a(j,k) Note that at the next finer level, intervals are half as long, so you need 2k to get the same interval. h’[n] a j-1,k y j-1,k h’[n] 2 a j-1,k a j,k a j,2k Approx. coefficients at any level j can be obtained by filtering coef. at level j-1 (next finer level) by h’[n] and downsampling by 2
Filter Implementation of Haar Wavelet We showed that a j,k can be obtained from a j-1,k through filtering by using a filter followed by a downsampling operation (drop every other sample). Similarly, d j,k can also be obtained from a j-1,k using the filter g’[n] followed by down sampling by 2… This is called decomposition in the wavelet jargon. g’[n] 2 a j-1,k d j,k d j,2k Detail coefficients at any level j can be obtained by filtering approximation coefficients at level j-1 (next finer level) by g’[n] and downsampling by 2
Decomposition Filters If we take the FT of h’[n] and g’[n]… LPF HPF
Decomposition / Reconstruction Filters We can obtain the coarser level coefficients a j,k or d j,k by filtering a j-1,k with h’[n] or g’[n], 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 a j-1,k from a j,k and d j,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 h[n]= [n]+ [n-1] and g[n]= [n]- [n-1]. Add the filter outputs !
The Discrete Wavelet Transform g`[n] h`[n] 2 2 g`[n] h`[n] g[n] h[n] g[n] h[n] + a j,k d j+1,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. d j+2,k a j+2,k a j+1,k a j,k
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
Let’s suppose that the function f(t) is sampled at N points to give the sequence f[n], and further suppose that k th resolution is the highest resolution (we will compute approximations at k+1, k+2, …etc. Then: Multiplying and integrating MRA on Discrete Functions h[k] g[k]
From MRA to Filters This substitution gives us level j+1 approximation and detail coefficients in terms of level j coefficients : we can put the above expressions in convolution (filter) form as H ~ a j,k G ~ level of DWT decomposition h[n]=h[-n], and g[n]=g[-n] ~ ~ So where do these filters really come from…? a j+1,k d j+1,k
Dilation / 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, h[k]= c(k)/√2. Then the two-scale equation becomes or more generally
Similarly, the two-scale equation for the wavelet function: Then: Dilation / Two-scale Equations In some books, g[k]= b(k)/√2. Then the two-scale equation becomes ~
Two-Scale Equations These two equations determine the coefficients of all 4 filters: h[n]: Reconstruction, lowpass filter g[n]: Reconstruction, highpass filter h[n]: Decomposition, lowpass filter g[n]: Decomposition, highpass filter The following observations can therefore be made ~ ~ Note : |H(jw)|= |H(jw)| ~
Quadrature 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…..
DB-4 Wavelets h = g = h = g = ~ ~ L: filter length (8, in this case) Matlab command “wfilters()” Use freqz() to see its freq. response
DWT implementation: Subband Coding G H 2 2 G H G H G H + x[n] Decomposition Reconstruction ~ ~ ~ ~
DWT Decomposition x[n] Length: 512 B: 0 ~ g[n]h[n] g[n]h[n] g[n]h[n] 2 d 1 : Level 1 DWT Coeff. Length: 256 B: 0 ~ /2 Hz Length: 256 B: /2 ~ Hz Length: 128 B: 0 ~ /4 Hz Length: 128 B: /4 ~ /2 Hz d 2 : Level 2 DWT Coeff. d 3 : Level 3 DWT Coeff. ……. Length: 64 B: 0 ~ /8 Hz Length: 64 B: /8 ~ /4 Hz |H(jw)| w /2 - /2 |G(jw)| w -- /2 - /2
Applications Detect discontinuities
Applications Detect hidden discontinuities
Applications Simple denoising
Compression DWT is commonly used for compression, since most DWT are very small, can be zeroed-out!
Compression
Compression - ECG
ECG - Compression