ValSUREThresh2.m
资源名称:小波去噪.rar [点击查看]
上传用户:sla11nk8
上传日期:2013-03-09
资源大小:21k
文件大小:1k
源码类别:
其他
开发平台:
Matlab
- function thresh = ValSUREThresh2(y)
- %
- %%%%%%It's My Own Function!!!
- %
- % ValSUREThresh -- Adaptive Threshold Selection Using Principle of SURE
- % Usage
- % thresh = ValSUREThresh(y)
- % Inputs
- % y 2-d Noisy Data with Std. Deviation = 1
- % Outputs
- % thresh Value of Threshold
- %
- % Description
- % SURE referes to Stein's Unbiased Risk Estimate.
- %
- m=length(y);
- x=[];
- for k=1:m
- x=[x y(k,:)];
- end;
- a = sort(abs(x)).^2 ;
- b = cumsum(a);
- n = m*m;%length(x);
- c = linspace(n-1,0,n);
- s = b+c.*a;
- risk = (n - ( 2 .* (1:n )) + s)/n;
- %figure;plot(1:n,risk(1:n));
- [guess,ibest] = min(risk);
- thresh = sqrt(a(ibest));