0

I have the following system:

enter image description here

I am required to find its frequency response using freqresp() function and find its magnitude response over the range 0 ≤ ω ≤ 20 in steps of 0.01. I am also required to plot its magnitude response and compare the results with its pole zero plot. I wrote following code for this in matlab but don't know whats the problem with this. The code is running without error but I think the plot of magnitude response is wrong. Kindly help me about these questions.

w = 0:0.01:20;
num = [3 4]; 
den = [1 5 8 4]; 
zeros = roots(num);
poles = roots(den);
H = tf (num,den);
%pzmap(H)
%grid on
H1 = freqresp(H,w);
H2 = squeeze(H1);
plot(w,abs(H2))
xlabel('w');
ylabel('freq response');
James Z
  • 12,209
  • 10
  • 24
  • 44
Muhammad Ali
  • 1
  • 1
  • 4
  • 2
    "but I think the plot of magnitude response is wrong" why do you think that? Do you have the expected response for the problem? your code seems fine – Thales Oct 29 '20 at 15:29
  • No, I don't have the expected response. As my frequency response is not relating pole zero plot that's why I am thinking that there is something wrong here and I don't what's that. – Muhammad Ali Oct 29 '20 at 17:36
  • 1
    plot it with `semilogx` – rinkert Oct 30 '20 at 08:15

0 Answers0