File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -402,22 +402,24 @@ 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 (). astype ( np . int64 ) - baseline [i ]
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 . astype ( np . int64 ) - baseline [i ]) / adc_gain_all [i ]
415
417
else :
416
418
for j in range (sig_len ):
417
419
start_ind = j * samps_per_frame [i ]
418
420
stop_ind = start_ind + samps_per_frame [i ]
419
421
sig_data [j , i ] = np .mean (
420
- ( temp_sig_data [start_ind :stop_ind ] - baseline [i ])
422
+ temp_sig_data [start_ind :stop_ind ]. astype ( np . int64 ) - baseline [i ]
421
423
/ adc_gain_all [i ]
422
424
)
423
425
You can’t perform that action at this time.
0 commit comments