home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / POLYFUN.DI$ / RESI2.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  1.0 KB  |  29 lines

  1. function coeff = resi2(u,v,pole,n,k)
  2. %RESI2    Residue of a repeated pole.
  3. %    RESI2(U,V,POLE,N,K) returns the residue of a repeated pole
  4. %    of order N and the K-th power denominator of [1 -pole], where
  5. %    U and V represent the original polynomial ratio U/V.
  6. %    For example, if P is a pole of multiplicity 2,
  7. %    then this routine should be called twice with N = 2,
  8. %    first using K = 1, then K = 2.  If K is not provided,
  9. %    it defaults to N.  If N is not provided, it defaults to 1.
  10. %
  11. %    See also RESIDUE, POLYDER
  12.  
  13. %    Reference:
  14. %      A.V. Oppenheim and R.W. Schafer, Digital Signal Processing,
  15. %      Prentice-Hall, 1975, p. 56-58.  The method is described in 
  16. %      most signal processing and control theory texts.
  17.  
  18. %    Charles R. Denham, MathWorks, 1988.
  19. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  20.  
  21. if nargin < 4, n = 1; end
  22. if nargin < 5, k = n; end
  23.  
  24. u = u(:).'; v = v(:).'; p = [1 -pole];
  25. for j = 1:n, v = deconv(v,p); end
  26. for j = 1:n-k, [u,v] = polyder(u,v); end
  27. c = 1; if k < n, c = prod(1:n-k); end
  28. coeff = (polyval(u,pole) ./ polyval(v,pole)) ./ c;
  29.