File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -402,23 +402,26 @@ def read_edf(
402
402
temp_sig_data = np .fromfile (edf_file , dtype = np .int16 )
403
403
temp_sig_data = temp_sig_data .reshape ((- 1 , sum (samps_per_block )))
404
404
temp_all_sigs = np .hsplit (temp_sig_data , np .cumsum (samps_per_block )[:- 1 ])
405
+
405
406
for i in range (n_sig ):
406
407
# Check if `samps_per_frame` has all equal values
407
408
if samps_per_frame .count (samps_per_frame [0 ]) == len (samps_per_frame ):
408
409
sig_data [:, i ] = (
409
- temp_all_sigs [i ].flatten () - baseline [i ]
410
+ ( temp_all_sigs [i ].flatten () - baseline [i ]). astype ( np . int64 )
410
411
) / adc_gain_all [i ]
411
412
else :
412
413
temp_sig_data = temp_all_sigs [i ].flatten ()
414
+
413
415
if samps_per_frame [i ] == 1 :
414
- sig_data [:, i ] = (temp_sig_data - baseline [i ]) / adc_gain_all [i ]
416
+ sig_data [:, i ] = (temp_sig_data - baseline [i ]).astype (
417
+ np .int64 ) / adc_gain_all [i ]
415
418
else :
416
419
for j in range (sig_len ):
417
420
start_ind = j * samps_per_frame [i ]
418
421
stop_ind = start_ind + samps_per_frame [i ]
419
422
sig_data [j , i ] = np .mean (
420
423
(temp_sig_data [start_ind :stop_ind ] - baseline [i ])
421
- / adc_gain_all [i ]
424
+ . astype ( np . int64 ) / adc_gain_all [i ]
422
425
)
423
426
424
427
# This is the closest I can get to the original implementation
You can’t perform that action at this time.
0 commit comments