1

The wavelet elements of a Daubechies kind 4 are

$$(0.4830, 0.8365, 0.2241, -0.1294) $$

Let's say I have the following signal array

$$ [1, 2, 0, 4, 5, 6, 8, 10 ]$$

Doing a Daubechies 4 DWT of this array is basically multiplying a $8\times 8$ array with a $8\times 1$ array (signal).

The $8\times1$ array will have the following elements, \begin{array}{cccc} 0.483 & 0.8365 &0.2241 &-0.1294 &0 &0 &0 &0 \\ 0 &0 &0.483 &0.8365 &0.2241 &-0.1294 &0 &0 \\ 0 &0 &0 &0 &0.483 &0.8365 &0.2241 &-0.1294 \\ 0.2241 &-0.1294 &0 &0 &0 &0 &0.483 &0.8365 \\ -0.1294 &-0.2241 &0.8365 &-0.483 &0 &0 &0 &0 \\ 0 &0 &-0.1294 &-0.2241 &0.8365 &-0.483 &0 &0 \\ 0 &0 &0 &0 &-0.1294 &-0.2241 &0.8365 &-0.483 \\ 0.8365 &-0.483 &0 &0 &0 &0 &-0.1294 &-0.2241 \\ \end{array}

The result will be

for the scaling function...

- 0 : 1.638357430415108
- 1 : 3.6903274198537357
- 2 : 7.9329681069730205
- 3 : 12.194191165473843

for the wavelet

- 0 : -2.5095489112134235
- 1 : 0.3882285676537802
- 2 : -0.1294095225512608
- 3 : -3.4061243833814774

Sorry but my math is rusty. I don't know the exact terms for these two elements that come from the DWT decomposition. Some call, scaling function and wavelet, others call trend subsignal and fluctuation, others call c and d... etc.

Anyway, now I need to perform another level of DWT DB4, what values do I send to the algorithm that will perform the decomposition? The scaling function c or the wavelet d?

and what about the inverse transformations?

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
Duck
  • 218

1 Answers1

1

The inverse of this step of the transform will be the inverse matrix to the matrix you wrote above. Mechanically just build a matrix of the values you wrote, and then invert this matrix. The Db4 should be designed so that this inverse matrix will be the same (up to maybe a scaling / normalization factor / transpose), which is what makes orthogonal wavelets so simple to use. We only need one filter pair two short arrays of numbers.

Makes programming simpler and/or memory overheads slimmer than if we needed separate filters for forward and backward transform.

Usually in discrete wavelet transforms you iterate on the low-pass channel, which is the output from the scaling function or father wavelet. This is called dyadic decomposition, You can read more here. At every level you don't stop you will only have "result" of the mother wavelet. These are the "detail" coefficients at this level of resolution. At the lowest level of resolution (where you stop the transform) you will also have "approximation" coefficients, which come from the father wavelet function belonging this coarsest scale.

There also exist wavelet packet analysis, where you can iterate also on the high-pass band (where mother wavelets live) and not only on the low-pass band (where father wavelets live). But these packet analyses are probably a bit over-course.

What happens at next level is that for the coefficients of the high pass filter you put an identity matrix $I$ and for the coefficients of the low pass filter coefficients you put a subsampled version of original matrix.

We can see by ocular inspection that high pass filter comes last in the 8x8 matrix, so those are the elements which will be affected by the $I_4$ block. $$\begin{bmatrix}D&0\\0&I_4\end{bmatrix}$$

The "$D$" here will be the 4x4 size transform matrix for Db4. If we write it out it will look like this:

$$\left[\begin{array}{cccc|cccc}0.483&0.8365&0.2241&-0.1294&0&0&0&0\\0.2241&-0.1294&0.483&0.8365&0&0&0&0\\ -0.1294&-0.2241&0.8365&-0.483&0&0&0&0\\0.8365&-0.483&-0.1294&-0.2241&0&0&0&0\\\hline0&0&0&0&1&0&0&0\\0&0&0&0&0&1&0&0\\0&0&0&0&0&0&1&0\\0&0&0&0&0&0&0&1\end{array}\right]$$

With lines to clarify the block-structure. Now when you have both transform matrices, what remains is to find their inverses, and for ON transform, Inverse is equal to transpose, so this is easily done.

mathreadler
  • 25,824
  • Thanks for the answer but this is my problem. Suppose I take an array with 8 elements and decompose it with DWT DB4. I get two arrays with 4 elements. Let's call it a and b. Then I take one of these arrays and decompose again. I get two arrays with 2 elements, let's call it c and d. I cannot continue anymore because I have reached 2 elements. Now it is time to reverse it. I take c and d and inverse transform it, getting an array with 4 elements. How can I inverse transform again now? I only have one array with 4 elements... I need a second array of 4 elements. – Duck Mar 18 '19 at 20:40
  • You don't "throw away" the 4 detail coefficients you get from the first level, you keep them in the vector for later, when you get back to inverse transforming at first level. Do you know about block-diagonal matrices? – mathreadler Mar 18 '19 at 20:42
  • @SpaceDog second level will be a matrix with the block matrix structure I describe in edited answer. – mathreadler Mar 18 '19 at 20:56
  • Sorry, my math is rusty. After the first decomposition I have two 4x4 arrays, shown in my question. The first is scaling factor. Should I inject that into the same algorithm and obtain two a 2x2 matrices? and what happens on the way back? Please explain using the numbers I have provided... – Duck Mar 18 '19 at 20:57
  • if I am asking too much, no problem. I still appreciate the help. – Duck Mar 18 '19 at 21:10
  • Don't turn it into two 4x1 arrays but keep it as one 8x1 vector and then figure out which matrix of the form I showed you the next step will be. – mathreadler Mar 18 '19 at 21:10
  • I was able to restore the original signal by doing this: I did the first decomposition and got a and b. I did a second decomposition on a and got c and d. For the inverse process I did a reconstruction using c and d and got e. Then a second reconstruction using e and b and got the original signal. a and c are the low-pass and b and d high pass. Is that it? – Duck Mar 18 '19 at 21:34
  • @SpaceDog it sounds right, I am more used to expressing it with matrices. I will try to write it out as the second matrix. – mathreadler Mar 19 '19 at 01:45
  • 1
    brilliant!!!!!!!!!!! thanks. Fantastic explanation. – Duck Mar 19 '19 at 14:43