2
\$\begingroup\$

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));
\$\endgroup\$
  • \$\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 Nov 26 '14 at 20:55
3
\$\begingroup\$

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).

\$\endgroup\$
  • \$\begingroup\$ This works if you have the signals toolbox. It's more of a todo if you dont. \$\endgroup\$ – Scott Seidman Nov 26 '14 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.