wavelet compression

i am doing project related to signal compression & i tried in wavelet toolbo. i took original signal as 8 kb... i compressed using db4 level 4 then i saved the compressedsignal... it contains 26.7 kb. i dont know the reason why the file size increased. help me to solve the problem thanks aravind

2 commentaires

Wayne King
Wayne King le 21 Mar 2012
Can you please show the code you used? Just create a vector the same size as your signal to use in your example.
aravind raj
aravind raj le 21 Mar 2012
hai wayne,
i took input vector('100.mat' 1 x 3600 (8kb)) by using graphical view of wavelet toolbox(wavemenu). i the daubechies wavelet (db4) in right side pane with level 4 then i pressed the analyse button then i pressed the compress button,i viewed the compressed signal by using 'view compressed signal button' i saved the compressed signal (file->save->compressed signal) but compressed signal file size leads to 26.6 kb, i cant understand your comment "just create a vector the same size as your signal to use in your example" plz explain me elaborately and help me to solve this problem

Connectez-vous pour commenter.

Réponses (2)

Wayne King
Wayne King le 22 Mar 2012

0 votes

Hi Aravind, What you want to do to actually see the savings in compression is to look at the wavelet coefficients, not the synthesized signal (or image).
In a wavelet application, you take a signal or image that requires a certain amount of storage and replace that signal or image with the wavelet coefficients. Then you use the wavelet coefficients to reconstruct the signal or image. The compression results from the reducing the signal or image to a smaller number of wavelet coefficients. For example:
load leleccum;
thr = 62.91*ones(4,1);
sorh = 'h';
[XC,CXC,LXC,PERF0,PERFL2] = wdencmp('lvd',leleccum,'db4',4,thr,sorh);
subplot(211)
plot(leleccum); title('Original Signal');
subplot(212)
plot(XC); title('Compressed Signal');
% Now plot coefficients
figure;
[C,L] = wavedec(leleccum,4,'db4');
subplot(211)
plot(C); title('Original Wavelet Coefficients');
subplot(212)
plot(CXC); title('Compressed Coefficients');
set(gca,'ylim',[-1e3 3e3]);
Look the larger number of zero coefficients in CXC than C
PEF0 gives you a compression score.

4 commentaires

aravind raj
aravind raj le 26 Mar 2012
hi wayne, now which i have to take whether the 'XC' or 'CXC' or 'C' for compressed signal?
Wayne King
Wayne King le 26 Mar 2012
CXC are the coefficients for the compressed signal. C are the coefficients prior to compression.
aravind raj
aravind raj le 27 Mar 2012
i also took cxc coefficients but its size too larger than the origial signal. if i took cxc and how can i reconstruct the original signal cxc. actualy my question is to find the compression ratio between the different type of wavelet families. that's why i am trying to find the solution for reducing the compressed signal(or coefficients) size.
aravind raj
aravind raj le 27 Mar 2012
hai wayne
i used one dimensional signal so i cant use the option 'lvd', i have only used the 'gbl'

Connectez-vous pour commenter.

Wayne King
Wayne King le 27 Mar 2012

0 votes

Aravind, I'm not sure what you mean by "i used one dimensional signal so i cant use the option 'lvd'".
This is not true. In my example above, I have used a 1-D signal with the 'lvd' option.
The CXC vector is larger than the original signal because of the extra coefficients due to the extension mode. You may be able to fix that by simply executing:
>>dwtmode('per');
In terms of your second question, you can reconstruct the signal as follows: (again, I'm using a 1-D example)
load leleccum;
thr = 62.91*ones(4,1);
sorh = 'h';
[XC,CXC,LXC,PERF0,PERFL2] = wdencmp('lvd',leleccum,'db4',4,thr,sorh);
xrec = waverec(CXC,LXC,'db4');

1 commentaire

aravind raj
aravind raj le 30 Mar 2012
>>s=load('100.mat' % 100 is original signal
>> [c,l] = wavedec(s,4,'db4'); %mulilevel decomposition
>> save decomposed_coeff_at_haar4_c.mat c;
>> A4 = wrcoef('a',c,l,'db4',4);
>> save reconstructed_db4_A4.mat A4;
>> [thr,sorh,keepapp] = ddencmp('cmp','wv',s);
[xd,cxd,lxd,pref,pref0]=wdencmp('gbl',c,l,'db4',4,thr,sorh,keepapp);
>> save reconstructed_xd.mat xd;
>> save compressed_coefficients_cxd.mat cxd;
the above "compressed_coefficients size is larger than the original signa
if any mistakes are in the above code, give me the corrections

Connectez-vous pour commenter.

Catégories

En savoir plus sur Wavelet Toolbox dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by