From 9636bf2fdb2cdb27483b47d9ab6b238a25d374d5 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Sat, 9 Dec 2006 15:21:35 +0000 Subject: Implemented xtract_harmonics --- xtract/xtract_vector.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xtract/xtract_vector.h') diff --git a/xtract/xtract_vector.h b/xtract/xtract_vector.h index d72d051..21cc8a3 100644 --- a/xtract/xtract_vector.h +++ b/xtract/xtract_vector.h @@ -109,7 +109,7 @@ int xtract_asdf(float *data, int N, void *argv, float *result); */ int xtract_bark_coefficients(float *data, int N, void *argv, float *result); -/** \brief Extract the frequency and amplitude of spectral peaks from a of a magnitude spectrum +/** \brief Extract the frequency and amplitude of spectral peaks from 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 @@ -117,6 +117,14 @@ int xtract_bark_coefficients(float *data, int N, void *argv, float *result); */ int xtract_peaks(float *data, int N, void *argv, float *result); +/** \brief Extract the harmonic spectrum of from a of a peak spectrum + * \param *data: a pointer to the first element in an array of floats representing the peak spectrum of an audio vector (e.g. *result from xtract_peaks). It is expected that the first half of the array pointed to by *data will contain frequencies for each peak considered, and the the second half will contain the respective amplitudes + * \param N: the size of the array pointed to by *data + * \param *argv: a pointer to an array containing the fundamental (f0) of the spectrum, and a threshold (t) where 0<=t<=1.0, and t determines the distance from the nearest harmonic number within which a partial can be considered harmonic. + * \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_harmonics(float *data, int N, void *argv, float *result); + /** @} */ #ifdef __cplusplus -- cgit v1.2.3