features/signal_features.py
def histogram(signal_x):
    '''
    Calculate histogram of sensor signal.

    :param signal_x: 1-D numpy array of sensor signal
    :return: Histogram bin values, descriptor
    '''
    descriptor = np.zeros(3)

    ncell = np.ceil(np.sqrt(len(signal_x)))

    max_val = np.nanmax(signal_x.values)
    min_val = np.nanmin(signal_x.values)

    delta = (max_val - min_val) / (len(signal_x) - 1)

    descriptor[0] = min_val - delta / 2
    descriptor[1] = max_val + delta / 2
    descriptor[2] = ncell

    h = np.histogram(signal_x, ncell.astype(int), range=(min_val, max_val))

    return h[0], descriptor

    Calculate histogram of sensor signal.

    :param signal_x: 1-D numpy array of sensor signal
    :return: Histogram bin values, descriptor
    
Calculate histogram of sensor signal.
Calculate histogram of sensor signal .
def histogram(signal_x):
    descriptor = np.zeros(3)
    ncell = np.ceil(np.sqrt(len(signal_x)))
    max_val = np.nanmax(signal_x.values)
    min_val = np.nanmin(signal_x.values)
    delta = (max_val - min_val) / (len(signal_x) - 1)
    descriptor[0] = min_val - delta / 2
    descriptor[1] = max_val + delta / 2
    descriptor[2] = ncell
    h = np.histogram(signal_x, ncell.astype(int), range=(min_val, max_val))
    return h[0], descriptor
def histogram ( signal_x ) : descriptor = np . zeros ( 3 ) ncell = np . ceil ( np . sqrt ( len ( signal_x ) ) ) max_val = np . nanmax ( signal_x . values ) min_val = np . nanmin ( signal_x . values ) delta = ( max_val - min_val ) / ( len ( signal_x ) - 1 ) descriptor [ 0 ] = min_val - delta / 2 descriptor [ 1 ] = max_val + delta / 2 descriptor [ 2 ] = ncell h = np . histogram ( signal_x , ncell . astype ( int ) , range = ( min_val , max_val ) ) return h [ 0 ] , descriptor
Calculate histogram of sensor signal.
Calculate histogram of sensor signal .
'''
    Calculate histogram of sensor signal.

    :param signal_x: 1-D numpy array of sensor signal
    :return: Histogram bin values, descriptor
    '''
Histogram bin values, descriptor
Histogram bin values descriptor
signal_x
1-D numpy array of sensor signal
1 - D numpy array of sensor signal