bode_magnitude
Builtin index · Signal processing
bode_magnitude(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). Magnitude half of a Bode plot: 20*log10(|Z|) vs. log-scaled frequency.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
bode_magnitude(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 output | log-scaled frequency. |
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)
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.