利用小波包对一维信号进行降噪或压缩(MATLAB)

 

function [ output_args ] = example4_12( input_args )
%EXAMPLE4_12 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
% 设置信噪比和随机数的初始值
snr = 3; init = 2055615866; 
% 生成一个原始信号xref和含高斯白噪声的信号x
[xref,x] = wnoise(3,11,snr,init);
figure(1)
subplot(321)
plot(xref), axis([1 2048 -10 10]); 
title('原始信号'); 
subplot(322)
plot(x), axis([1 2048 -10 10]); 
title('含噪信号'); 
%使用heursure阈值降噪
lev = 5;
xd = wden(x,'heursure','s','one',lev,'sym8');
subplot(323)
plot(xd), axis([1 2048 -10 10]); 
title('降噪信号- heuristic阈值'); 
%使用rigrsure阈值降噪
xd = wden(x,'rigrsure','s','sln',lev,'sym8');
subplot(324)
plot(xd), axis([1 2048 -10 10]); 
title('降噪信号 - rigrsure阈值'); 
%使用sqtwolog阈值降噪
xd = wden(x,'sqtwolog','s','sln',lev,'sym8');
subplot(325)
plot(xd), axis([1 2048 -10 10]); 
title('降噪信号 - sqtwologsqtwolog阈值'); 
%使用minimaxi阈值降噪
xd = wden(x,'minimaxi','s','sln',lev,'sym8');
subplot(326)
plot(xd), axis([1 2048 -10 10]); 
title('降噪信号 - minimaxi阈值'); 

end

function [ output_args ] = example4_13( input_args )
%EXAMPLE4_13 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
% 设置信噪比和随机数的初始值
snr = 3; init = 2055615866; 
% 生成一个原始信号xref和含高斯白噪声的信号x
[xref,x] = wnoise(5,11,7,init);
x=x(1:1000);
xref=xref(1:1000);
n = length(x)
figure(1)
subplot(311)
plot(xref), axis([1 1000 -15 15]); 
title('原始信号'); 
subplot(312)
plot(x), axis([1 1000 -15 15]); 
title('含噪信号'); 
%使用wpdencmp降噪
thr = sqrt(2*log(n*log(n)/log(2))); 
xwpd = wpdencmp(x,'s',4,'sym4','sure',thr,1);
subplot(313)
plot(xwpd); 
title('小波包降噪信号'); 
axis([1 1000 -15 15]); 
end

 

 

 

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

深度学习的奋斗者

你的鼓励是我努力的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值