SynthMaker Circuits Manual Open SynthMaker (opens in a new tab)
Chapter 7 · Voltage control

How a differential pair works: where tanh comes from

A differential pair is two transistors sharing one tail current, which splits between them by the voltage difference at their bases as tanh(ΔV / 51.7 mV). It's straight for a few millivolts, half squashed by 100 mV, and the tail current sets the gain: here 1 mA gives 87.

Pair · the parts list
circuit Pair  setting input: 0.01 V, from 0.001 V to 0.3 V  setting output: 6 V  setting tail: 14.3k, from 143k to 14.3k  V1 vcc gnd 15V  V2 gnd vee 15V  Q1 c1 in e 2N3904  Q2 c2 gnd e 2N3904  Rt e vee tail  Rc1 vcc c1 4.7k  Rc2 vcc c2 4.7k  U1 c1 b1 b1 opamp  U2 c2 b2 b2 opamp  R1 b1 m 10k  R2 m out 10k  R3 b2 p 10k  R4 p gnd 10k  U3 p m out opampend
Scope · out

Press Play to see the wave after the circuit, at out.

A short riff through the circuit, round and round. Turn the knobs while it plays. Open in SynthMaker ↗ (opens in a new tab)

What you're hearing

Two transistors share one current. The tail resistor sets how much current the pair carries in total: its top end, the joined emitters, sits about 0.64 V below the bases, so (15 V − 0.64 V) / 14.3 kΩ ≈ 1 mA flows. With both bases at 0 V, it splits evenly: 0.5 mA each. Raise one base and that transistor takes more of the current, and the other gets less. The total barely changes, so the pair only ever moves current from one side to the other. Each collector's 4.7 kΩ turns its current into a voltage, and the output is the difference between the two, 4.7 kΩ × (I1 − I2).

The split follows tanh. A transistor's current grows exponentially with its base voltage, by e for every 25.9 mV (Vt, the thermal voltage at room temperature). Two of them sharing a fixed total gives I1 − I2 = Itail × tanh(ΔV / 2Vt), where ΔV is the difference between the two bases and 2Vt is 51.7 mV. That's the curve in the thumbnail: a straight line through the middle, bending over until one transistor has all the current and the other none. At 10 mV in, the peaks are only 1% short of a straight line. At about 31–32 mV they're 10% short, and by about 100 mV half. By 300 mV the output barely moves: 4.78 V, the whole tail, by then a little over 1 mA, through one 4.7 kΩ.

input peak (ΔV)output, tail 1 mAshort of a straight line3rd harmonic under the note
10 mV0.87 V1%51 dB
30 mV2.39 V9%33 dB
100 mV4.51 V48%16 dB
300 mV4.78 V82%10.5 dB

This is the soft clipping inside many synth circuits. The bend is smooth and the same both ways, so it adds mostly odd harmonics, rising gently: at 100 mV the 3rd is 16 dB under the note and the 5th 30 dB, within about 1 dB of a perfect tanh. An OTA is this pair with current mirrors to bring out I1 − I2. The transistor ladder filter is stacked pairs like this one, with this pair at the bottom. Many op-amps have a pair like it at their input. Whenever one of these is driven past a few tens of millivolts, this is the curve you hear: the warm, rounded saturation of an analog filter or VCA pushed hard. The curve here is within 2% of a perfect tanh. It's slightly lopsided, because only one base is driven: the shared emitters follow it up and down by about half the input, which nudges the tail current.

The tail current sets the gain. For small inputs, tanh x is just x, so I1 − I2 = Itail × ΔV / 2Vt. Each transistor's transconductance (its current per volt) is gm = Itail / 4Vt, 9.7 mS per side at 1 mA, and the output takes both sides, so the gain is 4.7 kΩ × Itail / 2Vt. At 1 mA that's 91 by the formula and 87 in the circuit; at 0.25 mA, 22.5 and 22.3. A quarter of the current is a quarter of the gain, 12 dB down. The circuit falls about 3% short at 1 mA, because a transistor's collector isn't a perfect current source (the Early effect). That's how a VCA or a voltage-controlled filter works: a control voltage sets a tail current, and the current sets the gain, or a filter's speed.

But the tail current doesn't move the bend. The squash points depend on Vt, not on the current: 10% short at 30.9 mV with a 0.25 mA tail, 32.0 mV with 1 mA. So the last button, at a quarter of the gain, bends at the same input as the second: its 3rd harmonic is 15.9 dB under the note, against 16.1. Turning a VCA down never makes its input any cleaner. That's why an OTA's input comes through a divider down to millivolts. And because Vt grows with temperature, about 0.33% per degree, a real pair's gain at a set current and its bend drift as it warms. SynthMaker's transistors have no temperature, so this one never drifts.

Try this

  • Turn input from 1 mV to 300 mV on the first button. The sine stays a sine up to about 10 mV, then its tops round, and by 300 mV it's almost a square, stuck at about ±4.7 V however much more goes in.
  • Press "10 mV: almost straight", then "Tail 0.25 mA: a quarter of the gain". Same shape, 12 dB quieter. Then turn tail slowly from 143k to 14.3k: the level follows the current, 10 times the current for about 10 times the gain, as a VCA does.
  • Press "100 mV: squashed by tanh", then the last button. The same rounded shape, a quarter the size. Open it in SynthMaker to change the parts: put a 220 Ω resistor in each emitter (Q1 c1 in e1 2N3904, Re1 e1 e 220, and the same for Q2 with e2). The gain falls from 87 to 17, and the 10% point moves from 32 mV to about 270 mV: the resistors trade gain for a wider straight region, as many OTA and op-amp inputs do in other ways.

The parts list

Pair · the parts list
circuit Pair  setting input: 0.01 V, from 0.001 V to 0.3 V  setting output: 6 V  setting tail: 14.3k, from 143k to 14.3k  V1 vcc gnd 15V  V2 gnd vee 15V  Q1 c1 in e 2N3904  Q2 c2 gnd e 2N3904  Rt e vee tail  Rc1 vcc c1 4.7k  Rc2 vcc c2 4.7k  U1 c1 b1 b1 opamp  U2 c2 b2 b2 opamp  R1 b1 m 10k  R2 m out 10k  R3 b2 p 10k  R4 p gnd 10k  U3 p m out opampend

The tail knob is written from 143k down to 14.3k, so turning it up means a smaller resistor and more current: 0.1 mA to 1 mA. U1 and U2 are buffers, so nothing loads the collectors, and U3 subtracts: out = c2 − c1.

How we checked it

Checked against ngspice, a standard circuit simulator, running the same full transistor model: the pair's output for a 10 mV and a 100 mV sine, at 1 mA and at 0.25 mA, is within 0.001% of ngspice across the audible band. Measured in SynthMaker, a tanh curve fits the output within 2% of its full swing.

Build it step by step

Next and previous

  • Previous: How hard sync works (planned)
  • This is the first page of chapter 7, voltage control.

Further reading