wden_Automatic 1-D denoising

该示例使用Haar小波通过DWT和MODWT对带有方块噪声的信号进行去噪,并对比了去噪前后的结果。通过设置随机种子确保结果可复现,然后生成信号并添加噪声。接着使用不同方法进行去噪,并通过L2和L-infinity范数评估去噪效果。
摘要由CSDN通过智能技术生成

This example denoises a blocky signal using the Haar wavelet with DWT and MODWT denoising. It compares the results with plots and metrics for the original and denoised versions.

First, to ensure reproducibility of results, set a seed that will be used to generate random noise.

rng('default')

Generate a signal and a noisy version with the square root of the signal-to-noise ratio equal to 3. Plot and compare each.

[osig,nsig] = wnoise('blocks',10,3);

plot(nsig,'r')

hold on

plot(osig,'b')

legend('Noisy Signal','Original Signal')

87deb42afd26d4b41b64421f70754588.png

Using the Haar wavelet, perform a level 6 wavelet decomposition of the noisy signal and denoise it using Donoho and Johnstone's universal threshold with level-dependent estimation of the noise. Obtain denoised versions using DWT and MODWT, both with soft thresholding.

wname = 'haar';

lev = 6 ;

[xdDWT,c1,l1] = wden(nsig,'sqtwolog','s','mln',lev,wname);

[xdMODWT,c2] = wden(nsig,'modwtsqtwolog','s','mln',lev,wname);

Plot and compare the original, noise-free version of the signal with the two denoised versions.

figure

plot(osig,'b')

hold on

plot(xdDWT,'r--')

plot(xdMODWT,'k-.')

legend('Original','DWT','MODWT')

hold off

61601437dd94a81936c8ff0c0fc3891e.png

Calculate the L2 and L-infinity norms of the difference between the original signal and the two denoised versions.

L2norm_original_DWT = norm(abs(osig-xdDWT),2)

L2norm_original_DWT = 36.1194

L2norm_original_MODWT = norm(abs(osig-xdMODWT),2)

L2norm_original_MODWT = 14.5987

LInfinity_original_DWT = norm(abs(osig-xdDWT),Inf)

LInfinity_original_DWT = 4.7181

LInfinity_original_MODWT = norm(abs(osig-xdMODWT),Inf)

LInfinity_original_MODWT = 2.9655

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值