voxseg_/extract_feats.py
def extract(data: pd.DataFrame, params: dict, rate: int) -> pd.DataFrame:
    '''Function for extracting log-mel filterbank spectrogram features.

    Args:
        data: A pd.DataFrame containing dataset information and signals -- see docs for prep_data().
        params: a dictionary containing
            frame_length -- the size of the input to the CNN, 
            nfilt -- number of filters for logfbank
            winlen -- size of the window for logfbank
            winstep -- step for logfbank 
        rate: Sample rate.

    Returns:
        A pd.DataFrame containing features and metadata.
    '''
    
    print('--------------- Extracting features ---------------')
    interval_length = utils.get_interval_length(rate, params)
    
    logging.info("\tsampling rate = {}".format(rate))
    logging.info("\tinterval length = {}".format(interval_length))
    
    data = data.copy()
    #data['features'] = data.apply(lambda x: _calculate_feats(x, params, rate, interval_length), axis=1)
    #'''
    features = []
    endpoints = []
    for i, row in data.iterrows():
        (feats, ends) = _calculate_feats(row, params, rate, interval_length)
        features.append(feats)
        endpoints.append(ends)
    
    data['features'] = features
    data['endpoints'] = endpoints
    #'''
    data = data.drop(['signal'], axis=1)
    data = data.dropna().reset_index(drop=True)
    
    return data
Function for extracting log-mel filterbank spectrogram features.

    Args:
        data: A pd.DataFrame containing dataset information and signals -- see docs for prep_data().
        params: a dictionary containing
            frame_length -- the size of the input to the CNN, 
            nfilt -- number of filters for logfbank
            winlen -- size of the window for logfbank
            winstep -- step for logfbank 
        rate: Sample rate.

    Returns:
        A pd.DataFrame containing features and metadata.
    
Function for extracting log-mel filterbank spectrogram features.
Function for extracting log - mel filterbank spectrogram features .
def extract(data: pd.DataFrame, params: dict, rate: int) -> pd.DataFrame:
    print('--------------- Extracting features ---------------')
    interval_length = utils.get_interval_length(rate, params)
    logging.info("\tsampling rate = {}".format(rate))
    logging.info("\tinterval length = {}".format(interval_length))
    data = data.copy()
    features = []
    endpoints = []
    for i, row in data.iterrows():
        (feats, ends) = _calculate_feats(row, params, rate, interval_length)
        features.append(feats)
        endpoints.append(ends)
    data['features'] = features
    data['endpoints'] = endpoints
    data = data.drop(['signal'], axis=1)
    data = data.dropna().reset_index(drop=True)
    return data
def extract ( data : pd . DataFrame , params : dict , rate : int ) -> pd . DataFrame : print ( '--------------- Extracting features ---------------' ) interval_length = utils . get_interval_length ( rate , params ) logging . info ( "\tsampling rate = {}" . format ( rate ) ) logging . info ( "\tinterval length = {}" . format ( interval_length ) ) data = data . copy ( ) features = [ ] endpoints = [ ] for i , row in data . iterrows ( ) : ( feats , ends ) = _calculate_feats ( row , params , rate , interval_length ) features . append ( feats ) endpoints . append ( ends ) data [ 'features' ] = features data [ 'endpoints' ] = endpoints data = data . drop ( [ 'signal' ] , axis = 1 ) data = data . dropna ( ) . reset_index ( drop = True ) return data
Function for extracting log-mel filterbank spectrogram features.
Function for extracting log - mel filterbank spectrogram features .
'''Function for extracting log-mel filterbank spectrogram features.

    Args:
        data: A pd.DataFrame containing dataset information and signals -- see docs for prep_data().
        params: a dictionary containing
            frame_length -- the size of the input to the CNN, 
            nfilt -- number of filters for logfbank
            winlen -- size of the window for logfbank
            winstep -- step for logfbank 
        rate: Sample rate.

    Returns:
        A pd.DataFrame containing features and metadata.
    ''' #data['features'] = data.apply(lambda x: _calculate_feats(x, params, rate, interval_length), axis=1) #''' #'''
A pd.DataFrame containing features and metadata.
A pd . DataFrame containing features and metadata .
data
pd.DataFrame
A pd.DataFrame containing dataset information and signals -- see docs for prep_data().
A pd . DataFrame containing dataset information and signals -- see docs for prep_data () .
params
dict
a dictionary containing
frame_length -- the size of the input to the CNN,
nfilt -- number of filters for logfbank
winlen -- size of the window for logfbank
winstep -- step for logfbank
a dictionary containing frame_length -- the size of the input to the CNN nfilt -- number of filters for logfbank winlen -- size of the window for logfbank winstep -- step for logfbank
rate
int
None