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

  1. function [b,a] = prony(h, nb ,na)
  2. %PRONY    Prony's method for time-domain IIR filter design.
  3. %    [B,A] = PRONY(H, NB, NA) finds a filter with numerator order
  4. %    NB, denominator order NA, and having the impulse response in
  5. %    vector H.   The IIR filter coefficients are returned in
  6. %    length NB+1 and NA+1 row vectors B and A, ordered in
  7. %    descending powers of Z.
  8. %
  9. %    See also: BUTTER, CHEBY1, CHEBY2, ELLIP, INVFREZ.
  10.  
  11. %    L. Shure 5-17-88
  12. %    Revised LS 17-Dec-90
  13. %    (c) Copyright 1988, by The MathWorks, Inc.
  14.  
  15. %    References:
  16. %      [1] T.W. Parks and C.S. Burrus, Digital Filter Design,
  17. %          John Wiley and Sons, 1987, p226.
  18.  
  19. K = length(h) - 1;
  20. M = nb; N = na;
  21. c = h(1);
  22. H = tril(toeplitz(h/c));    
  23. % K+1 by N+1
  24. if (K > N)
  25.     H(:,(N+2):(K+1)) = [];
  26. end
  27. % Partition H matrix
  28. H1 = H(1:(M+1),:);    % M+1 by N+1
  29. h1 = H((M+2):(K+1),1);    % K-M by 1
  30. H2 = H((M+2):(K+1),2:(N+1));    % K-M by N
  31. a = [1; -H2\h1].';
  32. b = c*a*H1.';
  33.  
  34.