Biomedical Operational Amplifiers & Analog Front-End Design: CMRR, Right-Leg Drive, TIA and Chopper Stabilization
Turning microvolt electrophysiology into clean digital samples is an exercise in rejecting everything that is not the signal. This lab lets you build the amplifier, break it with realistic clinical stressors, and watch the physics respond on a live oscilloscope.
Overview: Microvolts in a Sea of Common-Mode Noise
A surface ECG delivers 1–5 mV, an EMG burst a few millivolts, and scalp EEG only $10\text{–}100\,\mu\text{V}$. Yet the body is a conductor hanging between the mains wiring and the floor. Displacement current $i_{\text{disp}} = \omega C_{\text{line}} V_{\text{mains}}$, with $C_{\text{line}}\approx 3\text{–}10\,\text{pF}$, returns to earth through the body-to-ground capacitance $C_{\text{body}}\approx 100\text{–}250\,\text{pF}$. That lifts the entire patient to a common-mode potential $V_{cm}\approx i_{\text{disp}}/(\omega C_{\text{body}})$ of several volts at 50 or 60 Hz. The amplifier must extract a millivolt difference from two electrodes riding on a disturbance thousands of times larger.
A single op-amp difference stage fails for two reasons. Its gain is $R_2/R_1$, so high gain forces a low input resistance, and that resistance forms a divider with the skin–electrode impedance $Z_e$, which ranges from about $2\,\text{k}\Omega$ to above $100\,\text{k}\Omega$. When the two electrodes differ by $\Delta Z_e$, common-mode voltage is converted into differential error, limiting rejection to roughly $(R_1+Z_e)/\Delta Z_e$, often below 40 dB. Even with perfect electrodes, four resistors matched to a fractional tolerance $\epsilon_R$ give $\text{CMRR}\approx (1+A_d)/(4\epsilon_R)$, which is only about 49 dB for 1% parts at a gain of 10.
The three-op-amp instrumentation amplifier fixes both problems. Two buffered input stages present extremely high impedance and pass common-mode voltage at unity gain while amplifying the difference by $G_1$. A subtraction stage then removes what remains:
$$V_{\text{out}} = \left( 1 + \frac{2R_1}{R_{\text{gain}}} \right) \frac{R_4}{R_3}\,(V_{+} - V_{-})$$
Because $G_1$ multiplies the resistor-limited rejection of the second stage, the net figure that the simulator reports combines every error path as a sum of inverse ratios:
$$\frac{1}{\text{CMRR}_{\text{net}}} = \frac{1}{\text{CMRR}_{\text{res}}} + \frac{1}{\text{CMRR}_{\text{op}}} + \omega C_{cm}\,\Delta Z_e, \qquad \text{CMRR}_{\text{res}} \approx \frac{G_1(1+A_2)}{4\,\epsilon_R}$$
Active suppression closes the story. The right-leg drive (RLD) amplifier senses the average common-mode voltage, inverts it, and drives it back into the body through a current-limited electrode. With loop gain $A_{\text{RLD}}$ the patient common-mode voltage falls to
$$V_{cm,\text{eff}} = \frac{V_{cm}}{1 + A_{\text{RLD}}}$$
which is about 36 dB of improvement for $A_{\text{RLD}}=60$, provided the drive amplifier does not hit its own supply rail. Series resistance must also hold fault current under $10\,\mu\text{A}$ for IEC 60601-1 compliance.
Three more pitfalls complete the clinical picture. Ag/AgCl half-cell potentials of up to $\pm 300\,\text{mV}$ mean a DC-coupled stage can use no more than a gain of about $V_{\text{rail}}/V_{hc}\approx 11$ before saturating, so real systems split the gain and add a sub-hertz servo. Shielded patient cable adds $C_L\approx 100\text{–}300\,\text{pF/m}$, and together with the output resistance $R_o$ it creates a pole $f_p = 1/(2\pi R_o C_L)$ that erodes phase margin to roughly $90^\circ - \arctan(f_c/f_p)$. Finally, optical front ends use a transimpedance amplifier with $V_{\text{out}} = I_{\text{pd}}R_f$, where photodiode and cable capacitance $C_{in}$ demand a feedback capacitor near $C_f\approx\sqrt{C_{in}/(2\pi R_f\,\text{GBW})}$ for a stable response.
How to Use the Simulator
- Pick an architecture. Compare the single difference amplifier, the 3-op-amp in-amp with RLD, the TIA for photoplethysmography, and the chopper-stabilized amplifier. Choosing TIA switches the signal to PPG automatically, and choosing a biopotential amplifier switches it back to ECG.
- Read the oscilloscope. Click a test point on the schematic (or press keys 1–5) to move the probe between the electrodes, the differential node, the output and the RLD drive. The scope auto-scales; use ZOOM and the timebase chips for detail. Short timebases reveal mains hum and chopper ripple, long ones reveal the heartbeat.
- Drag the electrodes. Pull E1 or E2 away from the body to raise skin impedance and watch common-mode hum convert into differential noise. Pushing both to the same impedance restores the balance.
- Stress the design. Raise resistor mismatch, mains pickup, half-cell DC offset, cable capacitance or gain, and switch RLD, the DC servo and the isolation resistor to see how each rescues or ruins the trace.
- Chase the grade. The grade chip scores CMRR, mains SNR, phase margin and clipping. Tap a Disaster Lab scenario for a ready-made failure, then fix it.
- Share it. Snapshot saves a PNG of the live scope, and Share Setup copies a link that restores your exact configuration.
- Take the tour. Start Demo runs a narrated, timeline-driven walkthrough. Touching any control hands control back to you. Keyboard: D demo, R reset, S sound, 1–5 probes.
Technical Details
The simulator runs a true time-domain model at a 40 kHz sample rate into five 5-second ring buffers, one per test point, independent of the display frame rate. ECG is a sum of five Gaussian waves (P, Q, R, S, T) with respiratory heart-rate modulation and baseline wander. EEG combines theta, alpha and beta rhythms with a slowly waxing alpha envelope and pink background. EMG is band-limited noise (about 20–450 Hz) gated by contraction bursts. PPG is a two-lobe pulse waveform riding on a DC photocurrent.
Noise is physical: thermal noise follows $\sqrt{4kT R_s B}$ with the live electrode impedance, and amplifier flicker noise is generated with a pink filter whose amplitude depends on topology. The chopper model removes the $1/f$ term and input offset, but adds output ripple at $f_{ch}$ and a lower switched input impedance, which is why it is less tolerant of imbalanced electrodes.
Common-mode conversion uses the net-CMRR equation above, with the cable capacitance contributing to $C_{cm}$ through guarding. The RLD is modeled as an inverting amplifier with loop gain 60 clamped at the supply rails, so very large pickup saturates the drive and the cancellation collapses. The DC servo is an integrator at the input with a 3.18 s time constant (0.05 Hz corner), limited authority of 400 mV, and a fast-restore mode that shortens recovery after overload.
Stability is analytic. For the biopotential output stage, phase margin is $90^\circ - \arctan(f_c/f_p)$ with the cable pole above; the isolation resistor adds roughly $30^\circ$ through in-loop compensation. For the TIA, the simulator scans the loop gain $A\beta$ with its zero and pole, finds the true crossover and reports the exact margin. Below $60^\circ$ a ringing term grows with the cube of the margin deficit. Real ringing sits at hundreds of kilohertz, so the display shows it time-scaled and the HUD reports the true frequency.
The scope draws a min/max envelope per pixel column so fast ripple is never aliased away. The demo is a declarative cue sheet. If overview.m4a is present the playhead locks to the audio clock, otherwise a virtual clock drives the timeline and optional speech synthesis narrates the captions. Synthesized sound ducks automatically under the voice track.
Frequently Asked Questions
Why does a biopotential amplifier need three op-amps?
Two input buffers give very high input impedance so unequal electrode impedances do not unbalance the amplifier, and they provide the gain while passing common-mode signals at unity. The third op-amp subtracts the two channels. The first-stage gain multiplies the resistor-limited CMRR of the subtraction stage.
What does right-leg drive actually do?
It senses the average common-mode voltage on the body, inverts and amplifies it, and drives it back through a current-limited electrode. With loop gain A the body common-mode voltage falls by a factor of 1 plus A, about 36 dB for A equal to 60.
Why do ECG amplifiers use a 0.05 Hz high-pass filter?
Ag/AgCl electrodes create half-cell DC offsets up to about 300 mV. A DC-coupled stage with high gain would slam into the supply rails, so a sub-hertz servo or high-pass removes the offset while preserving the ST segment of the ECG.
Why does a long patient cable make an amplifier oscillate?
Cable capacitance forms a pole with the amplifier output resistance, adding phase lag inside the feedback loop. Phase margin shrinks, causing peaking and ringing. An in-loop isolation resistor restores stability.
Related Electrophysiology & Sensor Simulation Engines
⚖️ Legal Notices, Nominative Fair Use & Professional Disclaimers
• Editorial Independence & Non-Affiliation: This software laboratory and critical analysis is an independent educational, historical, and mathematical simulation created by BioniChaos. It is not affiliated with, maintained by, sponsored by, or endorsed by Texas Instruments, Analog Devices, STMicroelectronics, Medtronic, or Philips Healthcare or any of their corporate subsidiaries.
• Trademark Attribution: "AD8220", "AD8421", "INA118", "ADS1298", and associated component part designations are registered trademarks owned by their respective semiconductor manufacturers. All trademarks and part designations are referenced strictly for nominative identification, technological criticism, and fair academic commentary under applicable intellectual property laws.
• Not Medical, Diagnostic or Engineering Advice: All computational routines, mathematical transforms, electrophysiological models, and parameters presented in this tool are theoretical simulations. This visualizer does not provide medical, surgical, clinical diagnostic, or certified engineering advice and must not be used for patient care or physical hardware implementation. Individuals seeking health interventions should consult licensed medical professionals.
• Modeling & Retrospective Analysis Disclaimer: Telemetry, error distributions, and historical shockwave models are retrospective academic and computational estimations. They do not constitute legal, regulatory, or financial advice.
Open Access License: This interactive educational module is released under
CC BY-NC 4.0 (Attribution-NonCommercial)
for non-commercial research, academic study, and clinical education.
Commercial & Enterprise Licensing: For white-labeling, proprietary LMS/course embedding, hardware dashboard telemetry integration, or custom feature engineering, secure a commercial license at
BioniCloud.com or contact
Dr. Yuri Beno.