def _read_ch(fid, subtype, samp, data_size):
 if (subtype in ('24BIT', 'bdf')):
  ch_data = np.fromfile(fid, dtype=np.uint8, count=(samp * data_size))
  ch_data = ch_data.reshape((-1), 3).astype(np.int32)
  ch_data = ((ch_data[:, 0] + (ch_data[:, 1] << 8)) + (ch_data[:, 2] << 16))
  ch_data[(ch_data >= (1 << 23))] -= (1 << 24)
 else:
  ch_data = np.fromfile(fid, dtype='<i2', count=samp)
 return ch_data

def _read_ch ( fid , subtype , samp , data_size ) : if ( subtype in ( '24BIT' , 'bdf' ) ) : ch_data = np . fromfile ( fid , dtype = np . uint8 , count = ( samp * data_size ) ) ch_data = ch_data . reshape ( ( - 1 ) , 3 ) . astype ( np . int32 ) ch_data = ( ( ch_data [ : , 0 ] + ( ch_data [ : , 1 ] << 8 ) ) + ( ch_data [ : , 2 ] << 16 ) ) ch_data [ ( ch_data >= ( 1 << 23 ) ) ] -= ( 1 << 24 ) else : ch_data = np . fromfile ( fid , dtype = '<i2' , count = samp ) return ch_data
read a number of samples for a single channel .