Lead Derivation¶
Pure numpy, no scipy required. Validates that sample rates and lengths match.
Raw leads with the same
resolutionandresolution_unitare combined in ADC counts (offsets folded in), and the derived leads stay raw on that scale.Otherwise both leads are converted to physical values in lead I’s unit first, and the derived leads are physical.
derive_standard_12then also converts I, II and V1 to V6, so all 12 leads share one scale.Raw leads with different scales and no voltage unit raise
ValueError.Derived leads do not copy file-specific metadata from lead I:
annotations,quality,transducerandadc_resolutionare reset.
Derive Lead III from Leads I and II (Einthoven’s law) |
|
Derive augmented limb leads aVR, aVL, aVF |
|
Assemble a full 12-lead ECG |
|
Find a lead by label (case-insensitive) |
- ecgdatakit.processing.derive_lead_iii(lead_i, lead_ii, *, fs=None)[source]¶
Derive Lead III from Leads I and II (Einthoven’s law: III = II - I).
- ecgdatakit.processing.derive_augmented(lead_i, lead_ii, *, fs=None)[source]¶
Derive augmented limb leads aVR, aVL, aVF from Leads I and II.
- ecgdatakit.processing.derive_standard_12(lead_i, lead_ii, v1, v2, v3, v4, v5, v6, *, fs=None)[source]¶
Assemble a full 12-lead ECG, deriving III, aVR, aVL, aVF.
- Parameters:
v1..v6 (
Lead | NDArray[np.float64]) – Precordial leads.fs (
int|None) – Sample rate in Hz. Required when passing numpy arrays.v1 (Lead | NDArray[float64])
v2 (Lead | NDArray[float64])
v3 (Lead | NDArray[float64])
v4 (Lead | NDArray[float64])
v5 (Lead | NDArray[float64])
v6 (Lead | NDArray[float64])
- Returns:
12 leads in standard order: I, II, III, aVR, aVL, aVF, V1–V6. When the limb leads had to be converted to physical values (see the module notes), I, II and V1–V6 are returned converted as well, so all 12 leads share one scale.
- Return type: