Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 1917f67

Browse files
committed
Merge branch 'pr/23'
2 parents 1ebfa63 + 945be2d commit 1917f67

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

biosppy/signals/ecg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def christov_segmenter(signal=None, sampling_rate=1000.):
503503
X = ss.filtfilt(b, a, signal)
504504
# 2. Moving averaging of samples in 28 ms interval for electromyogram
505505
# noise suppression a filter with first zero at about 35 Hz.
506-
b = np.ones(sampling_rate / 35.) / 35.
506+
b = np.ones(int(sampling_rate / 35.)) / 35.
507507
X = ss.filtfilt(b, a, X)
508508
X, _, _ = st.filter_signal(signal=X,
509509
ftype='butter',
@@ -531,11 +531,11 @@ def christov_segmenter(signal=None, sampling_rate=1000.):
531531
# with first zero at about 25 Hz. It is suppressing the noise
532532
# magnified by the differentiation procedure used in the
533533
# process of the complex lead sintesis.
534-
b = np.ones(sampling_rate / 25.) / 25.
534+
b = np.ones(int(sampling_rate / 25.)) / 25.
535535
Y = ss.lfilter(b, a, Y)
536536

537537
# Init
538-
MM = M_th * np.max(Y[:5 * sampling_rate]) * np.ones(5)
538+
MM = M_th * np.max(Y[:int(5 * sampling_rate)]) * np.ones(5)
539539
MMidx = 0
540540
M = np.mean(MM)
541541
slope = np.linspace(1.0, 0.6, int(sampling_rate))
@@ -827,7 +827,7 @@ def gamboa_segmenter(signal=None, sampling_rate=1000., tol=0.002):
827827
for i in b[1:]:
828828
if i - previous > v_300ms:
829829
previous = i
830-
rpeaks.append(np.argmax(signal[i:i + v_100ms]) + i)
830+
rpeaks.append(np.argmax(signal[int(i):int(i + v_100ms)]) + i)
831831

832832
rpeaks = np.array(rpeaks, dtype='int')
833833

0 commit comments

Comments
 (0)