• 大小: 2KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-06-02
  • 语言: Matlab
  • 标签: 小波去噪  

资源简介

小波去噪matlab代码 欢迎下载使用!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

资源截图

代码片段和文件信息

%s=[6.1386 6.1372 6.1366 6.1361 6.1350 6.1347 6.1345 6.1329  6.1338 6.1331 6.1325 6.1329 6.1327 6.1337 6.1339 6.1341 6.1338 6.1342 6.1345 6.1340];
q=xlsread(‘0409.xlsx‘‘sheet2‘‘a1:a40‘);
s=q‘;
save 412 s;
wname=‘db4‘;
lev=2;
[cl]=wavedec(s2‘db4‘);
a4=appcoef(cl‘db4‘2);
%d4=detcoef(cl4);
%d3=detcoef(cl3);
d2=detcoef(cl2);
d1=detcoef(cl1);
cD=[d1d2];
%sigma=median(abs(cD))/0.6745;
%thr1=(sigma*sqrt(2*(log(length(d1)))))/(log(1+1));
thr1=thselect(d1‘rigrsure‘);
for i=1:length(d1)
if(abs(d1(i))>=thr1)
cD1(i)=(1-exp(-(d1(i)-thr1)^2))*d1(i)+exp(-(d1(i)-thr1)^2)*sign(d1(i))*(abs(d1(i))-0.9*thr1*log2(abs(thr1/d1(i)).^3+1));%估计第一层小波系数
else
cD1(i)=0;
end
end
%thr2=(sigma*sqrt(2*(log(length(d2)))))/(log(2+1));
thr2=thselect(d2‘rigrsure‘);
for i=1:length(d2)
if(abs(d2(i))>=thr2)
cD2(i)=(1-exp(-(d2(i)-thr2)^2))*d2(i)+exp(-(d2(i)-thr2)^2)*sign(d2(i))*(abs(d2(i))-0.9*thr2*log2(abs(thr2/d2(i)).^3+1));%估计第二层小波系数
else
cD2(i)=0;
end
e

评论

共有 条评论