AC analysis and the Bode plot
Run an AC analysis, read gain and phase on a Bode plot, find a pole, and see why two RC sections do not make two poles at the same frequency.
- Lesson
- E1.4
- Time
- 25 min
- Runs on
- ngspice
- Check
- 5 questions
An engineer set the AC source of an amplifier bench to 1 mV "to stay in the linear range" and reported 40 mV at the output. A colleague set it to 1 V and was alarmed by 40 V from a 1.8 V circuit. Both had misread AC analysis: it is linear by construction, so the source amplitude only scales the answer.
- v(outa), ac 1
- v(outb), ac 1m
- Frequency 1 kHzv(outa), ac 1 = 40 V · v(outb), ac 1m = 40 mV
At 1 kHz the ac 1 run reads 40 V and the ac 1m run reads 40 mV. Neither is a voltage the circuit can make; both say the gain is 40.
- Frequency 10 MHzv(outa), ac 1 = 636.5 mV · v(outb), ac 1m = 636.5 µV
Past the corner both fall together, still exactly 1000 apart. Nothing clipped and nothing distorted in either run.
Read the plot as a table
| Frequency | v(outa), ac 1 | v(outb), ac 1m |
|---|---|---|
| 1 kHz | 40 V | 40 mV |
| 10 kHz | 39.92 V | 39.92 mV |
| 100 kHz | 33.87 V | 33.87 mV |
| 1 MHz | 6.287 V | 6.287 mV |
| 10 MHz | 636.5 mV | 636.5 µV |
| 100 MHz | 63.66 mV | 63.66 µV |
The amplifier is an ideal voltage-controlled voltage source (an E line) with gain 40. Measured on ngspice 42.
Write the source as ac 1 and the output of an AC run is the gain itself.
What AC analysis computes
AC analysis first finds the operating point. It then replaces every nonlinear device by its small-signal model: the tangent at that point, as in E1.2. Finally it solves the resulting linear circuit for a sine wave at each frequency of the sweep.
The answer at each node and frequency is a complex number: a magnitude and a phase. Because the circuit is now linear, nothing clips and nothing distorts, whatever the amplitude. Doubling the source doubles every output, so the source amplitude carries no information.
Write the source as V1 in 0 dc 0 ac 1. The dc 0 part is its value for the operating point, and ac 1 makes it the small-signal input with magnitude 1. Then read vdb(out), the magnitude in decibels (20·log10 of the magnitude), and vp(out), the phase. With set units=degrees the phase prints in degrees; otherwise it prints in radians.
A sweep is written ac dec 1000 1k 100meg: 1000 frequencies per decade from 1 kHz to 100 MHz. Bode plots use a log frequency axis, so points per decade is the natural unit.
One RC section: a pole
- vdb(out)
- phase of v(out)
- Frequency 10 kHzvdb(out) = -0.01711 dB · phase of v(out) = -3.595°
At 10 kHz, more than a decade below the corner, the gain is −0.017 dB and the phase only −3.6°. The capacitor barely loads the output.
- Frequency 159.2 kHzvdb(out) = -3.01 dB · phase of v(out) = -45°
At the corner frequency 1/(2πRC) = 159.2 kHz the gain is −3.01 dB, half the power, and the phase is −45°.
- Frequency 1.592 MHzvdb(out) = -20.04 dB · phase of v(out) = -84.29°
A decade above the corner the gain is −20.04 dB. From here on it falls 20 dB for every decade.
Read the plot as a table
| Frequency | vdb(out) | phase of v(out) |
|---|---|---|
| 1 kHz | -0.0001715 dB | -0.36° |
| 10 kHz | -0.01711 dB | -3.595° |
| 100 kHz | -1.445 dB | -32.14° |
| 159.2 kHz | -3.01 dB | -45° |
| 1 MHz | -16.07 dB | -80.96° |
| 1.592 MHz | -20.04 dB | -84.29° |
| 10 MHz | -35.96 dB | -89.09° |
| 100 MHz | -55.96 dB | -89.91° |
Measured on ngspice 42 (500 of the run's 501 points).
The RC low-pass passes low frequencies and blocks high ones. Its transfer function, output over input, is 1/(1 + j·2πf·RC). The corner frequency fc = 1/(2πRC) = 159.2 kHz is where the magnitude is 1/√2, which is −3.01 dB, and the phase is −45°.
Above the corner the magnitude falls 20 dB per decade, a factor of ten in voltage for every factor of ten in frequency. That single corner with a 20 dB per decade slope is one pole. A Bode plot stacks magnitude in dB and phase against log frequency, so a pole's magnitude reads as two straight lines that bend at fc.
| Quantity | Formula | Measured in the lab |
|---|---|---|
| −3 dB frequency | 1/(2πRC) = 159154.9 Hz | f3 = 1.591549e+05 |
| Phase at fc | −45° | ph3 = -4.499999e+01 |
| Gain at 10 fc | −10·log10(101) = −20.04321 dB | g10 = -2.004321e+01 |
| Gain at 100 fc | −10·log10(10001) = −40.00043 dB | g100 = -4.000043e+01 |
A linear circuit with exact parts: the run and the formula agree to every printed digit.
Two sections load each other
- The first section alone
Without R3 and C3, node m2 would be the single RC with its corner at 159.2 kHz.
- The second section draws current
R3 and C3 take current from node m2, in parallel with C2. The first section now sees a heavier load, and its own corner moves down.
load current
Read the circuit as text
- V1 voltage source (ac 1): + →
n1, − →0 - R2 resistor (1 kΩ): pin 1 →
n1, pin 2 →m2 - C2 capacitor (1 nF): pin 1 →
m2, pin 2 →0 - R3 resistor (1 kΩ): pin 1 →
m2, pin 2 →n2 - C3 capacitor (1 nF): pin 1 →
n2, pin 2 →0 - o2 port: terminal →
n2
The lab builds this as R2, C2, R3, C3, and a copy with an ideal buffer (E1, gain 1) between the sections.
Two equal sections in a row do not give two poles at 159.2 kHz. The second section loads the first, and the transfer function becomes 1/(1 + 3sτ + s2τ^{2}), with s = j·2πf and τ = RC. Solved for −3 dB, that puts the corner at 0.3742·fc = 59.56 kHz, and the lab measures f3two = 5.956201e+04.
Put an ideal buffer between the sections and the loading disappears. Each section is then a pole at fc, and two equal poles reach −3 dB at fc·√(√2 − 1) = 102.4 kHz: the lab measures f3buf = 1.024312e+05. Loading is the first reason a hand analysis and the simulator disagree: the simulator never forgets a load.
- one section (o1)
- two loaded (o2)
- two buffered (o3)
- Frequency 59.56 kHzone section (o1) = -0.5693 dB · two loaded (o2) = -3.01 dB · two buffered (o3) = -1.139 dB
The loaded pair reaches −3 dB at 59.56 kHz, well below the single section's corner.
- Frequency 102.4 kHzone section (o1) = -1.505 dB · two loaded (o2) = -6.097 dB · two buffered (o3) = -3.011 dB
The buffered pair reaches −3 dB at 102.4 kHz.
- Frequency 15.92 MHzone section (o1) = -40 dB · two loaded (o2) = -80 dB · two buffered (o3) = -80 dB
Two decades above fc both pairs fall 40 dB per decade, twice the slope of one section.
Read the plot as a table
| Frequency | one section (o1) | two loaded (o2) | two buffered (o3) |
|---|---|---|---|
| 1 kHz | -0.0001715 dB | -0.0012 dB | -0.0003429 dB |
| 10 kHz | -0.01711 dB | -0.1185 dB | -0.03423 dB |
| 59.56 kHz | -0.5693 dB | -3.01 dB | -1.139 dB |
| 100 kHz | -1.445 dB | -5.932 dB | -2.891 dB |
| 102.4 kHz | -1.505 dB | -6.097 dB | -3.011 dB |
| 1 MHz | -16.07 dB | -32.64 dB | -32.14 dB |
| 10 MHz | -35.96 dB | -71.93 dB | -71.93 dB |
| 15.92 MHz | -40 dB | -80 dB | -80 dB |
| 100 MHz | -55.96 dB | -111.9 dB | -111.9 dB |
Measured on ngspice 42 (500 of the run's 5001 points).
AC sees the bias
A diode's small-signal resistance is rd = n·UT/I, from E1.2. So a diode can be the resistor of a low-pass, and its DC current sets the corner. The figure biases the same diode at 100 µA and at 10 µA, each with 1 nF.
- v(oa), 100 µA
- v(ob), 10 µA
- Frequency 61.57 kHzv(oa), 100 µA = -0.04327 dB · v(ob), 10 µA = -3.011 dB
At 10 µA, rd = 2.586 kΩ and the corner is at 61.57 kHz.
- Frequency 615.3 kHzv(oa), 100 µA = -3.011 dB · v(ob), 10 µA = -20.04 dB
At 100 µA, rd = 258.6 Ω: ten times the current, ten times the corner, 615.3 kHz.
Read the plot as a table
| Frequency | v(oa), 100 µA | v(ob), 10 µA |
|---|---|---|
| 1 kHz | -0.00001147 dB | -0.001146 dB |
| 10 kHz | -0.001147 dB | -0.1131 dB |
| 61.57 kHz | -0.04327 dB | -3.011 dB |
| 100 kHz | -0.1132 dB | -5.609 dB |
| 615.3 kHz | -3.011 dB | -20.04 dB |
| 1 MHz | -5.613 dB | -24.23 dB |
| 10 MHz | -24.23 dB | -44.21 dB |
| 100 MHz | -44.22 dB | -64.21 dB |
ngspice's default diode. Measured on ngspice 42 (500 of the run's 5001 points).
The formula 1/(2π·rd·C) gives 615.3 kHz and 61.53 kHz. The 100 µA run lands on it; the 10 µA run is 0.05 % high. That gap comes from the operating point: the solver stopped once the answer moved by less than its 0.1 % tolerance, so the diode current is a little off. With .options reltol=1e-6 the 10 µA corner moves to 61.53 kHz.
Asked in interviews
What does AC analysis compute?
The small-signal response: it finds the operating point, linearizes every device there, and solves the linear circuit with complex numbers at each frequency. The result is a magnitude and a phase per node and frequency.
Why does the AC result not depend on the source amplitude?
The circuit is linearized first, so every output is proportional to the input. Use ac 1 and read the gain directly. To see clipping or distortion, run a transient with a real amplitude.
Where is the −3 dB point of two equal RC sections?
Not at 1/(2πRC). Loaded, at about 0.374 of it, because the second section loads the first; buffered, at √(√2 − 1) ≈ 0.644 of it, because two poles each lose 1.5 dB there.
Try it
Run it, read the six meas lines, then open Plots for the Bode plots of every node. WHEN vdb(o1)=-3.0103 finds the −3 dB frequency, and FIND ... WHEN reads the phase there.
Now break the buffer: change E1 b3 0 m3 0 1 to a wire by replacing it with R6 m3 b3 0.001. Predict f3buf first. Then change ac 1 to ac 1m and predict which meas lines still print: every gain drops by 60 dB, so a line that looks for −3.0103 dB finds no crossing.
Run the netlist to draw its plots here.
f3 = 1.591549e+05 ph3 = -4.499999e+01 g10 = -2.004321e+01 g100 = -4.000043e+01 f3two = 5.956201e+04 f3buf = 1.024312e+05Check yourself
Remember
- AC analysis linearizes the circuit at its operating point and solves it with sinusoids: a magnitude and a phase per node and frequency.
- The result scales with the AC source, so write
ac 1and read the gain; nothing clips in AC. - An RC low-pass has one pole at fc = 1/(2πRC): −3.01 dB and −45° there, then −20 dB per decade.
- Two equal loaded RC sections reach −3 dB at 0.374·fc; a buffer between them moves it to 0.644·fc.
- Small-signal resistances depend on the bias: a diode at ten times the current gives ten times the corner.