QPeakExtractionMartinez2004Neurokit#

class pepbench.algorithms.ecg.QPeakExtractionMartinez2004Neurokit(handle_missing_events: Literal['raise', 'warn', 'ignore'] = 'warn')[source]#

Q-peak extraction algorithm by Martinez et al. (2004) using the DWT method implemented in NeuroKit2.

This algorithm detects the Q-peak of an ECG signal using the discrete wavelet transform (DWT) method implemented in NeuroKit2.

For more information on the algorithm, see [Mar04]. For more information on the NeuroKit2 library, see [Mak21].

References

[Mar04]

Martinez, J. P., Almeida, R., Olmos, S., Rocha, A. P., & Laguna, P. (2004). A wavelet-based ECG delineator: evaluation on standard databases. IEEE Transactions on Biomedical Engineering, 51(4), 570-581. https://doi.org/10.1109/TBME.2003.821031

[Mak21]

Makowski, D., Pham, T., Lau, Z. J., Brammer, J. C., Lesspinasse, F., Pham, H., Schölzel, C., & S.H. Chen (2021). NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing. Behavior Research Methods. https://doi.org/10.3758/s13428-020-01516-y

Methods

clone()

Create a new instance of the class with all parameters copied over.

extract(*, ecg, heartbeats, sampling_rate_hz)

Extract Q-peaks from given ECG signal.

get_params([deep])

Get parameters for this algorithm.

set_params(**params)

Set the parameters of this Algorithm.

__init__(handle_missing_events: Literal['raise', 'warn', 'ignore'] = 'warn')[source]#

Initialize new QPeakExtractionMartinez2004Neurokit algorithm instance.

Parameters:
handle_missing_eventsone of {“warn”, “raise”, “ignore”}, optional

How to handle missing data in the input dataframes. Default: “warn”

extract(*, ecg: _EcgRawDataFrame | DataFrame, heartbeats: _HeartbeatSegmentationDataFrame | DataFrame, sampling_rate_hz: float)[source]#

Extract Q-peaks from given ECG signal.

The results are saved in the points_ attribute of the super class.

Parameters:
ecg: :class:`~pandas.DataFrame`

ECG signal

heartbeats: :class:`~pandas.DataFrame`

DataFrame containing one row per segmented heartbeat, each row contains start, end, and R-peak location (in samples from beginning of signal) of that heartbeat, index functions as id of heartbeat

sampling_rate_hz: int

Sampling rate of ECG signal in hz

Returns:
self
Raises:
EventExtractionError

If the event extraction fails and handle_missing is set to “raise”

clone() Self[source]#

Create a new instance of the class with all parameters copied over.

This will create a new instance of the class itself and all nested objects

get_params(deep: bool = True) dict[str, Any][source]#

Get parameters for this algorithm.

Parameters:
deep

Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like nested_object_name__ (Note the two “_” at the end)

Returns:
params

Parameter names mapped to their values.

set_params(**params: Any) Self[source]#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.