Matlab way to extract the frequency from a bode plot

Status
Not open for further replies.

psi

Member level 2
Joined
Jan 13, 2003
Messages
42
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
268
In matlab is there a way to extract the frequency from a bode plot for a given magnitude?

You can extract the magnitude for a given frequency, but I want it to be the other way around.

Thanks
 

It can be done in this way:

clear all
kg=tf([20],[1 2 0])
nupoints=1000;%finest reticule, best result
freq=logspace(-2,2,nupoints);
[mag1(1:nupoints),phase1(1:nupoints)]=bode(kg,freq);
mag=20*log10(mag1)
semilogx(freq,mag);%seeing the bode plot obtained
% by example I go to find a frecuence at which the magitude is 20dB
% for this we do interpolation over the obtained curve
hold on
desiredw=interp1(mag,freq,20)
plot(desiredw,20,'r+')% see the value


regards
nebisman
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…