diff options
Diffstat (limited to 'xtract')
-rw-r--r-- | xtract/libxtract.h | 8 | ||||
-rw-r--r-- | xtract/xtract_macros.h | 2 | ||||
-rw-r--r-- | xtract/xtract_scalar.h | 15 |
3 files changed, 19 insertions, 6 deletions
diff --git a/xtract/libxtract.h b/xtract/libxtract.h index 0e4f254..921eb4d 100644 --- a/xtract/libxtract.h +++ b/xtract/libxtract.h @@ -29,7 +29,7 @@ extern "C" { * \file libxtract.h: main header file and API definition */ -#define VERSION "0.1" +#define VERSION "0.11" #include "xtract_scalar.h" @@ -38,8 +38,9 @@ extern "C" { #include "xtract_types.h" #include "xtract_macros.h" -#define XTRACT_FEATURES 40 +#define XTRACT_FEATURES 41 #define LOG_LIMIT 10e-10 +#define VERY_BIG_NUMBER 2e10 #define SR_LIMIT 192000 #define BARK_BANDS 26 @@ -71,8 +72,9 @@ enum features_ { ODD_EVEN_RATIO, SHARPNESS, SLOPE, - F0, + LOWEST_MATCH, HPS, + F0, MAGNITUDE_SPECTRUM, AUTOCORRELATION, AUTOCORRELATION_FFT, diff --git a/xtract/xtract_macros.h b/xtract/xtract_macros.h index 4aebf59..7cce4c0 100644 --- a/xtract/xtract_macros.h +++ b/xtract/xtract_macros.h @@ -29,6 +29,8 @@ extern "C" { #endif +#include <stdio.h> + #define SQ(a) ((a) * (a)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) diff --git a/xtract/xtract_scalar.h b/xtract/xtract_scalar.h index 46b4549..6ddea98 100644 --- a/xtract/xtract_scalar.h +++ b/xtract/xtract_scalar.h @@ -256,15 +256,15 @@ int xtract_sharpness(float *data, int N, void *argv, float *result); */ int xtract_slope(float *data, int N, void *argv, float *result); -/** \brief Extract the value of the first partial in an input vector +/** \brief Extract the value of the first partial in an input vector that closely matches a certain 'guess' * * \param *data: a pointer to the first element in an array of floats that represents the frequencies of the spectral peaks of an audio vector * \param N: the number of elements to be considered - * \param *argv: a pointer to a float value representing the approximate F0 + * \param *argv: a pointer to a float value representing the guess * \param *result: the F0 of N values from the array pointed to by *data * * 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 */ -int xtract_f0(float *data, int N, void *argv, float *result); +int xtract_lowest_match(float *data, int N, void *argv, float *result); /** \brief Extract the Pitch of an input vector using Harmonic Product Spectrum (HPS) analysis * @@ -275,6 +275,15 @@ int xtract_f0(float *data, int N, void *argv, float *result); */ int xtract_hps(float *data, int N, void *argv, float *result); +/** \brief Extract the fundamental frequency of an input vector + * + * \param *data: a pointer to the first element in an array of floats representing an audio vector + * \param N: the number of elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the pitch of N values from the array pointed to by *data + */ +int xtract_f0(float *data, int N, void *argv, float *result); + #ifdef __cplusplus } #endif |