Ohmforge AC Sweep (Bode plot)

Frequency response of a circuit: Bode magnitude/phase, −3 dB corner and unity gain.

Subset: R C L V I D Q M E G K, X subcircuit instances with .subckt/.ends (nested, with params), .param and {expressions}, .model, SIN/PULSE/PWL sources, engineering suffixes (k, m, u, n, p, meg). Node 0 is ground. Leave empty when you pass an Ohmforge project instead.

More options

Alternative to the netlist: a .ohmforge.json project as saved by the app (format "ohmforge", version 1).

Name of the V or I source to excite (e.g. V1). Empty = keep the AC magnitudes from the netlist.

Report V(out)/V(ref) instead of V(out).

Hz

Empty = .ac line or 1 Hz.

Hz

Empty = .ac line or 10 MHz.

Empty = .ac line or 20.

Try an example: · ·

More about this tool

Part of Ohmforge

How it works

Linearises the circuit at its DC operating point and solves the complex MNA equations across a logarithmic frequency sweep. Returns magnitude in dB and unwrapped phase of an output node (optionally relative to an input node), the peak gain, lower/upper −3 dB frequencies, the unity-gain frequency, a Bode chart and CSV.

  • The DC operating point is solved first; every nonlinear device is replaced by its small-signal conductances at that point (diode gd, BJT gm/gπ/go, MOSFET gm/gds, op-amp output slope).
  • Capacitors become admittances jωC, inductors impedances jωL in their branch equations, coupled inductors jωM; the complex system is solved by dense LU with partial pivoting at every frequency.
  • Magnitude is 20·log10|H|, phase is unwrapped to be continuous. The −3 dB points are found 3.01 dB below the peak by logarithmic interpolation; unity gain is the 0 dB crossing.

Teaching-grade simulation: device models are simplified (Ebers–Moll BJT, level-1 MOSFET, behavioural op-amps and 555) and part ratings are typical values. Verify real designs on the bench and against manufacturer data before building anything connected to mains voltage.

Sources

Part of Ohmforge

  • Ohmforge Virtual electronics workbench

    Draw a circuit, switch it on, and measure it with real-feeling bench instruments.

    Open Ohmforge

Related tools

How to use the Ohmforge AC Sweep (Bode plot)

Simulate the frequency response of a filter or amplifier from a SPICE netlist and read gain, phase, −3 dB corners and unity-gain frequency from a Bode plot.

What it is for

Filters, tone controls, amplifiers and feedback loops are judged by their frequency response. How much does the signal drop at 50 Hz or 20 kHz, where is the corner, how much phase shift is there? An AC sweep answers that the way an oscilloscope with a network analyser would: it drives the circuit with a 1 V small-signal sine at every frequency and records gain and phase at the output node.

Paste a SPICE netlist (or an Ohmforge project), name the output node, and optionally the source to excite and the sweep range. You get a Bode magnitude plot, a phase plot, the peak gain, upper and lower −3 dB points, the unity-gain crossing, and a CSV of all points. The analysis is linear around the DC operating point, so clipping, slew limits and other large-signal effects don't appear. Use the transient tool for those.

Worked example

The built-in RC low-pass, R = 1 kΩ, C = 100 nF:

V1 in 0 DC 0 AC 1
R1 in out 1k
C1 out 0 100n
.ac dec 20 10 1meg

Result: peak gain −0.0001715 dB at 10 Hz, −3 dB point at 1.591 kHz, exactly 1/(2π·1k·100n). At 100 Hz the phase is already −3.6°, a reminder that phase starts moving well before the amplitude does.

A series RLC band-pass (L 10 mH, C 100 nF, R 100 Ω across the output), swept 100 Hz to 100 kHz at 50 points per decade: peak −0.003 dB near 5.012 kHz, lower −3 dB at 4.299 kHz, upper at 5.892 kHz. The bandwidth of 1.593 kHz matches R/(2πL), and the centre matches 1/(2π√LC) ≈ 5.03 kHz. The reported peak sits on the nearest sweep point, so add points per decade if you need it exact.

For a high-pass, C 100 nF and R 10 kΩ with input V1 and 1 Hz to 100 kHz, the tool reports a lower −3 dB of 159.2 Hz and no upper corner, as expected.

How to read the result

  • Peak gain and at: the highest magnitude in dB and its frequency. 0 dB means output equals input; 20 dB is ×10.
  • Upper / lower −3 dB: where the response is 3.01 dB below the peak, interpolated between points. A dash means the sweep never got there.
  • Unity gain: the 0 dB crossing, useful for op-amp loops.
  • Magnitude and phase plots, the selected points table and the Bode CSV with every frequency.

Tips and common mistakes

  • Give the source an AC magnitude (AC 1), or name it in Input source. Otherwise there's nothing to drive, and other sources keep their own AC values.
  • Corners are measured from the peak, not from 0 dB. For an amplifier with 20 dB gain, the −3 dB point is where it falls to 17 dB.
  • Use Reference node to get V(out)/V(in) when the input isn't an ideal 1 V source, for example behind a source resistance.
  • A dash means no corner inside the sweep. Widen the range, or accept that there is none: the inverting amplifier example uses an ideal op-amp and stays flat at 20 dB and −180° from 10 Hz to 10 MHz.
  • Cascaded stages load each other. Two 1 kHz RC stages from the .subckt example give a combined corner of 599.6 Hz, not 1 kHz.

FAQ

How is the −3 dB frequency calculated?

It's the frequency where the magnitude is 3.01 dB below the peak, found by logarithmic interpolation between sweep points.

Why doesn't my amplifier clip in the AC sweep?

An AC sweep is a small-signal analysis around the DC operating point. Clipping and distortion only show up in a transient simulation.

What does the phase tell me?

The time shift of the output relative to the input, in degrees. A low-pass approaches −90° per pole, and an inverting amplifier sits at −180°.

Can I export the data?

Yes. The Bode CSV contains frequency, magnitude and phase for every point.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://ohmforgeacsweep.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://ohmforgeacsweep.usefulweb.site/mcp · tool name ohmforge_ac_sweep
Example request
curl -s -X POST https://ohmforgeacsweep.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"netlist":"* RC low-pass, fc = 1/(2*pi*1k*100n) = 1591.5 Hz\nV1 in 0 DC 0 AC 1\nR1 in out 1k\nC1 out 0 100n\n.ac dec 20 10 1meg","output":"out","input":"V1"}'
Feedback · ideas & bug reports welcome