jamie@1: /* libxtract feature extraction library jamie@1: * jamie@1: * Copyright (C) 2006 Jamie Bullock jamie@1: * jamie@1: * This program is free software; you can redistribute it and/or modify jamie@1: * it under the terms of the GNU General Public License as published by jamie@1: * the Free Software Foundation; either version 2 of the License, or jamie@1: * (at your option) any later version. jamie@1: * jamie@1: * This program is distributed in the hope that it will be useful, jamie@1: * but WITHOUT ANY WARRANTY; without even the implied warranty of jamie@1: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jamie@1: * GNU General Public License for more details. jamie@1: * jamie@1: * You should have received a copy of the GNU General Public License jamie@1: * along with this program; if not, write to the Free Software jamie@1: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, jamie@1: * USA. jamie@1: */ jamie@1: jamie@1: /* xtract_scalar.h: declares functions that extract a feature as a single value from an input vector */ jamie@1: jamie@1: #ifndef XTRACT_SCALAR jamie@1: #define XTRACT_SCALAR jamie@1: jamie@1: #ifdef __cplusplus jamie@1: extern "C" { jamie@1: #endif jamie@1: jamie@1: jamie@1: /* Statistical features */ jamie@1: jamie@1: int xtract_mean(float *data, int N, void *argv, float *result); jamie@1: /* mean is passed in as arg */ jamie@1: int xtract_variance(float *data, int N, void *argv, float *result); jamie@1: /* variance is passed in as arg */ jamie@1: int xtract_standard_deviation(float *data, int N, void *argv, float *result); jamie@1: /* mean is passed in as arg */ jamie@1: int xtract_average_deviation(float *data, int N, void *argv, float *result); jamie@1: /* mean and standard deviation are passed in as arg */ jamie@1: int xtract_skewness(float *data, int N, void *argv, float *result); jamie@1: /* mean and standard deviation are passed in as arg */ jamie@1: int xtract_kurtosis(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Irregularity */ jamie@1: jamie@1: /* Krimphoff (1994) */ jamie@1: int xtract_irregularity_k(float *data, int N, void *argv, float *result); jamie@1: /* Jensen (1999) */ jamie@1: int xtract_irregularity_j(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Tristimulus */ jamie@1: jamie@1: /* Pollard and Jansson (1982) */ jamie@1: int xtract_tristimulus_1(float *data, int N, void *argv, float *result); jamie@1: int xtract_tristimulus_2(float *data, int N, void *argv, float *result); jamie@1: int xtract_tristimulus_3(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Smoothness */ jamie@1: jamie@1: /*McAdams (1999)*/ jamie@1: int xtract_smoothness(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Spectral Spread */ jamie@1: jamie@1: /* Casagrande 2005 */ jamie@1: jamie@1: int xtract_spread(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Zero crossing rate */ jamie@1: jamie@1: int xtract_zcr(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Rolloff */ jamie@1: jamie@1: /* Bee Suan Ong (2005) */ jamie@1: /* Threshold is the percentile at which the rolloff is determined */ jamie@1: jamie@1: int xtract_rolloff(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Loudness */ jamie@1: /* A set of BARK_BANDS bark coefficients must be passed in, the loudness is calculated approximately according to Moore, Glasberg et al, 1997 */ jamie@1: jamie@1: int xtract_loudness(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Spectral Flatness Measure */ jamie@1: /* Tristan Jehan (2005) */ jamie@1: jamie@1: int xtract_flatness(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Tonality Factor */ jamie@1: /* Tristan Jehan (2005) */ jamie@1: jamie@1: int xtract_tonality(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Noisiness */ jamie@1: /* Tae Hong Park (2000) */ jamie@1: jamie@1: int xtract_noisiness(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* RMS amplitude */ jamie@1: /* Tae Hong Park (2000) */ jamie@1: jamie@1: int xtract_rms_amplitude(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Inharmonicity */ jamie@1: jamie@1: int xtract_inharmonicity(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Spectral Crest */ jamie@1: /* Peeters (2003) */ jamie@1: int xtract_crest(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Spectral Power */ jamie@1: /* Bee Suan Ong (2005) */ jamie@1: int xtract_power(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Odd to even harmonic ratio */ jamie@1: jamie@1: int xtract_odd_even_ratio(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Sharpness */ jamie@1: jamie@1: int xtract_sharpness(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Slope */ jamie@1: int xtract_slope(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* F0 */ jamie@1: /*This method takes a guess which can come from taking the ZCR of an autocorrelation function, and then finds the spectral peak that most closely matches the gess */ jamie@1: int xtract_f0(float *data, int N, void *argv, float *result); jamie@1: jamie@1: /* Pitch */ jamie@1: /* Pitch via HPS analysis */ jamie@1: int xtract_hps(float *data, int N, void *argv, float *result); jamie@1: jamie@1: #ifdef __cplusplus jamie@1: } jamie@1: #endif jamie@1: jamie@1: #endif jamie@1: jamie@1: jamie@1: