ac_structure
Extract pole/zero structure from AC responses: corner frequencies, Q, and phase behavior. Flags non-minimum phase effects that limit control-loop performance.
Instructions
Read the pole/zero STRUCTURE of an .AC response — net order, corner frequencies (as ranges) with Q, out-of-phase zeros, and transport delay — to support design reasoning (where the poles/zeros roughly are, damping, out-of-phase zeros). It first tries a rational fit and uses its poles/zeros when the fit is clean; otherwise it falls back to asymptotic Bode reading (slope breakpoints + joint gain-phase + group delay + a gain-phase consistency residual).
Returns FACTS, not a verdict — bring your own control/design knowledge. The most design-critical fact is the non_minimum_phase flag: an out-of-phase zero or a transport delay adds phase lag the magnitude plot cannot show, and caps achievable loop bandwidth; do not close a loop on magnitude alone when it is flagged.
IMPORTANT — these are read from a finite sweep, so HAVE A HUMAN REVIEW them against the Bode plot (use plot_waveform on the same signal) and the circuit before acting. Closely-spaced corners merge into one range (merged: true) rather than being resolved individually, and exact pole/zero COUNTS are not guaranteed — for exact poles/zeros run a .pz analysis on ngspice. Requires a .AC run. Siblings: bode_metrics (margins / cutoffs / point queries), resonance (peaks + Q), stability_metrics (loop margins).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | Step index for .step sweeps | |
| format | No | ||
| job_id | No | Analyze a completed job run by id instead of a raw_file path; pair with ``run_index``. Lets you read a sweep / Monte-Carlo run's structure. | |
| signal | Yes | Signal name (e.g. 'V(out)') — the transfer function H(jω) to analyze. | |
| raw_file | No | Path to AC analysis .raw result file. Pass this OR ``job_id`` (a job run), not both. | |
| run_index | No | 0-based run to read when ``job_id`` is given (default 0). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | ||
| signal | Yes | ||
| corners | Yes | ||
| net_order | No | ||
| integrator | Yes | ||
| fit_rel_err | No | ||
| observations | Yes | ||
| non_minimum_phase | Yes | ||
| transport_delay_s | No | ||
| phase_residual_deg | No | ||
| lf_slope_db_per_decade | Yes |