Mercurial > hg > libxtract
comparison xtract/xtract_vector.h @ 114:f5040ed4e555
Added new extraction function: xtract_subbands()
author | Jamie Bullock <jamie@postlude.co.uk> |
---|---|
date | Fri, 15 Feb 2008 15:49:49 +0000 |
parents | 72a9a393d5bd |
children | 859495925633 |
comparison
equal
deleted
inserted
replaced
113:72a9a393d5bd | 114:f5040ed4e555 |
---|---|
156 * An array of size Q, where Q is given by argv[0] must be allocated, and *result must point to its first element. | 156 * An array of size Q, where Q is given by argv[0] must be allocated, and *result must point to its first element. |
157 * | 157 * |
158 */ | 158 */ |
159 int xtract_lpcc(const float *data, const int N, const void *argv, float *result); | 159 int xtract_lpcc(const float *data, const int N, const void *argv, float *result); |
160 | 160 |
161 | 161 /** \brief Extract subbands from a spectrum |
162 | 162 * |
163 * \param *data: a pointer to an array of size N containing N magnitude/power/log magnitude/log power coefficients. (e.g. the first half of the array pointed to by *result from xtract_spectrum(). | |
164 * \param N: the number of elements from the array pointed to by *data to be considered | |
165 * \param *argv: A pointer to an array containing four integers. The first represents the extraction function to applied to each subband e.g. XTRACT_SUM or XTRACT_MEAN, the second represents the number of subbands required, and the third represents the frequency scale to be used for the subband bounds as defined in the enumeration xtract_subband_scales_ (libxtract.h). The fourth integer represent the start point of the subbands as a location in the input array as pointed to by *data (e.g. a value of 5 would start the subband extraction at bin 5) | |
166 * \param *result: A pointer to an array containing the resultant subband values. The calling function is responsible for allocating and freeing memory for *result. xtract_subbands() assumes that at least argv[1] * sizeof(float) bytes have been allocated. If the requested nbands extends the subband range beyond N, then the remaining bands will be set to 0. If the array pointed to by *result has more than argv[1] elements, the superfluous elements will be unchanged. | |
167 * | |
168 * xtract_subbands() divides a spectrum into subbands and applies the function given by argv[0] to the values in each subband to give a 'reduced' representation of the spectrum as *result | |
169 * | |
170 * Specifying XTRACT_OCTAVE_SUBBANDS will extract subbands at each octave from the start bin until argv[1] is reached or N is reached | |
171 * Specifying XTRACT_LINEAR_SUBBANDS will extract argv[1] equal sized subbands between the start bin and N | |
172 * | |
173 * | |
174 * It is assumed that a sensible function will be given in argv[0], and for this function argv will always be NULL. Sensible values for argv[0] are XTRACT_MEAN and XTRACT_SUM, although something like XTRACT_IRREGULARITY_K might yield interesting results. | |
175 * | |
176 */ | |
177 int xtract_subbands(const float *data, const int N, const void *argv, float *result); | |
163 /** @} */ | 178 /** @} */ |
164 | 179 |
165 #ifdef __cplusplus | 180 #ifdef __cplusplus |
166 } | 181 } |
167 #endif | 182 #endif |