# Understanding this Haar Wavelet Example

I'm trying to understand Wavelet Transform , I've done well enough to understand Continuous Wavelet Transform which was easy enough, where we simply stretch the wavelet and match it with the original signal. But i couldn't be able to understand the Discrete Wavelet transform in fact I've always had a trouble understanding Discrete of any transform (like DFT , DCT which are still not clear to me).

According to Wavelet transform we Stretch our signal and then match it with the original signal to find out the frequency. This is the example shown in the book,

In this hypothetical example the student does fairly well the first half of the term then neglects his or her studies for the last half. Thus the exam scores for the term were 80%, 80%, 80%, 80%, 0%, 0%, 0%, and 0%* We can tell the average of all the scores (40%) and when the scores “tanked” after the 4th exam just by looking. Knowing the answer in advance, however, is a good way to learn and to verify the wavelet transforms. Then we can use them with confidence on real-world data where we can’t simply “eyeball” the final values.

We will now walk through the CWT process step by step using the simplest of the wavelet filters on this example. We begin by comparing the humble Haar wavelet filter, [1 –1]

Signal -> [80 80 80 80 0 0 0 0] Filter(or signal that will be stretched later) -> [1 -1]

Comparing the first 2 points with the wavelet filter we obtain 80 – 80 = 0. For this very simple high-pass filter we can say there was no change in the first 2 exam scores.

This is how we've done it,

80*1 + 80*(-1) => 80 - 80 = 0

Now We have,

[0 80 80 80 0 0 0 0]

Shifting once to the right and applying filter again we get,

80*1 + 80*(-1) => 80 - 80 = 0

Now We have,

[0 0 80 80 0 0 0 0]

Shifting once again the right and applying filter again we get,

80*1 + 80*(-1) => 80 - 80 = 0

Now We have,

[0 0 0 80 0 0 0 0]

Shifting again,

80*1 + 0*(-1) => 80 - 0 = 80

Now We have,

[0 0 0 80 0 0 0 0]

We will eventually end-up with

[0, 0, 0, 80, 0, 0, 0]

This is significant in that this wavelet process of comparison and shifting has just indicated a large change between the 4th and 5th exam. We have “found the discontinuity”.

This actually makes sense as we had a large change from 4th to 5th point But how does this discontinuity defines a frequency here ?

Now if we stretch our signal from [1 -1] to [1 0 -1] and repeat the process,

We will eventually end-up with,

= –80 –80 0 0 80 80 0 0 0 0

When we used filter [1 -1] , our output at least makes some sense it clearly shows a rapid change, but what happened here in case of 3 point filter ? what are these weird values (-80 -80) ?

If we keep scaling to 10th times here is what we'll eventually get,

(scale = 10) –320 –160 0 160 320 320 240 160
(scale = 9)  –240 –80 80 240 320 240 160 80
(scale = 8)  –320 –160 0 160 320 240 160 80
(scale = 7)  –240 –80 80 240 240 160 80 0
(scale = 6)  –240 –160 0 160 240 160 80 0
(scale = 5)  –160 –80 80 160 160 80 0 0
(scale = 4)  –160 –80 0 80 160 80 0 0
(scale = 3)  –80 0 0 80 80 0 0 0
(scale = 2)  –80 0 0 0 80 0 0 0
(scale = 1)   0 0 0 0 0 0 0 0


While studying the Continuous Wavelet Transform the scaling made sense but i could't understand the scaling here ? what are these points -80, -160, -240, -320 represents ?

This is the final output, How can i relate this output from my original signal ?

-
Unlike other discrete transforms, there are two aspects of discreteness when working with wavelet transforms. The first and most important aspect is that for the DWT, you evaluate the transform at discrete, non-overlapping intervals of time. This is done to avoid redundant data in the transform values. You can do a discrete transform using suitably translated continuous transforms. The second aspect is working with discrete data, which has to do with structuring each computation of the transform so it is suitable for discrete analysis. This is the same as with any discrete transform. –  user2718 Feb 22 '13 at 15:11
Effected, can you refine your questions a little, there appear to be many of them and its hard to exactly see what you are asking. –  Mohammad Feb 22 '13 at 16:06
"Shifting once to the right and applying filter again" This seems needlessly confusing. Instead of replacing values in the original array, can't it be thought of as placing values into a new, empty array? (And shouldn't the new array size be halved each time you do this?) –  endolith Feb 22 '13 at 22:01