資源簡介
小波去噪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‘‘a(chǎn)1: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));%估計第一層小波系數(shù)
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));%估計第二層小波系數(shù)
else
cD2(i)=0;
end
e
評論
共有 條評論