matlab wpdencmp,Denoising or compression using wavelet packets

This example shows how to compress a 1-D signal using wavelet packets.

Load a signal. Use ddencmp to determine compression values for that signal.

load sumlichr

x = sumlichr;

[thr,sorh,keepapp,crit] = ddencmp('cmp','wp',x)

thr = 0.5193

sorh =

'h'

keepapp = 1

crit =

'threshold'

Compress the signal using global thresholding with threshold best basis. Use the order 4 Daubechies least asymmetric wavelet and do a three-level wavelet packet decomposition.

[xc,wpt,perf0,perfl2] = wpdencmp(x,sorh,3,'sym4',crit,thr,keepapp);

Compare the original signal with the compressed version.

subplot(2,1,1)

plot(x)

title('Original Signal')

axis tight

subplot(2,1,2)

plot(xc)

xlabel(['L^2 rec.: ',num2str(perfl2),'% zero cfs.: ',num2str(perf0),'%'])

title('Compressed Signal Using Wavelet Packets')

axis tight

cde3e2f9660d4dbe1782d02241b94373.png

Compress the signal again, but this do a three-level wavelet decomposition. Keep all the other parameters the same.

[thr,sorh,keepapp] = ddencmp('cmp','wv',x);

[xcwv,~,~,perf0wv,perfl2wv] = wdencmp('gbl',x,'sym4',3,thr,sorh,keepapp);

figure

subplot(2,1,1)

plot(x)

title('Original Signal')

axis tight

subplot(2,1,2)

plot(xc)

xlabel(['L^2 rec.: ',num2str(perfl2wv),'% zero cfs.: ',num2str(perf0wv),'%'])

title('Compressed Signal Using Wavelets')

axis tight

1f0533c08872303311955b7a574af685.png

A larger fraction of coefficients are set equal to 0 when compressing using a wavelet packet decomposition.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值