LibXtract 1.6.0
LibXtract

LibXtract is a portable C99 library of feature extraction functions for time series and other numeric data. Each function takes an array of doubles and returns a number or a vector that describes it: a statistic, a measure of spectral shape, a pitch estimate, a measure of complexity. The library has a full set of audio features, and its statistical, complexity and moving-window functions make no assumption about what the numbers represent.

A feature that depends on another takes it as an argument. The variance and average deviation take the mean of the input vector, and the skewness and kurtosis take the mean and the standard deviation, in that order, so the mean is computed once and passed to each of them. A feature of the magnitude spectrum, such as the irregularity, takes the magnitude coefficients that xtract_spectrum() writes to the first half of its result.

A value is therefore computed once however many features use it, and features can be combined: the irregularity of a set of Mel Frequency Cepstral Coefficients is a valid call.

All feature extraction functions follow the same prototype:

int xtract_function_name(const double *data, const int N, const void *argv, double *result);

Parameters
constdouble *data points to an array of doubles representing the input data
constint N represents the number of elements from *data to be considered in the calculation
constvoid *argv represents an arbitrary list of arguments. Used to pass in values required by the feature calculation
double*result points to an array of doubles, or a single double representing the result of the calculation

It is up to the calling function to allocate enough memory for the *data, *argv, and *result, and to free it when required. Some feature extraction functions may also require an _init() function to be called in order to perform some initialisation. The struct xtract_function_descriptor_t is used to give an indication of recommended default values, and argc for the *argv array.

LibXtract is developed at https://github.com/jamiebullock/LibXtract