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 个评论
Wayne King
2012-3-21
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
2012-3-21
回答(2 个)
Wayne King
2012-3-22
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 个评论
aravind raj
2012-3-26
Wayne King
2012-3-26
CXC are the coefficients for the compressed signal. C are the coefficients prior to compression.
aravind raj
2012-3-27
aravind raj
2012-3-27
Wayne King
2012-3-27
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');
类别
在 帮助中心 和 File Exchange 中查找有关 Wavelet Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!