I am wondering about the correlation between input size and number of coefficients given by a discrete wavelet transform.
I am using Daubechies wavelets to describe a 1D function and I'm using PyWavelets to implement it (which is analogous to the MATLAB toolbox).
I started by implementing it using Haar wavelets, which gave correct results and I understand exactly how it works. Let's say my input function has 16 datapoints, if I use Haar, what I get from a multilevel decomposition (wavedec
) is something like this (the number of shifts in brackets):
V1[1], W1[1], W2[2], W3[4], W4[8]
This is all well and good. The V1 gives me the scaling function and the W1-W5 wavelets of different scale and dilation. My problem is when I use the next Daubechies (referred to as 'db2'
in the toolbox, which is called the D4), and I get
V1[6], W1[6], W2[9]
I lose all my intuition. I have no idea where 6, 6 and 9 come from, and they change depending on the level I specify (not even sure what it means to specify a level) and of course the input size. How can I predict the number of coefficients, and what are some good resources for gaining better understanding of why?
Thanks!
EDIT: Clarification on V and W:
$V_n$ usually denotes the span of a certain scaling function, $\phi$, i.e. $\{\phi_{n,k}\}$, where $k$ is the shift and $n$ the scaling. $W_n$ is the same except for the wavelet function, $\psi$. I might have abused the notation a bit by referring to the vectors of coefficients by V and W though.
EDIT2: Code
Here is the MATLAB code to produce the above:
>> [C, L] = wavedec(1:16, 4, 'db1'); L
L =
1 1 2 4 8 16
>> [C, L] = wavedec(1:16, 2, 'db2'); L
L =
6 6 9 16
I actually used PyWavelets, where it looked like this:
>>> import pywt
>>> map(len, pywt.wavedec(range(16), 'db1')) # defaults to level = 4
[1, 1, 2, 4, 8]
>>> map(len, pywt.wavedec(range(16), 'db2')) # defaults to level = 2
[6, 6, 9]
V
andW
? $\endgroup$V1[6], W1[6], W2[9]
you mean that you get a scaling function of length 6, and two wavelet functions of lengths 6 and 9? Or are these the numbers of coefficients of the different level of your transformed signal? MATLAB code to get these would be very useful as well. $\endgroup$