bode
Bode frequency response of dynamic system
Syntax
Description
[ computes the frequency response of dynamic
system model
mag,phase,wout]
= bode(sys)sys and returns the magnitude and phase of the response at
each frequency in the vector wout. The function
automatically determines frequencies in wout based on
system dynamics.
bode(___) plots the frequency response of
sys with default plotting options for all of the
previous input argument combinations. The plot displays the magnitude (in dB)
and phase (in degrees) of the system response as a function of frequency. For
more plot customization options, use bodeplot.
To plot responses for multiple dynamic systems on the same plot, you can specify
sysas a comma-separated list of models. For example,bode(sys1,sys2,sys3)plots the responses for three models on the same plot.To specify a color, line style, and marker for each system in the plot, specify a
LineSpecvalue for each system. For example,bode(sys1,LineSpec1,sys2,LineSpec2)plots two models and specifies their plot style. For more information on specifying aLineSpecvalue, seebodeplot.
Examples
Input Arguments
Output Arguments
Tips
When you need additional plot customization options, use
bodeplotinstead.Plots created using
bodedo not support multiline titles or labels specified as string arrays or cell arrays of character vectors. To specify multiline titles and labels, use a single string with anewlinecharacter.bode(sys) title("first line" + newline + "second line");
Algorithms
The software computes the frequency response as follows:
Compute the zero-pole-gain (
zpk(Control System Toolbox)) representation of the dynamic system.Evaluate the gain and phase of the frequency response based on the zero, pole, and gain data for each input/output channel of the system.
For continuous-time systems, the
bodefunction evaluates the frequency response on the imaginary axis s = jω and considers only positive frequencies.For discrete-time systems, the
bodefunction evaluates the frequency response on the unit circle. To facilitate interpretation, the command parameterizes the upper half of the unit circle as:where Ts is the sample time and ωN is the Nyquist frequency. The software then uses the equivalent continuous-time frequency ω as the x-axis variable. Because is periodic with period 2ωN, the
bodefunction plots the response only up to the Nyquist frequency ωN. Ifsysis a discrete-time model with an unspecified sample time, thebodefunction uses Ts = 1.









