ECG baseline removal from fiducial isoelectric samples¶
What it does¶
This method estimates slow ECG baseline drift from supplied fiducial positions expected to represent the local isoelectric level. It subtracts a smooth interpolation of those levels and also returns the estimated baseline.
When to use it¶
Use it when suitable isoelectric fiducials are already available and low-frequency baseline motion is obscuring ECG morphology or amplitude measurements. It is not a fiducial detector and does not verify that the supplied positions are physiologically appropriate.
Canonical ID: ecg.baselineremove
Inputs¶
| Name | Meaning | Type | Unit | Requirements |
|---|---|---|---|---|
ecg |
Sampled ECG signal from which the slowly varying baseline will be removed. | real vector | a.u. | minimum length: 1; no NaN; finite |
fiducial_positions |
Sample positions expected to represent a local isoelectric ECG level. | real vector | sample | greater than: 0; minimum length: 1; no NaN; finite |
offset |
Number of samples subtracted from every fiducial before estimating its local level. | integer scalar | sample | minimum: 0; no NaN; finite |
Parameters¶
| Name | Meaning | Type | Unit | Default | Requirements |
|---|---|---|---|---|---|
window_size |
Requested local averaging span around each adjusted fiducial. | integer scalar | sample | 5 |
greater than: 0 |
Outputs¶
| Name | Meaning | Type | Unit |
|---|---|---|---|
ecg_detrended |
ECG after subtracting the estimated baseline. | real vector | a.u. |
baseline |
Estimated baseline aligned sample by sample with the input ECG. | real vector | a.u. |
How it works¶
Each fiducial is shifted by offset, normalized to the sample grid, and represented by the mean ECG level in a short local window. Two or more valid levels define a smooth baseline over the complete signal: linear with two levels, quadratic with three, and not-a-knot cubic with four or more.
The offset, averaging window, and boundary behavior are empirical algorithm choices rather than constants established by the original spline-baseline literature.
Interpretation and limitations¶
Poorly placed fiducials can remove genuine ECG morphology or create misleading extrapolation near the signal boundaries. Fiducials should cover the analyzed segment and should be reviewed in the context of the downstream measurement.
References¶
- C. R. Meyer and H. N. Keiser (1977). Electrocardiogram baseline noise estimation and removal using cubic splines and state-space computation techniques. Computers and Biomedical Research. doi:10.1016/0010-4809(77)90021-0