wavelet compression
Show older comments
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 Comments
Wayne King
on 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
on 21 Mar 2012
Answers (2)
Wayne King
on 22 Mar 2012
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 Comments
aravind raj
on 26 Mar 2012
Wayne King
on 26 Mar 2012
CXC are the coefficients for the compressed signal. C are the coefficients prior to compression.
aravind raj
on 27 Mar 2012
aravind raj
on 27 Mar 2012
Wayne King
on 27 Mar 2012
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 Comment
aravind raj
on 30 Mar 2012
Categories
Find more on Wavelet Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!