Precision InstrumentationIntermediate12 min read · November 2026

Differential Amplifier Tutorial: Difference Gain, CMRR & Noise Rejection

Try measuring a 10 mV load-cell strain gauge or biopotential ECG heartbeat over a two-meter cable and your desired signal immediately gets buried under 500 mV of 50/60 Hz mains hum induced evenly along both conductors. Single-ended amplifiers boost signal and hum alike! A differential amplifier resolves this cleanly by amplifying exclusively the voltage difference (V2 − V1) between two symmetric inputs while rejecting voltages shared evenly across both wires (common-mode interference). In this tutorial you will study both the precision four-resistor op-amp subtractor and its underlying BJT long-tailed pair, calculate Common-Mode Rejection Ratio (CMRR) under real resistor tolerances, and simulate noise cancellation inside NodeSim.

Launch This Pre-Wired Circuit in NodeSim
Opens directly inside the ngspice WebAssembly workbench with sources and probes attached — zero signup required.
Simulate Live Circuit →
Operational Amplifier Feedback & Transfer Curve−+RinRfVoutVinLinear feedback vs rail / hysteresis bounds
Balanced differential stage extracting clean differential signal (V2 - V1) while rejecting shared common-mode interference.

1. Four-Resistor Difference Topology & Superposition Proof

Start from an ordinary op-amp flanked by four resistors: R1 and R2 feed the inverting (−) input from V1 with feedback resistor R2 returning from Vout, while R3 and R4 build a balanced divider stepping down V2 at the non-inverting (+) pin. By invoking linearity and Superposition inside the op-amp linear region, total output equals the sum of two independent paths.

When input ratios match exactly—meaning R2 / R1 = R4 / R3 (and most commonly equal-matched pairs R1 = R3 and R2 = R4)—common-mode terms drop straight to zero! Notice how cleanly the math collapses: applying +5.01 V to V2 and +5.00 V to V1 yields Vout = (R2/R1) × 0.01 V, cancelling the huge +5.00 V common pedestal completely.

Balanced Condition: (R4 / R3) = (R2 / R1)
When R1 = R3 and R2 = R4 = Rf:
  Vout = (Rf / R1) × (V2 − V1)
Differential Gain: Ad = Rf / R1
Common-Mode Voltage: V_cm = (V1 + V2) / 2
Output Residual Error: Vout_error = A_cm × V_cm

If R1 = R3 = 10 kΩ and Rf = R4 = 100 kΩ, a 50 mV bridge difference outputs +500 mV cleanly regardless of 5 V DC sensor excitation.

2. Why Common-Mode Rejection Ratio (CMRR) Collapses With Unmatched Resistors

Engineers often stare confused at an op-amp datasheet advertising "100 dB CMRR" only to measure a sluggish 40 dB rejection on the lab bench! The culprit is almost never the silicon op-amp itself—it is external resistor tolerance!

Take R1 = R3 = 10 kOhm and Rf = R4 = 10 kOhm (unity difference gain Ad = 1), built using ordinary +/-5% carbon resistors. Even if the bare op-amp silicon boasts infinite internal rejection, letting one resistor drift +5% while another drifts -5% creates an artificial common-mode gain A_cm ≈ ΔR / R! A crisp formula predicts exact worst-case external CMRR: CMRR ≈ (1 + Ad) / (4 × tol). Using 1% resistors at gain 1 drops total circuit CMRR down around 34 dB (~50:1 rejection!) regardless of how expensive the op-amp chip inside is!

CMRR (linear) = Ad / A_cm   ⇒   CMRR (dB) = 20 × log10(Ad / A_cm)
Worst-Case Four-Resistor CMRR (Tolerance t = e.g. 0.01 for 1%):
  CMRR_resistors ≈ (1 + Ad) / (4 × t)
Example (Ad = 10, t = 0.01 (1%)): CMRR ≈ 11 / 0.04 = 275  (≈ 48.8 dB)
  • Why 3-Op-Amp Instrumentation Amplifiers Exist: Plain single-op-amp difference circuits exhibit low, asymmetric input impedances (loading delicate Wheatstone bridges unevenly!). Preceding a laser-trimmed difference subtractor with two non-inverting buffers creates an INA128-style instrumentation amp with gigaohm input impedance and >100 dB CMRR.
  • The BJT Long-Tailed Pair Foundation: Inside EVERY monolithic op-amp sits a symmetric NPN/PNP BJT differential pair sharing a constant tail current source! Equal base voltages split tail current symmetrically (Ic1 = Ic2 = Itail/2), rejecting common temperature and rail fluctuations naturally.

3. Inside the Classic BJT Differential Pair

