BMEN90033 · Bioinstrumentation
← Back
EXextras · synthetic biosignals

Simulate ECG Data.

This simulator synthesises the two Einthoven bipolar leads (I and II) of an electrocardiogram from a PQRST Gaussian-sum model. Lead II uses a lead-II morphology; Lead I is generated from the same beat schedule with wave amplitudes scaled to approximate a projection of the cardiac vector onto the lead-I axis at a normal QRS orientation. Additive noise sources are representative of surface acquisition: low-frequency baseline wander attributable to respiration and electrode motion, broadband electromyographic interference, narrowband powerline coupling with its odd harmonics, transient electrode artefacts, and Gaussian thermal noise. Each lead receives an independent realisation of the noise.

The resulting waveforms can be exported as CSV or TXT for use in MATLAB, Excel, or NI Multisim, supporting end-to-end simulation of your device. In Multisim, each TXT file is typically loaded into a piecewise-linear voltage source, which then drives the analog front-end during transient analysis; a two-lead front end uses two such sources, one per lead.

Two-lead ECG · Einthoven I & II clean noisy
Lead I
Lead II
HR 72 bpm
Duration 10.0 s
fs 500 Hz
Samples 5000
SNR I
SNR II

The clean reference is constructed as a superposition of Gaussians parameterised to reproduce the P, Q, R, S, and T deflections, repeated at the prescribed heart rate with physiologically plausible beat-to-beat interval variability. The two leads share a single beat schedule but use lead-specific wave amplitudes; each noise component is generated independently per lead and additively superimposed on the clean waveform.

Two-lead monitor view · simultaneous Lead I and Lead II as recorded Lead I Lead II
Peak I
Peak II
Peak ratio I:II

A two-lead ECG monitor records both limb-lead signals simultaneously and presents them on a common time and amplitude axis. This panel reproduces that view: the same noisy waveforms shown above are overlaid here so that morphology, timing, and relative amplitude can be compared directly across the two leads.

// Why is Lead I smaller than Lead II?

The two bipolar limb leads sit at different orientations on Einthoven's triangle: Lead I along the horizontal axis at $0^{\circ}$ (LA − RA), Lead II along the LL − RA axis at $+60^{\circ}$. Each lead records the projection of the mean cardiac vector onto its own axis, so the recorded amplitude scales as $\cos(\theta - \theta_{\text{lead}})$, where $\theta$ is the mean QRS axis.

In a normally oriented adult heart, $\theta$ sits near $+60^{\circ}$, aligning the QRS vector with the Lead II axis. Lead II therefore sees the full magnitude ($\cos 0^{\circ} = 1.0$), while Lead I sees only the horizontal component ($\cos 60^{\circ} = 0.5$). This simulator uses $\theta \approx 60^{\circ}$ as its default, giving a Lead I R wave roughly half the Lead II R wave.

The relationship reverses only when the axis rotates leftward past $+30^{\circ}$, a condition known clinically as left axis deviation, seen for example with left anterior fascicular block or certain inferior infarcts.

// Presets

// Signal

72 bpm
10.0 s
500 Hz
1.20 mV
5 %

// Noise

0.20 mV
0.30 Hz
0.04 mV
0.05 mV
0.30
0.10 /s
0.02 mV

// Export

CSV — columns time_s, leadI_mV, leadII_mV, leadI_clean_mV, leadII_clean_mV, one sample per row, for use in analysis environments such as MATLAB or Python.

TXT — two-column time (s) voltage (V) ASCII file in the format accepted by NI Multisim's PIECEWISE_LINEAR_VOLTAGE source. One file is produced per lead; instantiate a PWL voltage source for each in Multisim and set its data-file parameter to the corresponding download to drive a two-lead analog front-end during transient analysis.