I have calculated a transfer function for a specific system (a low pass filter):
$$H(j\omega)=\frac{1}{RCj\omega +1}$$
It seems to me that the standard way of plotting the frequency response of the filter is to use a Bode plot. Therefore I want to know how to do that in Matlab.
There is a function bodeplot in Matlab which for instance takes an argument calculated with tf
, which in turn takes a numerator and denominator.
I don't actually understand how I should use those functions with my already calculated formula above. Have I already calculated some part which could be done with the above mentioned Matlab functions?
So, how do I make a Bode plot from my transfer function, in Matlab?
Here is my current Matlab plot, which plots the frequency response (but not with dB on the y-scale):
f = 0:100000;
R = 33e3;
C = 220e-12;
w = 2*pi*f;
H_w = 1./(R.*C.*j.*w+1);
xaxis = 0:100000;
figure;
semilogx(xaxis,abs(H_w));
-
\$\begingroup\$ I don't know matlab, but a bode plot is on a log - log scale. Log of the amplitude response vs log of the frequency. \$\endgroup\$George Herold– George Herold2014年11月26日 20:55:27 +00:00Commented Nov 26, 2014 at 20:55
1 Answer 1
Call tf
with vectors of the coefficients for the numerator and denominator (ordered from highest power to lowest):
H = tf([1],[RC 1]);
where RC
is your \$RC\$ time constant.
Then call bode(H)
.
See the Matlab documentation (especially the examples).
-
\$\begingroup\$ This works if you have the signals toolbox. It's more of a todo if you dont. \$\endgroup\$Scott Seidman– Scott Seidman2014年11月26日 22:43:46 +00:00Commented Nov 26, 2014 at 22:43