NodeSim's pre-wired differential simulation showcases the iconic symmetric BJT long-tailed pair: two matched 2N3904 NPN transistors Q1 and Q2 share a tail emitter resistor (or constant-current sink) R_tail tied cleanly to negative rail Vee while identical collector resistors Rc connect to +Vcc. When V1 and V2 shift upward simultaneously by +1 V common-mode, emitter node V_E glides upward right alongside them, holding total tail current I_E practically unchanged—leaving collector output difference (Vc2 − Vc1) practically immune to common interference.

Drive V1 slightly higher than V2 instead (pure differential drive ΔV_in = V1 − V2): tail current smoothly steers out of Q2 straight into Q1 following the classic hyperbolic tangent curve (tanh(ΔV_in / (2·V_T))), delivering high linear differential gain Ad ≈ gm × Rc with zero coupling capacitors needed down to DC!

BJT Differential Half-Circuit Transconductance: gm = (I_tail / 2) / V_T
Differential Voltage Gain (Single-Ended Out): Ad = gm × Rc / 2
Differential Gain (Balanced Out Vc2−Vc1): Ad = gm × Rc
Common-Mode Gain (With Tail Resistor R_ee): A_cm ≈ −Rc / (2 × R_ee) ⇒ CMRR ≈ gm × R_ee

4. Testing Differential vs Common-Mode Rejection in NodeSim

Launch the pre-wired differential pair in NodeSim and run Transient (.tran) across 5 ms. First observe normal differential excitation: notice how opposing sine swings across Collector 1 and Collector 2 amplify tiny millivolt input steps cleanly.

Next, tie BOTH differential inputs Vin1 and Vin2 to the exact same AC test source and re-run Transient! Observe how output difference (Vc2 − Vc1) stays completely quiet down near millivolts—providing immediate empirical intuition for how high tail impedance suppresses common-mode hum.

Reference Component Values & Bill of Materials

Part / DesignatorNominal ValueRole in Circuit
Q1, Q2 (Matched BJT Pair)2N3904 matchedShares constant tail current to steer strictly on input voltage difference
Rc1, Rc2 (Collector Loads)4.7 kOhm matchedConverts differential collector currents into balanced voltage gain outputs
R_tail (Tail Bias Resistor)10 kOhmEnforces stable tail current establishing strong common-mode rejection
Vcc / Vee Dual Supplies+12 V / -12 VSymmetric rails centering differential output swing comfortably

Expected Waveforms & Simulation Verification

Probe / NodeAnalysis TypeExpected WaveformEngineering Check
V_C1 & V_C2 (Diff Drive)Transient (.tran)Equal and opposite large 180-deg anti-phase sine swingsConfirms smooth tail-current steering and balanced differential gain
V_C2 − V_C1 (Common Drive)Transient (.tran)Near-zero flat residual trace when Vin1 = Vin2Demonstrates high Common-Mode Rejection Ratio (CMRR) canceling shared noise
V_Emitter (Shared Tail)DC / Transient~-0.7 V DC for Vin1=Vin2=0 V; rides steadily with VcmShows emitter junction tracking common-mode voltage to shield differential gain

Troubleshooting Common SPICE & Bench Mistakes

Differential outputs clip unevenly or sit asymmetrically at DC
Verify Rc1 == Rc2 symmetrically and ensure base bias return paths to ground aren't missing on either Vin1 or Vin2 (input base current MUST have a DC path to ground!).
Poor CMRR even with balanced resistors in an op-amp subtractor
Check sensor source impedance! Adding a 1 kOhm sensor resistance strictly on one terminal unbalances the R1/R3 divider ratio—fix by using identically matched sensor paths or buffering via an Instrumentation Amplifier.
Tail transistor pair clips linearly on >100 mVpp inputs
Bare BJT differential pairs naturally turn non-linear past ~50 mVpp (2·V_T)! Insert small matched degeneration resistors (e.g., 100 Ohm) on both emitters to widen linear differential input swing smoothly.

Hands-On Lab Exercises in NodeSim

  1. Tie Vin1 and Vin2 together in NodeSim onto a single 1 Vpk 1 kHz AC source and measure exact residual peak-to-peak collector swing to compute empirical common-mode gain A_cm and CMRR in dB.
  2. Double tail bias resistor R_tail (or replace it with an active NPN current sink) and record how sharply CMRR climbs upward.
  3. Connect small 100 Ohm emitter degeneration resistors between Q1/Q2 emitters and the tail node, then observe extended linear input amplitude range before distortion sets in.
Ready to run your own numbers?
Open this schematic live in NodeSim or export an IEEE PDF lab report.
Related Guides:Wheatstone Sensor BridgeOp-Amp Golden RulesInverting Op-AmpCommon-Emitter AmpVoltage Follower Buffer