Skip to content

Commit 8945861

Browse files
author
Benjamin Moody
committed
adc (inplace=False, expanded=True): refactor for clarity.
1 parent 7ae21d4 commit 8945861

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

wfdb/io/_signal.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,12 @@ def adc_inplace_2d(p_signal):
570570
if expanded:
571571
d_signal = []
572572
for ch in range(self.n_sig):
573-
# NAN locations for the channel
574-
ch_nanlocs = np.isnan(self.e_p_signal[ch])
575-
ch_d_signal = self.e_p_signal[ch].copy()
576-
np.multiply(ch_d_signal, self.adc_gain[ch], ch_d_signal)
577-
np.add(ch_d_signal, self.baseline[ch], ch_d_signal)
578-
np.round(ch_d_signal, 0, ch_d_signal)
579-
ch_d_signal = ch_d_signal.astype(intdtype, copy=False)
573+
ch_p_signal = self.e_p_signal[ch].copy()
574+
ch_nanlocs = np.isnan(ch_p_signal)
575+
np.multiply(ch_p_signal, self.adc_gain[ch], ch_p_signal)
576+
np.add(ch_p_signal, self.baseline[ch], ch_p_signal)
577+
np.round(ch_p_signal, 0, ch_p_signal)
578+
ch_d_signal = ch_p_signal.astype(intdtype, copy=False)
580579
ch_d_signal[ch_nanlocs] = d_nans[ch]
581580
d_signal.append(ch_d_signal)
582581

0 commit comments

Comments
 (0)