Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a matlab program to plot the amplitude and phase responses of the second-o

ID: 1715286 • Letter: W

Question

write a matlab program to plot the amplitude and phase responses of the second-order low pass transfer function H(s) = 2 p /s 2 + (p/Q)s + 2 p . Use p = 1 and various values of Q (such as Q = 10, 5, 2, 1, 1/ 2, and 0.5.) Repeat for the second-order high pass, band pass, and notch transfer functions H(s) = s ^2/ s 2 + (p/Q)s + ^2 p , H(s) = (p/Q)s/ s^2 + (p/Q)s + ^2 p , H(s) = s ^2+ 2/ z s^2 + (p/Q)s + 62 p . These plots could be very useful in a filter design course. (Hint: Remember to set s = j when plotting frequency response curves.)

Explanation / Answer

Q=[10 5 2 1 1/sqrt(2) 0.5];
w_p=1;
for i=1:6
   %The second-order low pass transfer function
   num=[power(w_p,2)];
   den=[1 w_p/Q(i) power(w_p,2)];
   z=tf(num,den);
   bode (z)
   %The second-order high pass transfer function
   num=[1 0 0];
   den=[1 w_p/Q(i) power(w_p,2)];
   z=tf(num,den);
   bode (z)
   %The second-order high pass transfer function
   num=[1 0 0];
   den=[1 w_p/Q(i) power(w_p,2)];
   z=tf(num,den);
   bode (z)

   %The second-order band pass transfer function
   num=[1+power(w_p,2) w_p/Q(i) power(w_p,2)];
   den=[1];
   z=tf(num,den);
   bode (z)
end