Advertisement
Guest User

CreateTFfromFreqResponse.m

a guest
Dec 6th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. pkg load control;
  2. pkg load signal;
  3. clear all
  4. x = csvread('buckVfreqResp.csv');
  5. SampleFrequency = 20000;
  6. T = 1/SampleFrequency;
  7. f = x(:,1);
  8. r = x(:,2);
  9. phase_rad = x(:,3).*(pi/180);
  10. h = r.*cos(phase_rad) + r.*(sin(phase_rad)*i);
  11. w = f.*(2*pi*T);
  12. [b,a] = invfreqz(h,w,2,3)
  13. sys = tf(b,a)
  14. bode(sys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement