Skip to contents

For each detected R-peak, identifies QRS complex boundaries (onset and offset) and P-wave and T-wave peaks. QRS boundaries are detected using a gradient-based search from the R-peak, while P and T waves are found as local maxima in physiologically plausible time windows.

Usage

ecgDelineate(x, peaks, assay_name = NULL)

Arguments

x

A PhysioExperiment object with ECG data.

peaks

A data.frame of detected R-peaks as returned by ecgDetectRpeaks, with columns channel and sample.

assay_name

Name of the assay to use. If NULL, the default assay is used.

Value

A data.frame with one row per beat and the following columns:

channel

Integer channel index (1-based).

beat

Integer beat number within the channel (1-based).

r_peak

Sample index of the R-peak.

qrs_onset

Sample index of QRS complex onset.

qrs_offset

Sample index of QRS complex offset (J-point).

qrs_duration_ms

QRS complex duration in milliseconds.

p_peak

Sample index of P-wave peak, or NA if not found in the search window (300–80 ms before R-peak).

t_peak

Sample index of T-wave peak, or NA if not found in the search window (80–500 ms after R-peak).

t_end

Sample index of T-wave end estimated by tangent-intercept method, or NA if T-wave not found.

Returns a zero-row data.frame with the same column structure if no beats are delineated.

References

Goldberger, A.L., et al. (2000). "PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals." Circulation, 101(23), e215–e220. doi:10.1161/01.CIR.101.23.e215

See also

ecgDetectRpeaks for R-peak detection, ecgIntervals for computing clinical ECG intervals from delineation results, ecgSignalQuality for signal quality assessment.

Examples

set.seed(1)
pe <- make_ecg_pqrst(n_time = 5000, sr = 500, heart_rate = 72)$pe
peaks <- ecgDetectRpeaks(pe)
delin <- ecgDelineate(pe, peaks)
head(delin)
#>   channel beat r_peak qrs_onset qrs_offset qrs_duration_ms p_peak t_peak t_end
#> 1       1    1    567       545        591              92    486    718   752
#> 2       1    2    984       964       1007              86    905   1131  1202
#> 3       1    3   1401      1379       1423              88   1320   1553  1584
#> 4       1    4   1818      1789       1841             104   1737   1970  2038
#> 5       1    5   2235      2207       2259             104   2154   2387  2459
#> 6       1    6   2652      2628       2676              96   2568   2812  2911