I am doing an SWT by hand to understand it better, and have a couple of questions. Maybe someone here has experience with this?
Now the details coefficients we get in the book are
-80 0 0 0 80 0 0 0 0.
When I did the convolution by hand I got this same result. Matlab agrees also.
However, when I do a level 1 SWT in Python or Matlab, the details coefficients look like this:
0 0 0 56.6 0 0 0 -56.6
I understand that the numbers are different - the book uses [1 -1] as wavelet filter, and most algorithms use [1/(sqrt(2)) -1/(sqrt(2))]. (I don't know why, it's not explained in the book.)
But the Matlab result is shifted to the left! Somehow, Matlab gets rid of the delay in the result during the computation of the details coefficients. They also reduce the convolution back to the right length. In the book, all of these transformations are done at the end, to get the original data back.
So my questions are:
- Is the delay always 1, for every 1D SWT?
- How does Matlab calculate its result, and how can I replicate this in my calculation? Is it always a shift to the left? Which element do I drop to reduce the size of the result? A simple convolution seems to be not enough.
- (And if someone happens to know a source that mentions why haar filter values are so often 1/(sqrt(2)), I'd be happy to learn about that, too.)
Thanks in advance