C547 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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?

Name it

The parameters, in one place

At a collector current IC with gain β and Early voltage VA:

gm=ICVT,rπ=βgm,re=αgm,ro=VAIC.

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:

Gv=Ri1Ri1+RsigA1Ri2Ri2+Ro1A2⋯AnRLRL+Ron.

Distortion, exactly

For a degenerated stage, the input splits as vin=vbe+REic with ic=IC(evbe/VT−1). At each sample of a sine, that one equation in vbe is monotonic, so bisection solves it; the samples' discrete Fourier transform gives every harmonic. Lesson 46's formula, v^4VT(1+gmRE)2, is the first term of this calculation.

Low-frequency corners, exactly

A chain of first-order high-pass sections with corners fk has |H|2=∏kf2f2+fk2. The −3 dB point is where that equals ½, found by bisection on a log scale; the usual estimate is ∑kfk.

Swing

The output can rise by IC(RC∥RL) before cutoff and fall by VC−VE−VCE,sat before saturation. The RC that makes them equal solves a quadratic.

Worked example

Lesson 40's cascade (two stages with Avo = 10, Ri = 10 kΩ, Ro = 2 kΩ, between a 1 kΩ source and a 1 kΩ load). Check it from the stage models.

Show the solution
  1. Multiply the dividers and gains. Gv=1011×10×1012×10×13=25.25
  2. What the code does. It walks the list of stages, multiplying a divider at each junction and a gain at each stage.
  3. 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 RE = 470 Ω exactly for a 380 mV peak input. How does its HD2 compare with lesson 46's formula?

Show the solution
  1. Solve the stage exactly. Bisect vin=vbe+REIC(evbe/VT−1) at 4096 samples of the cosine.
  2. Take the harmonics. The second harmonic over the fundamental gives 1.357%.
  3. 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 VT.
  4. When the formula holds. At 100 mV with RE = 1 kΩ the two agree within 0.5%, so the formula is fine for small swings and optimistic for large ones.

Answer the exact HD2 is 1.357%, against the formula's 0.999%.

Worked example

Lesson 49's amplifier has corners near 5.4 Hz (C1), 47.8 Hz (CE) and 1.1 Hz (C2). What's the true −3 dB point, against the sum's 54.3 Hz?

Show the solution
  1. Bisect for the true corner. Solving ∏f2f2+fk2=12 gives 48.4 Hz.
  2. Compare with the sum. The bypass capacitor's corner dominates, so the sum overestimates by only 12%.
  3. Three equal corners. There the sum overestimates by 53% (30 Hz against 19.6 Hz).
  4. 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 vbe 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 Ri = 47 kΩ, Avo = 5 and Ro = 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?

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.