home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS1.DI$ / VIFFT.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.0 KB  |  46 lines

  1. % function yout = vifft(yin)
  2. %
  3. %  Perform an inverse FFT on the VARYING matrix Y.  It is assumed
  4. %  that the YIN is a frequency scale in rad/sec and YOUT is returned 
  5. %  with a time scale in seconds.  The frequency scale is assumed to
  6. %  be monotonic and only the first interval is used to determine
  7. %  the time scale.
  8. %
  9. %  See also:  FFT, IFFT and  VIFFT.
  10.  
  11. function y = vifft(Y)
  12. if nargin ~= 1,
  13.     disp('usage: y = vifft(Y)')
  14.     return
  15.     end
  16.  
  17. [type,nr,nc,npts] = minfo(Y);
  18. if type == 'syst',
  19.     error('input is not VARYING or CONSTANT')
  20.     return
  21.     end
  22.  
  23. if type == 'cons' | npts == 1,
  24.     y = Y;
  25.     return
  26.     end
  27.  
  28. [Ydat,yptr,w] = vunpck(Y);
  29. winc = w(2) - w(1);
  30. tinc = 2*pi/(winc*npts);
  31. t = [0:tinc:tinc*(npts-1)];
  32.  
  33. y = [];
  34. for i = 1:nr,
  35.     yrow = [];
  36.     for j = 1:nc
  37.         [Ydat,yptr,w] = vunpck(sel(Y,i,j));
  38.         sisoy = ifft(Ydat);
  39.         sisoy = vpck(sisoy,t);
  40.         yrow = sbs(yrow,sisoy);
  41.         end
  42.     y = abv(y,yrow);
  43.     end
  44. %
  45. % Copyright MUSYN INC 1991,  All Rights Reserved
  46.