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

  1. function w=dfrqint(a,b,c,d,Ts,npts)
  2. %DFRQINT Discrete auto-ranging algorithm for dBode plots.
  3. %
  4. %    W=DFRQINT(A,B,C,D,Ts,NPTS)
  5. %    W=DFRQINT(NUM,DEN,Ts,NPTS)
  6.  
  7. %    Clay M. Thompson 7-10-90
  8. %     Revised ACWG 11-25-91
  9. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  10.  
  11. if nargin==4,
  12.   Ts = c; npts = d;
  13.   [a,b,c,d] = tf2ss(a,b);
  14. end
  15. [a1,b1] = d2cm(a,b,c,d,Ts,'tustin');
  16. w=freqint(a1,b1,c,d,npts);
  17. w=w(find(w<=pi/Ts));
  18. if ~isempty(w), 
  19.    w=sort([w(:) ; linspace(min(w),pi/Ts,128).']);
  20. else
  21.   w=linspace(pi/Ts/10,pi/Ts,128).';
  22. end
  23.