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 / pad.m < prev    next >
Text File  |  2007-12-04  |  458b  |  13 lines

  1. function w = pad(spectrum, L)
  2. %
  3. % W = pad(spectrum, L)
  4. %
  5. % Pad an input vector representing a spectrum to get its length to equal
  6. % the next larger multiple of 2^L by reflecting the end of the spectrum.
  7.  
  8. % Copyright (c) 2003, 2004 UT M.D. Anderson Cancer Center. All rights reserved.
  9. % See the accompanying file "license.txt" for details.
  10.  
  11. needs = ceil(length(spectrum)/2.^L)*2.^L - length(spectrum);
  12. w = [spectrum spectrum(end:-1:end-needs+1)];
  13.