Qu

bode_phase

Builtin index · Signal processing

bode_phase(Z, freqs, [color=], [label=], [marker="line"])

Input: Z, freqs, color, label, marker · Output: no output

What it is

Z: a length-N complex vector (CVec); freqs: the matching length-N real vector (Hz). color/label/marker (optional strings). Phase half of a Bode plot: arg(Z) in degrees vs. log-scaled frequency. Kept as a separate call from bode_magnitude (rather than one builtin silently building a 2-panel figure) so a script stays in control of its own subplot layout.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
bode_phase(Z, freqs, [color=], [label=], [marker="line"])
Z vector or CVecZ: a length-N complex vector (CVec).
freqs vectorfreqs: the matching length-N real vector (Hz).
color string, optionalcolor/label/marker (optional strings).
label string, optionalcolor/label/marker (optional strings).
marker string, optional (default "line")color/label/marker (optional strings).
no outputlog-scaled frequency. Kept as a separate call from bode_magnitude (rather than one builtin silently building a 2-panel figure) so a script stays in control of its own subplot layout.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

panel(2, 1, 1)
bode_magnitude(Z, freqs)
panel(2, 1, 2)
bode_phase(Z, freqs)
28 30 32 34 36 38 40 0.1 1.0 10.0 100.0 1000.0 -50 -40 -30 -20 -10 0.1 1.0 10.0 100.0 1000.0

from specialized

How it works

bode_magnitude(Z, freqs) / bode_phase(Z, freqs) — the two halves of a Bode plot, kept as separate calls (rather than one builtin silently creating a 2-panel figure) so a script stays in control of its own subplot layout: panel(2, 1, 1); bode_magnitude(Z, freqs) panel(2, 1, 2); bode_phase(Z, freqs)

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.