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

Commit

Permalink
Fix float errors
Browse files Browse the repository at this point in the history
Change float indices to integer
  • Loading branch information
Michael Gschwandtner committed Apr 14, 2017
1 parent e51fcd2 commit 945be2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions biosppy/signals/ecg.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def christov_segmenter(signal=None, sampling_rate=1000.):
X = ss.filtfilt(b, a, signal)
# 2. Moving averaging of samples in 28 ms interval for electromyogram
# noise suppression a filter with first zero at about 35 Hz.
b = np.ones(sampling_rate / 35.) / 35.
b = np.ones(int(sampling_rate / 35.)) / 35.
X = ss.filtfilt(b, a, X)
X, _, _ = st.filter_signal(signal=X,
ftype='butter',
Expand Down Expand Up @@ -531,11 +531,11 @@ def christov_segmenter(signal=None, sampling_rate=1000.):
# with first zero at about 25 Hz. It is suppressing the noise
# magnified by the differentiation procedure used in the
# process of the complex lead sintesis.
b = np.ones(sampling_rate / 25.) / 25.
b = np.ones(int(sampling_rate / 25.)) / 25.
Y = ss.lfilter(b, a, Y)

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

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

Expand Down

0 comments on commit 945be2d

Please sign in to comment.