資源描述:
《小波去噪舉例》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、[4]§4.6小波去噪舉例4.6.1MATLAB中用wnoise函數(shù)測(cè)試去噪算法sqrt_snr=3;init=231434;[x,xn]=wnoise(3,11,sqrt_snr,init);%WNOISEgeneratenoisywavelettestdata.%X=WNOISE(FUN,N)returnsvaluesofthetestfunctiongivenbyFUN,ona%2^Nsampleof[0,1].[X,XN]=WNOISE(FUN,N,SQRT_SNR)returnsthe%previousvectorXrescaledsuchtha
2、tstd(x)=SQRT_SNR.Thereturned%vectorXNcontainsthesametestvectorXcorruptedbyanadditiveGaussian%whitenoiseN(0,1).ThenXNhasasignal-to-noiseratioof(SQRT_SNR^2).%[X,XN]=WNOISE(FUN,N,SQRT_SNR,INIT)returnspreviousvectorsXand%XN,butthegeneratorseedissettoINIvalue.subplot(3,2,1),plot(x)titl
3、e('originaltestfunction')subplot(3,2,2),plot(xn)title('noisedfunction')%產(chǎn)生一個(gè)長(zhǎng)為2**11點(diǎn),包含高斯白噪聲的正弦信號(hào),噪聲的的標(biāo)準(zhǔn)偏差為3。lev=5;xd=wden(x,'heursure','s','one',lev,'sym8');%[XD,CXD,LXD]=WDEN(X,TPTR,SORH,SCAL,N,'wname')%returnsade-noisedversionXDofinputsignalXobtainedbythresholdingthe%waveletcoe
4、fficients.Additionaloutputarguments[CXD,LXD]arethewavelet%decompositionstructureofde-noisedsignalXD.(WDEN根據(jù)信號(hào)小波分解%結(jié)構(gòu)[C,L]對(duì)信號(hào)進(jìn)行去噪處理,返回處理信號(hào)XD,以及XD的小波分解%結(jié)構(gòu){CXD,LXD})。%TPTR(containsthresholdselectionrule)='heursure',%'heursure'isanheuristicvariantofthefirstoption%(選擇基于Stein無(wú)偏估計(jì)理論的自適應(yīng)域
5、值的啟發(fā)式改進(jìn))%SORH('s'or'h')isforsoftorhardthresholding(決定域值的使用方式)%SCAL(='onedefinesmultiplicativethresholdrescaling:'one'fornorescaling%(決定域值是否隨噪聲變化)'wname'='sym8'subplot(3,2,3),plot(xd)title('Onede-noisedfunction')%利用’sym8’小波對(duì)信號(hào)分解,在分解的第5層上,利用啟發(fā)式SURE域值選擇法對(duì)信號(hào)去噪。xd=wden(x,'heursure','s'
6、,'sln',lev,'sym8');%'sln'forrescalingusingasingleestimation%oflevelnoisebasedonfirstlevelcoefficients(根據(jù)第一層小波分解的噪聲方%差調(diào)整域值)subplot(3,2,4),plot(xd)title('Slnde-noisedfunction')%同上’sym8’小波對(duì)信號(hào)分解條件,但用軟SURE域值選擇算法對(duì)信號(hào)去噪。xd=wden(x,'sqtwolog','s','sln',lev,'sym8');%foruniversalthresholdsqrt
7、(2*log(.))(固定域值選擇算法去噪).subplot(3,2,5),plot(xd)title('Sqtwologde-noisedfunction')%同上’sym8’小波對(duì)信號(hào)分解條件,但用固定域值選擇算法去噪。[c,l]=wavedec(x,lev,'sym8');%WAVEDECperformsamultilevel1-Dwaveletanalysisusingeitheraspecific%wavelet'wname'oraspecificsetofwaveletdecompositionfilters(see%WFILTERS).[C,
8、L]=WAVEDEC(X,N,'wname')returnsthe