Reputation: 1
I am working on wavelet and I am new in this field.I want to decompose a signal into multiple band.So I use wavedec() to decompose a signal into 5 level and use wrcoef() to reconstruct individual band.But problem is that when I sum 5 band then reconstruct signal is more differ than Original signal. plz any body help me about this. Here my code..
load sumsin; s = sumsin;
figure;plot(s);
% Perform decomposition at level 5 of s using sym4.
[c,l] = wavedec(s,5,'sym4');
% Reconstruct approximation at level 5,
% from the wavelet decomposition structure [c,l].
a1= wrcoef('a',c,l,'sym4',1);
a2 = wrcoef('a',c,l,'sym4',2);
a3 = wrcoef('a',c,l,'sym4',3);
a4 = wrcoef('a',c,l,'sym4',4);
a5 = wrcoef('a',c,l,'sym4',5);
figure; subplot(5,1,1); plot(a1); title('Approximation at level 1');
subplot(5,1,2); plot(a2); title('Approximation at level 2');
subplot(5,1,3); plot(a3); title('Approximation at level 3');
subplot(5,1,4); plot(a4); title('Approximation at level 4');
subplot(5,1,5); plot(a5); title('Approximation at level 5');
figure;plot(a1+a2+a3+a4+a5);title('Reconstruct Original signal');
Upvotes: 0
Views: 446
Reputation: 11
To reconstruct the original signal you need to sum together five detailed components and the approximation component at the last, fifth, level.
d1= wrcoef('d',c,l,'sym4',1);
d2 = wrcoef('d',c,l,'sym4',2);
d3 = wrcoef('d',c,l,'sym4',3);
d4 = wrcoef('d',c,l,'sym4',4);
d5 = wrcoef('d',c,l,'sym4',5);
a5 = wrcoef('a',c,l,'sym4',5);
s_origin=d1+d2+d3+d4+d5+a5;
Upvotes: 1