## introduction

The impetus for this post is figure 1.4 on page 6 of Burrus et al. (Since it’s been a while, that’s Burrus, C. Sidney; Gopinath, Ramesh A.; Guo, Haitao. **Introduction to Wavelets and Wavelet Transforms, A Primer.** Prentice Hall, 1998.ISBN 0 13 489600 9.)

They offered the figure as an illustration of four different scaling functions; in addition, these scaling functions were parameterized by two angles.

Now I know how to produce the drawings of those scaling functions — and I also know how to produce drawings of the corresponding mother wavelets, which they did not show on page 6.** It also turns out that they have interchanged the legends for figures (a) and (b)** — and when we can produce the drawings ourselves, that mistake becomes almost irrelevant.

This post also serves to reiterate the calculation sequence for plotting a scaling function and its corresponding mother wavelet.

## setup

It turns out that there are equations which must be satisfied by any “reasonable” filter coefficients h. I expect to show these to you in the next post. I have already shown you a description of these solutions of these equations when we have 4 nonzero coefficients. And I have shown you how to compute scaling functions and mother wavelets for N = 4 (D4 only) and for N = 2 (D2 = Haar).

Let me emphasize that what I understand is how to get the equations which the filter coefficients h must satisfy. What I do not yet understand is how to parameterize the solutions in terms of angles.

Let me now hand you a description of the solutions when we have 6 nonzero coefficients. The four examples I am about to work out all come from specific choices of these solutions. **That is, for every one of the following examples, N = 6.**

The following 4 scaling functions match figure 1.4, although (a) and (b) are swapped. (The legend describes the values “a” and “b” in the equations; the legend for figure a belongs with figure b.)

In addition, they have drawings of the Daubechies D6 (p. 82) and Coiflet C6 (p. 94) mother wavelets, so I have confirmed 6 of the following 8 graphs.

From p. 66 of Burrus et al., we get the following (using H instead of h just because it lets me preserve the equations in H while setting values for h.)

Let me tell you before I start writing that the last two equations are actually

That is, they say that the sum of the even coefficients is equal to the sum of the odd coefficients is equal to half the sum of all the coefficients = . They will look much more complicated than that when I substitute the first four equations.

## legend 1.14 a (figure b)

The first choice (the legend for figure 1.14 a) for the angles a and b (in radians) is

(I knew when I saw those that the figure was wrong; by that time I recognized the D6 h’s.)

The resulting h’s are…

Now we form the m0 matrix (in stages for clarity)…

Then we multiply by Sqrt[2]…

Note that since all 4 examples have N = 6, that is the m0 matrix in principle for each of these examples. I won’t show it again.

Now we set the values…

We find the eigenvector of eigenvalue 1. Mathematica returned a unit vector, but I want one whose components add up to 1. I will simply divide the unit vector by the sum of its components.

Here’s the unit vector…

The sum of its components is -0.742756, so I get

This function should be defined on [0,5]. I use that vector for the values of the scaling function at the integers.

Working, I graphed this immediately, but for the post, I ought to put the two drawings — scaling function and mother wavelet — in close proximity. This one turns out to be the Daubechies D6 scaling function.

To get the D6 mother wavelet, we take our filter coefficients h…

… we reverse them, and alternate the signs. The resulting filter coefficients are often denoted by h1 or by g. I’ll use g. The resulting g coefficients are what I expect (the sign of g[0] = h[5] has not been changed), but their Table 6.2 on p. 79 has the negatives of these numbers. And yet, I match their picture on p. 82.

(That’s why there’s a in front of the recipe. Sorry, but you’ll have to look for it in the post.)

Define the mother wavelet…

and plot it…

(These are Daubechies D6 mother wavelet and scaling function, respectively.)

Beautiful. That matches their picture on p. 82.

And here’s the D6 scaling function whose plot I delayed showing you…

and that matches (b), rather than (a), of figure 1.4.

## legend 1.14 b (figure a)

Let’s make a different choice for a and b. I believe this is the “Coiflet” of order 6.

The resulting h’s are:

Now we form the m0 matrix exactly as before, and set the new values…

We find the eigenvector of eigenvalue 1.

That’s orthonormal, so I find the sum of its components (0.578913) and divide by it, getting

Set those to be the values of the scaling function at the integers, and define the recursion…

Again, I will delay the plot until I have the mother wavelet.

To get the mother wavelet, we start with the h’s…

(Those agree with p 92)

We reverse them, and alternate the signs. (This time, I need to use their signs! And they have got g[0] = -h[5].)

compute and plot…

(These are the Coiflet C6 mother wavelet and scaling function in order.)

That matches their p. 94 drawing of the C6 mother wavelet.

And here’s the C6 scaling function…

and that matches their figure 1.14 (a).

## figure 14.1 c

I do not know if the following pair has a name. We take

The resulting h’s are…

Now we form the m0 matrix, and set the values.

Now we find the eigenvector of eigenvalue 1:

The sum of its components is -1.29645, so we divide by it, to get a vector whose components add up to 1:

That gives us the initial values, and we define the recursion…

Recall the h’s…

We reverse them, and alternate the signs.

Redefine the mother wavelet…

and plot it…

… followed by the scaling function:

## The last case for their Figure 1.4.

Here are the angles a and b…

Here are the resulting h’s…

We form the M0 matrix and set its values…

Once again we find the eigenvector of eigenvalue 1. (If you’re using Mathematica, be careful. It’s probably the 2nd one rather than the 1st, in this case.) The normalized eigenvector is…

The sum of its components is 1.39807, so we divide through and get our initial values for the scaling function…

So we define the scaling function

Here are the h’s…

We reverse them, and alternate the signs to get a set of g’s…

Define the mother wavelet…

Compute and plot it…

And here’s the scaling function (which we defined first, as usual)…

## Closing

So. We’ve had some practice computing the scaling function and the mother wavelet from the h’s. We know that the h’s are not arbitrary, but are given by solutions to some set of equations, and I’ve shown you the general solutions for N = 4 and N = 6.

Now I really owe you an explanation of where the heck these computations come from. But at least you’ll know why I’m writing equations when you see them.

Next, I think.

## Leave a Reply