小波去噪函數(shù)二(轉(zhuǎn))
Wden函數(shù):一維信號(hào)的小波消噪處理
[xd,cxd,lxd]=wden(x,tptr,sorh,scal,n,‘wname’);返回經(jīng)過小波消噪處理后的信號(hào)xd及其小波分解結(jié)構(gòu)。
輸入?yún)?shù)tptr為閾值選擇標(biāo)準(zhǔn):
thr1=thselect(x,'rigrsure');%stein無偏估計(jì);
thr2=thselect(x,'heursure');%啟發(fā)式閾值;
thr3=thselect(x,'sqtwolog');%固定式閾值;
thr4=thselect(x,'minimaxi');%極大極小值閾值;
輸出參數(shù)sorh為函數(shù)選擇閾值使用方式:
Sorh=s,為軟閾值;
Sorh=h,為硬閾值;
輸入?yún)?shù)scal規(guī)定了閾值處理隨噪聲水平的變化:
Scal=one,不隨噪聲水平變化。
Scal=sln,根據(jù)第一層小波分解的噪聲水平估計(jì)進(jìn)行調(diào)整。
Scal=mln,根據(jù)每一層小波分解的噪聲水平估計(jì)進(jìn)行調(diào)整。
[xd,cxd,lxd]=wden(c,l,tptr,sorh,scal,n,‘wname’);由有噪信號(hào)的小波分解結(jié)構(gòu)得到消噪處理后的信號(hào)xd,及其小波分解結(jié)構(gòu)。
例:比較不同閾值算法進(jìn)行信號(hào)消噪的處理結(jié)果;
r=2055415866;
snr=3;%設(shè)置信噪比;
[xref,x]=wnoise(3,11,snr,r);%產(chǎn)生有噪信號(hào);
lev=5;
xdH=wden(x,'heursure','s','sln',lev,'sym6');%heursure閾值信號(hào)處理;
xdR=wden(x,'rigrsure','s','sln',lev,'sym6');%rigrsure閾值信號(hào)處理;
xdS=wden(x,'sqtwolog','s','sln',lev,'sym6');%sqtwolog閾值信號(hào)處理;
xdM=wden(x,'minimaxi','s','sln',lev,'sym6');%minimaxi閾值信號(hào)處理;
subplot(3,2,1);
plot(xref);title('原始信號(hào)');
axis([1,2048,-10,10]);
subplot(3,2,2);
plot(x);title('有噪信號(hào)');
axis([1,2048,-10,10]);
subplot(3,2,3);
plot(xdH);xlabel('heursure閾值消噪處理后的信號(hào)');
axis([1,2048,-10,10]);
subplot(3,2,4);
plot(xdR);xlabel('rigrsure閾值消噪處理后的信號(hào)');
axis([1,2048,-10,10]);
subplot(3,2,5);
plot(xdS);xlabel('sqtwolog閾值消噪處理后的信號(hào)');
axis([1,2048,-10,10]);
subplot(3,2,6);
plot(xdM);xlabel('minimaxi閾值消噪處理后的信號(hào)');