Skip to content

Commit 9d62e71

Browse files
committed
use normalize in qrs
1 parent e23fec7 commit 9d62e71

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

wfdb/processing/qrs.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
import numpy as np
55
from scipy import signal
6-
from sklearn.preprocessing import normalize
76

8-
from wfdb.processing.basic import get_filter_gain
7+
from wfdb.processing.basic import get_filter_gain, normalize
98
from wfdb.processing.peaks import find_local_peaks
109
from wfdb.io.record import Record
1110

@@ -288,10 +287,10 @@ def _learn_init_params(self, n_calib_beats=8):
288287

289288
# Question: should the signal be squared? Case for inverse QRS
290289
# complexes
291-
sig_segment = normalize((self.sig_f[i - self.qrs_radius:
292-
i + self.qrs_radius]).reshape(-1, 1), axis=0)
290+
sig_segment = normalize(self.sig_f[i - self.qrs_radius:
291+
i + self.qrs_radius])
293292

294-
xcorr = np.correlate(sig_segment[:, 0], ricker_wavelet[:,0])
293+
xcorr = np.correlate(sig_segment, ricker_wavelet[:,0])
295294

296295
# Classify as QRS if xcorr is large enough
297296
if xcorr > 0.6 and i-last_qrs_ind > self.rr_min:
@@ -530,8 +529,7 @@ def _is_twave(self, peak_num):
530529

531530
# Get half the QRS width of the signal to the left.
532531
# Should this be squared?
533-
sig_segment = normalize((self.sig_f[i - self.qrs_radius:i]
534-
).reshape(-1, 1), axis=0)
532+
sig_segment = normalize(self.sig_f[i - self.qrs_radius:i])
535533
last_qrs_segment = self.sig_f[self.last_qrs_ind - self.qrs_radius:
536534
self.last_qrs_ind]
537535

0 commit comments

Comments
 (0)