home *** CD-ROM | disk | FTP | other *** search
/ ftp.disi.unige.it / 2015-02-11.ftp.disi.unige.it.tar / ftp.disi.unige.it / pub / .person / BarlaA / sw / matlab / Cromwell / signal2noise.m < prev    next >
Text File  |  2007-12-04  |  407b  |  15 lines

  1. function sn = signal2noise(raw, base, smooth)
  2.  
  3. % Copyright (c) 2003, 2004 UT M.D. Anderson Cancer Center. All rights reserved.
  4. % See the accompanying file "license.txt" for details.
  5.  
  6. xx=abs(raw-smooth);
  7. [rx cx] = size(xx);
  8. yy = repmat(0, [rx cx-500]);
  9. for i = 1:cx-500,
  10.    yy(:, i) = mean(xx(:, i:i+500)')';
  11. end
  12. yy=[repmat(yy(:, 1), [1 250]) yy repmat(yy(:, end), [1 250])];
  13. sn = base ./ yy;
  14.  
  15.