C5 · Lesson 47 · Amplifier analysis lab
Small-signal parameters, cascades, exact distortion, low-frequency corners and swing, in Python
Lessons 39 to 46 analyzed amplifiers with formulas, each with an approximation behind it: loading worked out stage by stage, distortion from the first terms of a series, a low-frequency corner from a sum of time constants. In this lab you'll turn each into code, then check the approximations against exact calculations: a degenerated stage solved point by point for its true harmonic content, and a cascade of coupling capacitors solved for its true corner.
Play
- A common-emitter amplifier with an input capacitor, an output capacitor and a bypassed emitter resistor. The Bode plot shows its gain from 1 Hz to 100 kHz.
- Each capacitor adds a corner at the low end. Shrink the bypass capacitor and watch the low corner move up; shrink the coupling capacitors and watch which one matters.
- The midband gain is set by the small unbypassed resistor; slide it and the flat part moves.
Predict
Three coupling capacitors each make a first-order corner at 10 Hz. The usual estimate adds the corners: 30 Hz. Where is the amplifier really 3 dB down?
At 19.6 Hz. Each section is only 1 dB down at that frequency, and three of them make 3 dB: the exact corner of n equal sections is . The sum of corners is exact only when one capacitor dominates, and otherwise it's conservative: the amplifier reaches lower than it claims.
Name it
The parameters, in one place
At a collector current with gain β and Early voltage :
Cascades from stage models
Give each stage as its input resistance, open-circuit gain and output resistance. Working from the source, each junction is a divider:
Distortion, exactly
For a degenerated stage, the input splits as with . At each sample of a sine, that one equation in is monotonic, so bisection solves it; the samples' discrete Fourier transform gives every harmonic. Lesson 46's formula, , is the first term of this calculation.
Low-frequency corners, exactly
A chain of first-order high-pass sections with corners has . The −3 dB point is where that equals ½, found by bisection on a log scale; the usual estimate is .
Swing
The output can rise by before cutoff and fall by before saturation. The that makes them equal solves a quadratic.
Worked example
Lesson 40's cascade (two stages with = 10, = 10 kΩ, = 2 kΩ, between a 1 kΩ source and a 1 kΩ load). Check it from the stage models.
Show the solution
- Multiply the dividers and gains.
- What the code does. It walks the list of stages, multiplying a divider at each junction and a gain at each stage.
- Why it's useful. The same function handles any number of stages, which is how a designer explores whether a third stage or a follower pays for itself.
Answer the stage models give an overall gain of 25.25, as lesson 40 found.
Worked example
Solve a stage at 1 mA with = 470 Ω exactly for a 380 mV peak input. How does its compare with lesson 46's formula?
Show the solution
- Solve the stage exactly. Bisect at 4096 samples of the cosine.
- Take the harmonics. The second harmonic over the fundamental gives 1.357%.
- Compare with the formula. The formula gives 0.999%: about a third low, because at this amplitude the junction itself swings from −34 mV to +15 mV, which is no longer small against .
- When the formula holds. At 100 mV with = 1 kΩ the two agree within 0.5%, so the formula is fine for small swings and optimistic for large ones.
Answer the exact is 1.357%, against the formula's 0.999%.
Worked example
Lesson 49's amplifier has corners near 5.4 Hz (), 47.8 Hz () and 1.1 Hz (). What's the true −3 dB point, against the sum's 54.3 Hz?
Show the solution
- Bisect for the true corner. Solving gives 48.4 Hz.
- Compare with the sum. The bypass capacitor's corner dominates, so the sum overestimates by only 12%.
- Three equal corners. There the sum overestimates by 53% (30 Hz against 19.6 Hz).
- What it means for a design. When the estimate meets a specification, the real amplifier meets it with room to spare; when it misses narrowly, the exact calculation may show it passes.
Answer the true −3 dB point is 48.4 Hz; the sum's 54.3 Hz overestimates it by 12%.
Check
Step 1. Write small_signal(IC, beta, VA, VT=0.02585) returning a dict with keys gm, rpi, re and ro.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 2. Write cascade(Rsig, stages, RL) returning the overall voltage gain, where stages is a list of (Rin, Avo, Ro) tuples.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 3. Write hd2(vin, IC, RE, VT=0.02585, N=4096) returning the exact second-harmonic distortion of a degenerated bipolar stage driven by vin·cos θ: solve for at each of N samples by bisection on [−1, 1] V, then compare the DFT's second and first harmonics.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 4. Write f_low(corners) returning (estimate, exact): the sum of the corners, and the true −3 dB frequency of the chain of first-order high-pass sections, by bisection on a log scale.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Step 5. Write best_rc(VCC, IC, RL, VE, vsat=0.2) returning (RC, swing): the collector resistor that equalizes the two swing limits, and that swing. Work in ohms, amperes and volts.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
3 identical coupling capacitors each make a corner at 5 Hz. Where is the amplifier 3 dB down?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
A 1 kΩ source drives a stage with = 47 kΩ, = 5 and = 4.7 kΩ, which drives 1 kΩ.
(a)
What fraction of the source reaches the input?
(b)
What's the overall gain?
Explain why
Why does adding up the corner frequencies of several coupling capacitors overestimate an amplifier's low-frequency corner?
Each first-order high-pass section is only slightly attenuating at frequencies a little above its own corner, and the sum-of-corners estimate effectively assumes the worst case at every frequency. When several sections have similar corners, their small losses combine, and the overall response reaches 3 dB down at a frequency well below the sum but above any single corner: for three equal sections, about twice one corner, not three times. When one section's corner is far above the others, it does nearly all the attenuating and the sum is close to the truth. The sum is therefore a safe upper bound for design.
Practice
Keep practicing
3 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.