wenjie 发表于 2010-3-5 16:36

matlab 求分层阈值函数

本帖最后由 wdhd 于 2016-9-20 13:29 编辑

  function = wdcbm(c,l,alpha,m)
  % Check arguments.
  nbIn = nargin;
  if nbIn < 3
  error('Not enough input arguments.');
  end
  if errargt(mfilename,alpha-1,'rep'), error('*'), end
  if nbIn==4
  if errargt(mfilename,m-1,'rep'), error('*'), end
  else
  m = l(1);
  end
  m = max(m,1);
  J = length(l)-2; % low frequency cutoff.
  thr = zeros(1,J);
  nkeep = zeros(1,J);
  % Wavelet coefficients selection.
  for j=1:J
  % number of coefs to be kept.
  n = m/(J+2-j)^alpha;
  n = min(round(n),l(J-j+2));
  % threshold.
  if n == l(J-j+2)
  thr(j) = 0;
  else
  d = detcoef(c,l,j);
  d = sort(abs(d));
  thr(j) = d(end-n);
  end
  nkeep(j) = n;
  end
  请问红色代码的用意是什么?看不懂,谢谢大家
页: [1]
查看完整版本: matlab 求分层阈值函数