comparison 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
comparison
equal deleted inserted replaced
103:1cbbe5b5e461 104:a32738e9d955
124 * \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. 124 * \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.
125 * \param *result: a pointer to an array of size N containing N/2 magnitude coefficients and N/2 bin frequencies. 125 * \param *result: a pointer to an array of size N containing N/2 magnitude coefficients and N/2 bin frequencies.
126 */ 126 */
127 int xtract_harmonic_spectrum(const float *data, const int N, const void *argv, float *result); 127 int xtract_harmonic_spectrum(const float *data, const int N, const void *argv, float *result);
128 128
129 /** \brief Extract Linear Predictive Coding Coefficients
130 *
131 * Based on algorithm in Rabiner and Juang as implemented by Jutta Degener in Dr. Dobb's Journal December, 1994.
132 *
133 * Returns N-1 reflection (PARCOR) coefficients and N-1 LPC coefficients via *result
134 *
135 * \param *data: N autocorrelation values e.g the data pointed to by *result from xtract_autocorrelation()
136 * \param N: the number of autocorrelation values to be considered
137 * \param *argv: a pointer to NULL
138 * \param *result: a pointer to an array containing N-1 reflection coefficients and N-1 LPC coefficients.
139 *
140 * An array of size 2 * (N - 1) must be allocated, and *result must point to its first element.
141 */
142 int xtract_lpc(const float *data, const int N, const void *argv, float *result);
143
144 /** \brief Extract Linear Predictive Coding Cepstral Coefficients
145 *
146 * \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()
147 * \param N: the number of LPC coefficients to be considered
148 * \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.
149 * \param *result: a pointer to an array containing the resultant LPCC.
150 *
151 * An array of size Q, where Q is given by argv[0] must be allocated, and *result must point to its first element.
152 *
153 */
154 int xtract_lpcc(const float *data, const int N, const void *argv, float *result);
155
156
157
129 /** @} */ 158 /** @} */
130 159
131 #ifdef __cplusplus 160 #ifdef __cplusplus
132 } 161 }
133 #endif 162 #endif