Sunday, November 6, 2011

Make your own Bode plot paper

Make your own Bode plot paper

When making Bode plots one needs two pieces of semi-logarithmic paper, one for the magnitude plot and one for the phase.  The program described here, BodePaper.m, can be used to make paper.   Download it and save it so that MatLab can find it (from the Matlab menu you can go to File->Set Path and include the directory where you stored the BodePaper.m file.) 
The syntax for calling is given by the function's help file.
>> help BodePaper

BodePaper is Matlab code to generate graph paper for Bode plots. It generates
two semilog graphs for making Bode plots. The top plot is for magnitude, the 
units on the vertical axis is set to dB. The bottom plot shows phase. The 
units on the phase plot can be radians or degrees, at the discretion of the 
user. The default is degrees.

The correct calling syntax is:
BodePaper(om_lo, om_hi, dB_lo, dB_hi, ph_lo, ph_hi, UseRad)
    om_lo the low end of the frequency scale. This can be either
        rad/sec or Hz. No units are displayed on the graph.
    om_hi the high end of the frequency scale.
    dB_lo the bottom end of the dB scale.
    dB_hi the top end of the dB scale.
    ph_lo the bottom end of the phase scale.
    ph_hi the top end of the phase scale.
    UseRad an optional argument. If this argument is non-zero the units
        on the phase plot are radians. If this argument is left off
        or set to zero, the units are degrees.

To make paper that goes from 0.1 Hz to 100 Hz, with the magnitude scale going from -60 to 40 dB and the phase from -180 to 90 degrees, the function call would be
>> BodePaper(0.1,100,-60,40,-180,90)
and the paper looks like:
Bode Plot Paper

To change the units on phase the function call would be:
and the paper now looks like this:
Bode Paper,Radians

No comments:

Post a Comment

Thanks for stopping by leaving a comment.
I am looking forward to make some new posts of such a kind. make sure to visit and leave comments which will help me in improving my blog. and don't forget to share with your friends.

Regards sri vastav.