Mercurial > hg > libxtract
diff xtract/xtract_vector.h @ 104:a32738e9d955
- Fixes to descriptors.c where no break statement was given for certain cases is switch conditionals
- Added LPC and LPCC extraction functions. LPC implements Durbin method as described in Rabiner and Juang and implemented in Dr. Dobbs 1994 edition by Jutta Degener
author | Jamie Bullock <jamie@postlude.co.uk> |
---|---|
date | Mon, 24 Dec 2007 13:21:13 +0000 |
parents | ca40a0dc29d6 |
children | f2af1c75e3ed |
line wrap: on
line diff
--- a/xtract/xtract_vector.h Fri Dec 21 11:05:20 2007 +0000 +++ b/xtract/xtract_vector.h Mon Dec 24 13:21:13 2007 +0000 @@ -126,6 +126,35 @@ */ int xtract_harmonic_spectrum(const float *data, const int N, const void *argv, float *result); +/** \brief Extract Linear Predictive Coding Coefficients + * + * Based on algorithm in Rabiner and Juang as implemented by Jutta Degener in Dr. Dobb's Journal December, 1994. + * + * Returns N-1 reflection (PARCOR) coefficients and N-1 LPC coefficients via *result + * + * \param *data: N autocorrelation values e.g the data pointed to by *result from xtract_autocorrelation() + * \param N: the number of autocorrelation values to be considered + * \param *argv: a pointer to NULL + * \param *result: a pointer to an array containing N-1 reflection coefficients and N-1 LPC coefficients. + * + * An array of size 2 * (N - 1) must be allocated, and *result must point to its first element. + */ +int xtract_lpc(const float *data, const int N, const void *argv, float *result); + +/** \brief Extract Linear Predictive Coding Cepstral Coefficients + * + * \param *data: a pointer to the first element in an array of LPC coeffiecients e.g. a pointer to the second half of the array pointed to by *result from xtract_lpc() + * \param N: the number of LPC coefficients to be considered + * \param *argv: a pointer to a float representing the order of the result vector. This must be a whole number. According to Rabiner and Juang the ratio between the number (p) of LPC coefficients and the order (Q) of the LPC cepstrum is given by Q ~ (3/2)p where Q > p. + * \param *result: a pointer to an array containing the resultant LPCC. + * + * An array of size Q, where Q is given by argv[0] must be allocated, and *result must point to its first element. + * + */ +int xtract_lpcc(const float *data, const int N, const void *argv, float *result); + + + /** @} */ #ifdef __cplusplus