home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 8.ddi / SIGNAL.DI$ / RCEPS.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  783 b   |  26 lines

  1. function [xhat, yhat] = rceps(x)
  2. %RCEPS    Real cepstrum.
  3. %    RCEPS(x) returns the real cepstrum of the sequence x.
  4. %    [xh, yh] = RCEPS(x) returns both the real cepstrum and a
  5. %    minimum phase signal derived from x.
  6. %    See also CCEPS, HILBERT, and FFT.
  7.  
  8. %    L. Shure 6-9-88
  9. %    Copyright (c) 1988 by the MathWorks, Inc.
  10.  
  11. %    References: 
  12. %      [1] A.V. Oppenheim and R.W. Schafer, Digital Signal 
  13. %          Processing, Prentice-Hall, 1975.
  14. %      [2] Programs for Digital Signal Processing, IEEE Press,
  15. %          John Wiley & Sons, 1979, algorithm 7.2.
  16.  
  17. n = max(size(x));
  18. xhat = real(ifft(log(abs(fft(x)))));
  19. if nargout > 1
  20.     odd = fix(rem(n,2));
  21.     wn = [1; 2*ones((n+odd)/2-1,1) ; 1; zeros((n-odd)/2-1,1)];
  22.     yhat = zeros(size(x));
  23.     yhat(:) = real(ifft(exp(fft(wn.*xhat(:)))));
  24. end
  25.  
  26.