Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. clear all
  2. clc
  3. l=[50];
  4. m=[1 5 50];
  5. G=tf(l,m);
  6. subplot(4,1,1)
  7. step(G)
  8. T=5000;
  9. dt=0.01
  10. t=0:dt:T-dt;
  11. x=randn(size(t));
  12. subplot(4,1,2)
  13. plot(t,x)
  14. y=lsim(G,x,t);
  15. y=y';
  16. subplot(4,1,3)
  17. lsim(G,x,t)
  18.  
  19. X=fft(x);
  20. Y=fft(y);
  21.  
  22. PSDxy=(2*dt^2*conj(X).*Y)/T;
  23. PSDxx=(2*dt^2*conj(X).*X)/T;
  24.  
  25. Gxy=PSDxy./PSDxx;
  26. Gxy=decimate(Gxy,10);
  27. subplot(4,1,4)
  28. plot(Gxy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement