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

  1. function [at,bt,ct,dt] = lp2lp(a,b,c,d,wo)
  2. %LP2LP    Lowpass to lowpass analog filter transformation.
  3. %    [NUMT,DENT] = LP2LP(NUM,DEN,Wo) transforms the lowpass filter
  4. %    prototype NUM(s)/DEN(s) with unity cutoff frequency to a
  5. %    lowpass filter with cutoff frequency Wo.
  6. %    [AT,BT,CT,DT] = LP2LP(A,B,C,D,Wo) does the same when the
  7. %    filter is described in state-space form.
  8.  
  9. %    J.N. Little & G.F. Franklin  8-4-87
  10. %    Copyright (c) 1987 by the MathWorks, Inc.
  11.  
  12. if nargin == 3        % Transfer function case
  13.     % Transform to state-space
  14.     wo = c;
  15.     [a,b,c,d] = tf2ss(a,b);
  16. end
  17.  
  18. error(abcdchk(a,b,c,d));
  19. [ma,nb] = size(b);
  20. [mc,ma] = size(c);
  21.  
  22. % Transform lowpass to lowpass
  23. at = wo*a;
  24. bt = wo*b;
  25. ct = c;
  26. dt = d;
  27.  
  28. if nargin == 3        % Transfer function case
  29.     % Transform back to transfer function
  30.     b = poly(at);
  31.     at = poly(at-bt*ct)+(dt-1)*b;
  32.     bt = b;
  33. end
  34.