bode

Bode diagram.

Syntax

bode(sys)

bode(sys, w)

bode(..., fmt, ...)

bode(..., property, value, ...)

[m, p, w] = bode(...)

Inputs

sys
A linear time-invariant transfer function or state space system.
Type: class
w
The vector of frequencies at which to compute the response. If w is a two-element vector, it contains the range of frequencies over which to compute the response. The units are radians/sec for continuous time, and Hz for discrete time.
Type: double
Dimension: vector
fmt
Plot format arguments. See the plot function help.
Type: string
Dimension: vector
property
Plot property arguments that are paired with a following value. See the plot function help.
Type: string
Dimension: vector
value
Plot property value arguments. See the plot function help.
Type: integer
Dimension: scalar

Outputs

m
The magnitude response.
Type: double
Dimension: vector
p
The phase response.
Type: double
Dimension: vector
w
The vector of frequencies at which the response was computed. The units are radians/sec for continuous time, and Hz for discrete time.
Type: double
Dimension: vector

Example

Create the Bode diagram of a 2nd order Chebyshev II low pass analog filter with a 100 radians/sec cutoff frequency and -20 db attenuation.

[b,a] = cheby2(2,20,100,'s');
tfo = tf(b,a);
bode(tfo);
Figure 1. bode figure 1


Comments

If the output arguments are omitted, the function plots the results.

If w is omitted, then internally computed values are used.

bode does not currently support MIMO systems.

By default, 500 points are plotted. More points can be requested using the w input, in which case it is typically best to specify them with logspace.