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
sys
as 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
LineSpec
value for each system. For example,bode(sys1,LineSpec1,sys2,LineSpec2)
plots two models and specifies their plot style. For more information on specifying aLineSpec
value, seebodeplot
.
Examples
Input Arguments
Output Arguments
Tips
When you need additional plot customization options, use
bodeplot
(Control System Toolbox) instead.
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,
bode
evaluates the frequency response on the imaginary axis s = jω and considers only positive frequencies.For discrete-time systems,
bode
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 equivalent continuous-time frequency ω is then used as the x-axis variable. Because is periodic with period 2ωN,
bode
plots the response only up to the Nyquist frequency ωN. Ifsys
is a discrete-time model with unspecified sample time,bode
uses Ts = 1.
Version History
Introduced before R2006a