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\$
1
  • \$\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\$ Nov 26, 2014 at 20:55

1 Answer 1

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\$
1
  • \$\begingroup\$ This works if you have the signals toolbox. It's more of a todo if you dont. \$\endgroup\$ Nov 26, 2014 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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