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

  1. function [dga,dgp]=ffsdcal(a,b,f,na,nb,nf,nk,GC,OM,P,T)
  2. % FFSDCAL    Auxiliary function to TH2FF
  3. %
  4. %    [dga,dgp]=ffsdcal(a,b,f,na,nb,nf,nk,GC,OM,P,T)
  5.  
  6.  
  7. %    L. Ljung 4-8-90
  8. %    Copyright (c), 1990 The MathWorks, Inc.
  9. %    All Rights Reserved
  10.  
  11. % *** Now compute the standard deviations ***
  12. %
  13. %    D3 = " dGC/dTHETA "
  14. %
  15. if T>0,
  16.     D3=[((-GC./(a*OM(1:na+1,:)))'*ones(1,na)).*OM(2:na+1,:)',((GC./(b*OM(1:length(b),:)))'*ones(1,nb)).*OM(nk+1:nk+nb,:)',((-GC./(f*OM(1:nf+1,:)))'*ones(1,nf)).*OM(2:nf+1,:)'];
  17. else
  18.     D3=[((-GC./(a*OM(na+1:-1:1,:)))'*ones(1,na)).*OM(na:-1:1,:)',((GC./(b*OM(length(b):-1:1,:)))'*ones(1,nb)).*OM(nb:-1:1,:)',((-GC./(f*OM(nf+1:-1:1,:)))'*ones(1,nf)).*OM(nf:-1:1,:)'];
  19. end
  20.  
  21.  
  22.     D4=D3*P;
  23. %
  24. %   The matrix [C1 C3;conj(C3) C2] is the covariance matrix of [Re GC; Im GC]
  25. %   according to Gauss' approximation formula
  26. %    
  27.     C1=sum((real(D4).*real(D3))')';
  28.     C2=sum((imag(D4).*imag(D3))')';
  29.     C3=sum((imag(D4).*real(D3))')';
  30. %
  31. %   Now translate these covariances to those of abs(GC) and arg(GC)
  32. %
  33.     dga=sqrt((real(GC').^2).*C1+2*((real(GC')).*(imag(GC'))).*C3+(imag(GC').^2).*C2)./abs(GC');
  34.     dgp=(180/pi)*sqrt((imag(GC').^2).*C1-2*((real(GC')).*imag(GC')).*C3+(real(GC').^2).*C2)./(abs(GC').^2);
  35.