diff options
Diffstat (limited to 'xtract/xtract_vector.h')
-rw-r--r-- | xtract/xtract_vector.h | 77 |
1 files changed, 65 insertions, 12 deletions
diff --git a/xtract/xtract_vector.h b/xtract/xtract_vector.h index 16a6cc3..aa751a3 100644 --- a/xtract/xtract_vector.h +++ b/xtract/xtract_vector.h @@ -27,35 +27,88 @@ extern "C" { #endif -/* Extracts normalized (0-1) frequency domain magnitude spectrum from time domain signal */ +/** \brief Extract normalized (0-1) frequency domain magnitude spectrum from time domain signal + * + * \param *data: a pointer to the first element in an array of floats representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the magnitude spectrum of N values from the array pointed to by *data + */ int xtract_magnitude_spectrum(float *data, int N, void *argv, float *result); -/* Autocorrelation */ +/** \brief Extract autocorrelation from time domain signal using time-domain autocorrelation technique + * + * \param *data: a pointer to the first element in an array of floats representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the autocorrelation of N values from the array pointed to by *data + */ int xtract_autocorrelation(float *data, int N, void *argv, float *result); - +/** \brief Extract autocorrelation from time domain signal using FFT based method + * + * \param *data: a pointer to the first element in an array of floats representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the autocorrelation of N values from the array pointed to by *data + */ int xtract_autocorrelation_fft(float *data, int N, void *argv, float *result); -/* Average Magnitude Difference Function */ +/** \brief Extract Average Magnitude Difference Function from time domain signal + * + * \param *data: a pointer to the first element in an array of floats + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the AMDF of N values from the array pointed to by *data + */ int xtract_amdf(float *data, int N, void *argv, float *result); -/* Average Squared Difference Function */ +/** \brief Extract Average Squared Difference Function from time domain signal + * + * \param *data: a pointer to the first element in an array of floats representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: the ASDF of N values from the array pointed to by *data + */ int xtract_asdf(float *data, int N, void *argv, float *result); -/* MFCC */ -/* Rabiner */ +/** \brief Extract Mel Frequency Cepstral Coefficients based on a method described by Rabiner + * + * \param *data: a pointer to the first element in an array of floats + * \param N: the number of array elements to be considered + * \param *argv: a pointer to a data structure of type xtract_mel_filter, containing n_filters coefficient tables to make up a mel-spaced filterbank + * \param *result: a pointer to an array containing the resultant MFCC + * + * The data structure pointed to by *argv must be obtained by first calling xtract_init_mfcc + */ int xtract_mfcc(float *data, int N, void *argv, float *result); -/* Bark band */ - +/** \brief Extract Bark band coefficients based on a method + * \param *data: a pointer to the first element in an array of floats representing the magnitude spectrum of an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to an array of ints representing the limits of each bark band + * \param *result: a pointer to an array containing resultant bark coefficients + * + * The limits array pointed to by *argv must be obtained by first calling xtract_init_bark + * + */ int xtract_bark_coefficients(float *data, int N, void *argv, float *result); -/* Discrete cosine transform */ +/** \brief Extract the Discrete Cosine transform of a time domain signal + * \param *data: a pointer to the first element in an array of floats representing an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to NULL + * \param *result: a pointer to an array containing resultant dct coefficients + */ int xtract_dct(float *data, int N, void *argv, float *result); -/* Frequency and amplitude of spectral peaks */ -/* Takes peak threshold as percentage below max peak, and sr as argv, returns a pointer to an array of size N, containing N/2 freqs and N/2 amplitudes, amplitudes are on a decibel scale with dbFS = 0 */ +/** \brief Extract the frequency and amplitude of spectral peaks from a of a magnitude spectrum + * \param *data: a pointer to the first element in an array of floats representing the magnitude spectrum of an audio vector + * \param N: the number of array elements to be considered + * \param *argv: a pointer to an array containing peak threshold as percentage below max peak, and sample rate + * \param *result: a pointer to an array of size N, containing N/2 freqs and N/2 amplitudes, amplitudes are on a decibel scale with dbFS = 0 + */ int xtract_peaks(float *data, int N, void *argv, float *result); #ifdef __cplusplus |