I have a frequency response X1 = ((j.*w+100).*(j.*w+200))./((j.*w+10).*(j.*w+1000).*(j.*w+10000)); and would like to plot its magnitude in dB and phase versus the log of frequency with frequency from 0.5Hz to 3000Hz in steps of 5Hz but it doesn't seem to work because of the 'j' in my function.
This is my code:
clf % Clear any existing figure
w = log(0.5):log(5):log(3000); % Frequency from 0.5Hz to 3000Hz with increment of 5Hz
X1 = ((j.*w+100).*(j.*w+200))./((j.*w+10).*(j.*w+1000).*(j.*w+10000)); % Blue
subplot(2,1,1)
plot(w,abs(X1));
title('Magnitude')
ylabel('Magnitude (db)')
xlabel('Log of Frequency')
ylim([-1 10]);
grid on
subplot(2,1,2)
plot(w,angle(X1));
title('Phase')
ylabel('Phase (°)')
xlabel('Log of Frequency')
grid on
Best Answer