• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

MATLAB小波去噪

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

MATLAB中用wnoise函数测试去噪算法

sqrt_snr=3;

init=231434;

[x,xn]=wnoise(3,11,sqrt_snr,init);

% WNOISE generate noisy wavelet test data.

%  X= WNOISE(FUN,N) returns values of the test function given by FUN, on a

%  2^N sample of [0,1]. [X,XN] = WNOISE(FUN,N,SQRT_SNR) returns the

%  previous vector X rescaled such that std(x) = SQRT_SNR. The returned

%  vector XN contains the same test vector X corrupted by an additive Gaussian   %  white noise N(0,1). Then XN has a signal-to-noise ratio of (SQRT_SNR^2).

% [X,XN] = WNOISE(FUN,N,SQRT_SNR,INIT) returns previous vectors X and % XN, but the generator seed is set to INI value.

subplot(3,2,1),plot(x)

title('original test function')

subplot(3,2,2),plot(xn)

title('noised function')

%产生一个长为2**11点,包含高斯白噪声的正弦信号,噪声的的标准偏差为3

 

lev=5;

xd=wden(x,'heursure','s','one',lev,'sym8');

% [XD,CXD,LXD] = WDEN(X,TPTR,SORH,SCAL,N,'wname') 

% returns a de-noised version XD of input signal X obtained by thresholding the % wavelet coefficients. Additional output arguments [CXD,LXD] are the wavelet % decomposition structure of de-noised signal XD.WDEN根据信号小波分解% 结构[C,L]对信号进行去噪处理,返回处理信号XD,以及XD的小波分解% 结构 {CXDLXD})。

% TPTR(contains threshold selection rule)='heursure', 

% 'heursure' is an heuristic variant of the first option

% (选择基于Stein无偏估计理论的自适应域值的启发式改进)

% SORH ('s' or 'h') is for soft or hard thresholding(决定域值的使用方式)

% SCAL(='onedefines multiplicative threshold rescaling:'one' for no rescaling

%(决定域值是否随噪声变化) 'wname'='sym8'

subplot(3,2,3),plot(xd)

title('One de-noised function')

% 利用sym8小波对信号分解,在分解的第5层上,利用启发式SURE域值选择法对信号去噪。

 

xd=wden(x,'heursure','s','sln',lev,'sym8'); 

% 'sln' for rescaling using a single estimation 

% of level noise based on first level coefficients(根据第一层小波分解的噪声方% 差调整域值)

subplot(3,2,4),plot(xd)

title('Sln de-noised function')

% 同上sym8小波对信号分解条件,但用软SURE域值选择算法对信号去噪。

 

xd=wden(x,'sqtwolog','s','sln',lev,'sym8'); 

% for universal threshold sqrt(2*log(.))(固定域值选择算法去噪).

subplot(3,2,5),plot(xd)

title('Sqtwolog de-noised function')

% 同上sym8小波对信号分解条件,但用固定域值选择算法去噪。

 

 

 

[c,l]=wavedec(x,lev,'sym8'); 

% WAVEDEC performs a multilevel 1-D wavelet analysis using either a specific  wavelet 'wname' or a specific set of wavelet decomposition filters (see WFILTERS).[C,L] = WAVEDEC(X,N,'wname') returns the wavelet decomposition of the  signal X at level N, using 'wname'. The output    decomposition structure contains the wavelet decomposition vector C(按照一定顺序存储信号小波分解的近似分量和细节分量的系数)and the bookkeeping vector L(各近似分量和细节分量系数的长度).  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi6/7中XML文档的应用发布时间:2022-07-18
下一篇:
Delphi控制摄像头发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap