MATLAB: Finding frequency corresponding to some gain in magnitude plot of bode

control system

Hi Community members !
Can you please help me in getting a solution to my problem? I have a transfer function e.g. G(s) = 144000/(s*(s+36)*(s+100)), bode plot of which is given. The magnitude plot passes through -3.76 dB gain at some particular value of frequency. I want to access that particular frequency value using MATLAB program.
Thanks !

Best Answer

Try this:
s = tf('s');
G = 144000/(s*(s+36)*(s+100));
[mag,phase,wout] = bode(G);
mag = squeeze(mag);
phase = squeeze(phase);
wq = interp1(20*log10(mag), wout, -3.76); % Find Desired Frequency
figure
semilogx(wout, 20*log10(mag), wq, -3.76, 'r+')
grid
text(wq, -3.76, sprintf('\\leftarrow -3.76 dB at %.2f rad/sec',wq), 'HorizontalAlignment','left', 'VerticalAlignment','middle')
The result is:
wq =
39.034
so your transfer function will equal -3.76 dB at 39.034 rad/sec.