Skip to content

Commit 4cd82c6

Browse files
add new detector
1 parent d7120b4 commit 4cd82c6

File tree

3 files changed

+307
-175
lines changed

3 files changed

+307
-175
lines changed

neurokit2/ecg/ecg_clean.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -233,23 +233,19 @@ def _ecg_clean_pantompkins(ecg_signal, sampling_rate=1000):
233233

234234

235235
# =============================================================================
236-
# Elgendi et al. (2010)
236+
# Hamilton (2002)
237237
# =============================================================================
238-
def _ecg_clean_elgendi(ecg_signal, sampling_rate=1000):
239-
"""From https://github.com/berndporr/py-ecg-detectors/
240-
241-
- Elgendi, Mohamed & Jonkman, Mirjam & De Boer, Friso. (2010). Frequency Bands Effects on QRS
242-
Detection. The 3rd International Conference on Bio-inspired Systems and Signal Processing
243-
(BIOSIGNALS2010). 428-431.
244-
238+
def _ecg_clean_hamilton(ecg_signal, sampling_rate=1000):
239+
"""Adapted from https://github.com/PIA-
240+
Group/BioSPPy/blob/e65da30f6379852ecb98f8e2e0c9b4b5175416c3/biosppy/signals/ecg.py#L69.
245241
"""
246242

247-
order = 2
243+
order = 1
248244
clean = signal_filter(
249245
signal=ecg_signal,
250246
sampling_rate=sampling_rate,
251247
lowcut=8,
252-
highcut=20,
248+
highcut=16,
253249
method="butterworth_zi",
254250
order=order,
255251
)
@@ -258,19 +254,23 @@ def _ecg_clean_elgendi(ecg_signal, sampling_rate=1000):
258254

259255

260256
# =============================================================================
261-
# Hamilton (2002)
257+
# Elgendi et al. (2010)
262258
# =============================================================================
263-
def _ecg_clean_hamilton(ecg_signal, sampling_rate=1000):
264-
"""Adapted from https://github.com/PIA-
265-
Group/BioSPPy/blob/e65da30f6379852ecb98f8e2e0c9b4b5175416c3/biosppy/signals/ecg.py#L69.
259+
def _ecg_clean_elgendi(ecg_signal, sampling_rate=1000):
260+
"""From https://github.com/berndporr/py-ecg-detectors/
261+
262+
- Elgendi, Mohamed & Jonkman, Mirjam & De Boer, Friso. (2010). Frequency Bands Effects on QRS
263+
Detection. The 3rd International Conference on Bio-inspired Systems and Signal Processing
264+
(BIOSIGNALS2010). 428-431.
265+
266266
"""
267267

268-
order = 1
268+
order = 2
269269
clean = signal_filter(
270270
signal=ecg_signal,
271271
sampling_rate=sampling_rate,
272272
lowcut=8,
273-
highcut=16,
273+
highcut=20,
274274
method="butterworth_zi",
275275
order=order,
276276
)

0 commit comments

Comments
 (0)