Reputation: 1363
I was doing multilevel wavelet decomposition for a signal 'price1' by using
[c1, l] = wavedec(price1, 3, 'db4');
The size of price1 was:
size(price1) =
240 1
And the size of wavelet decomposition obtained i.e length of l is:
l =
36
36
65
123
240
I am a beginner, and I think the size should be:
l =
30
30
60
120
240
I am not able to understand why is the size not half of the signal size? Is this some sort of padding happening internally? And I would want the size to be half like [30; 30; 60; 120; 240]. What can I do to achieve it?
Thanks for your help :)
Upvotes: 1
Views: 772
Reputation: 4336
You are not considering the length of mother wavelet, which will change the length of signal after convolution.
db4
has the length of 8
,
a = randi(10,[240 1]);
[c1, l] = wavedec(a, 3, 'db4');
l =
36
36
65
123
240
But for example db8
has the length of 16
[c1, l] = wavedec(a, 3, 'db8');
l =
43
43
71
127
240
You can have access to wavelet functions like this,
[LoD,HiD,LoR,HiR] = wfilters('db8');
Upvotes: 1