home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 9.ddi / IDENT.DI$ / PEFILT.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  591 b   |  24 lines

  1. function y=pefilt(b,a,u,t)
  2. %PEFILT    Auxiliary routine to PE
  3. %
  4. %    y = pefilt(b,a,u,t)
  5. %
  6. %    y is obtained as the filtered output to the system b/a with
  7. %    input u. The initial conditions are chosen so that the first
  8. %    values of y equal the entries in the vector t.
  9.  
  10. %    L. Ljung 87-08-08    
  11. %    Copyright (c) 1987-90 by The Mathworks Inc.
  12. %     All Rights Reserved
  13.  
  14. if nargin<4, t=[];end
  15. na=length(a)-1;nb=length(b)-1;
  16. n=max([na nb length(t)]);
  17. t=[t(:);zeros(n,1)];
  18. f1=filter(a,1,t(1:n));
  19.  
  20. f2=filter(b,1,u(1:n));
  21. x=f1(:)-f2(:);
  22. y=filter([b zeros(1,n-nb)],[a zeros(1,n-na)],u,x);
  23. end
  24.