comparison xtract/xtract_scalar.h @ 54:9762d7e3d129

Fleshed out function descriptors.
author Jamie Bullock <jamie@postlude.co.uk>
date Thu, 11 Jan 2007 16:37:50 +0000
parents 45c585bb7996
children 4ea1a8838b14
comparison
equal deleted inserted replaced
53:04f536b139a8 54:9762d7e3d129
155 */ 155 */
156 int xtract_spectral_centroid(const float *data, const int N, const void *argv, float *result); 156 int xtract_spectral_centroid(const float *data, const int N, const void *argv, float *result);
157 157
158 /** \brief Calculate the Irregularity of an input vector using a method described by Krimphoff (1994) 158 /** \brief Calculate the Irregularity of an input vector using a method described by Krimphoff (1994)
159 * 159 *
160 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 160 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
161 * \param N: the number of elements to be considered 161 * \param N: the number of elements to be considered
162 * \param *argv: a pointer to NULL 162 * \param *argv: a pointer to NULL
163 * \param *result: the irregularity of N values from the array pointed to by *data 163 * \param *result: the irregularity of N values from the array pointed to by *data
164 */ 164 */
165 int xtract_irregularity_k(const float *data, const int N, const void *argv, float *result); 165 int xtract_irregularity_k(const float *data, const int N, const void *argv, float *result);
166 166
167 /** \brief Calculate the Irregularity of an input vector using a method described by Jensen (1999) 167 /** \brief Calculate the Irregularity of an input vector using a method described by Jensen (1999)
168 * 168 *
169 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 169 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
170 * \param N: the number of elements to be considered 170 * \param N: the number of elements to be considered
171 * \param *argv: a pointer to NULL 171 * \param *argv: a pointer to NULL
172 * \param *result: the irregularity of N values from the array pointed to by *data 172 * \param *result: the irregularity of N values from the array pointed to by *data
173 */ 173 */
174 int xtract_irregularity_j(const float *data, const int N, const void *argv, float *result); 174 int xtract_irregularity_j(const float *data, const int N, const void *argv, float *result);
175 175
176 /** \brief Calculate the Tristimulus of an input vector using a method described by Pollard and Jansson (1982) 176 /** \brief Calculate the Tristimulus of an input vector using a method described by Pollard and Jansson (1982)
177 * 177 *
178 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients of the harmonic spectrum of an audio vector e.g. a pointer to the second half of the array pointed to by *result from xtract_harmonics(). The amplitudes of the peak spectrum (e.g. *result from xtract_peaks()) can be used if one wishes to consider all partials not just harmonics. 178 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients of the harmonic spectrum of an audio vector e.g. a pointer to the first half of the array pointed to by *result from xtract_harmonics(). The amplitudes of the peak spectrum (e.g. *result from xtract_spectral_peaks()) can be used if one wishes to consider all partials not just harmonics.
179 * \param N: the number of elements to be considered 179 * \param N: the number of elements to be considered
180 * \param *argv: a pointer to NULL 180 * \param *argv: a pointer to NULL
181 * \param *result: the tristimulus of N values from the array pointed to by *data 181 * \param *result: the tristimulus of N values from the array pointed to by *data
182 * 182 *
183 * These three functions provide the first, second and third order tristimulus formulae 183 * These three functions provide the first, second and third order tristimulus formulae
187 int xtract_tristimulus_2(const float *data, const int N, const void *argv, float *result); 187 int xtract_tristimulus_2(const float *data, const int N, const void *argv, float *result);
188 int xtract_tristimulus_3(const float *data, const int N, const void *argv, float *result); 188 int xtract_tristimulus_3(const float *data, const int N, const void *argv, float *result);
189 189
190 /** \brief Extract the smoothness of an input vector using a method described by McAdams (1999) 190 /** \brief Extract the smoothness of an input vector using a method described by McAdams (1999)
191 * 191 *
192 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 192 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
193 * \param N: the number of elements to be considered 193 * \param N: the number of elements to be considered
194 * \param *argv: a pointer to the first element of an array of integers containing the lower bound, upper bound, and pre-scaling factor, whereby array data in the range lower < n < upper will be pre-scaled by p before processing. 194 * \param *argv: a pointer to the first element of an array of integers containing the lower bound, upper bound, and pre-scaling factor, whereby array data in the range lower < n < upper will be pre-scaled by p before processing.
195 * \param *result: the smoothness of N values from the array pointed to by *data 195 * \param *result: the smoothness of N values from the array pointed to by *data
196 */ 196 */
197 int xtract_smoothness(const float *data, const int N, const void *argv, float *result); 197 int xtract_smoothness(const float *data, const int N, const void *argv, float *result);
198 198
199 /** \brief Extract the spectral spread of an input vector using a method described by Casagrande(2005) 199 /** \brief Extract the spectral spread of an input vector using a method described by Casagrande(2005)
200 * 200 *
201 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 201 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
202 * \param N: the number of elements to be considered 202 * \param N: the number of elements to be considered
203 * \param *argv: a pointer to NULL 203 * \param *argv: a pointer to NULL
204 * \param *result: the spectral spread of N values from the array pointed to by *data 204 * \param *result: the spectral spread of N values from the array pointed to by *data
205 */ 205 */
206 int xtract_spread(const float *data, const int N, const void *argv, float *result); 206 int xtract_spread(const float *data, const int N, const void *argv, float *result);
216 */ 216 */
217 int xtract_zcr(const float *data, const int N, const void *argv, float *result); 217 int xtract_zcr(const float *data, const int N, const void *argv, float *result);
218 218
219 /** \brief Extract the spectral rolloff of an input vector using a method described by Bee Suan Ong (2005) 219 /** \brief Extract the spectral rolloff of an input vector using a method described by Bee Suan Ong (2005)
220 * 220 *
221 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 221 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
222 * \param N: the number of elements to be considered 222 * \param N: the number of elements to be considered
223 * \param *argv: a pointer to an array containing a floating point value representing the threshold for rolloff, i.e. the percentile at which the rolloff is determined, expressed in the range 0-1.0, and a float representing the sample rate in Hz 223 * \param *argv: a pointer to an array containing a floating point value representing the threshold for rolloff, i.e. the percentile at which the rolloff is determined, expressed in the range 0-1.0, and a float representing the sample rate in Hz
224 * \param *result: the spectral rolloff in Hz of N values from the array pointed to by *data. This is the point in the spectrum below which argv[0] of the energy is distributed. 224 * \param *result: the spectral rolloff in Hz of N values from the array pointed to by *data. This is the point in the spectrum below which argv[0] of the energy is distributed.
225 */ 225 */
226 int xtract_rolloff(const float *data, const int N, const void *argv, float *result); 226 int xtract_rolloff(const float *data, const int N, const void *argv, float *result);
237 */ 237 */
238 int xtract_loudness(const float *data, const int N, const void *argv, float *result); 238 int xtract_loudness(const float *data, const int N, const void *argv, float *result);
239 239
240 /** \brief Extract the spectral flatness measure of an input vector using a method described by Tristan Jehan (2005) 240 /** \brief Extract the spectral flatness measure of an input vector using a method described by Tristan Jehan (2005)
241 * 241 *
242 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 242 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
243 * \param N: the number of elements to be considered 243 * \param N: the number of elements to be considered
244 * \param *argv: a pointer to NULL 244 * \param *argv: a pointer to NULL
245 * \param *result: the spectral flatness of N values from the array pointed to by *data 245 * \param *result: the spectral flatness of N values from the array pointed to by *data
246 */ 246 */
247 int xtract_flatness(const float *data, const int N, const void *argv, float *result); 247 int xtract_flatness(const float *data, const int N, const void *argv, float *result);
256 */ 256 */
257 int xtract_tonality(const float *data, const int N, const void *argv, float *result); 257 int xtract_tonality(const float *data, const int N, const void *argv, float *result);
258 258
259 /** \brief Extract the noisiness of an input vector using a method described by Tae Hong Park (2000) 259 /** \brief Extract the noisiness of an input vector using a method described by Tae Hong Park (2000)
260 * 260 *
261 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 261 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
262 * \param N: the number of elements to be considered 262 * \param N: the number of elements to be considered
263 * \param *argv: a pointer to NULL 263 * \param *argv: a pointer to NULL
264 * \param *result: the noisiness of N values from the array pointed to by *data 264 * \param *result: the noisiness of N values from the array pointed to by *data
265 */ 265 */
266 int xtract_noisiness(const float *data, const int N, const void *argv, float *result); 266 int xtract_noisiness(const float *data, const int N, const void *argv, float *result);
274 */ 274 */
275 int xtract_rms_amplitude(const float *data, const int N, const void *argv, float *result); 275 int xtract_rms_amplitude(const float *data, const int N, const void *argv, float *result);
276 276
277 /** \brief Extract the Inharmonicity of an input vector 277 /** \brief Extract the Inharmonicity of an input vector
278 * 278 *
279 * \param *data: a pointer to the first element in an array of floats represeting a frequency spectrum of size N/2 and a magnitude peak spectrum of size N/2 (This is the output format of xtract_peaks) 279 * \param *data: a pointer to the first element in an array of floats represeting a magnitude peak spectrum of size N/2, and a frequency spectrum of size N/2 (This is the output format of xtract_spectral_peaks())
280 * \param N: the number of elements to be considered 280 * \param N: the number of elements to be considered
281 * \param *argv: a pointer to a float representing the fundamental frequency of the input vector. 281 * \param *argv: a pointer to a float representing the fundamental frequency of the input vector.
282 * \param *result: the inharmonicity of N values from the array pointed to by *data 282 * \param *result: the inharmonicity of N values from the array pointed to by *data
283 */ 283 */
284 int xtract_spectral_inharmonicity(const float *data, const int N, const void *argv, float *result); 284 int xtract_spectral_inharmonicity(const float *data, const int N, const void *argv, float *result);
285 285
286 /** \brief Extract the spectral crest of an input vector using a method described by Peeters (2003) 286 /** \brief Extract the spectral crest of an input vector using a method described by Peeters (2003)
287 * 287 *
288 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 288 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
289 * \param N: the number of elements to be considered 289 * \param N: the number of elements to be considered
290 * \param *argv: a pointer to NULL 290 * \param *argv: a pointer to NULL
291 * \param *result: the spectral crest of N values from the array pointed to by *data 291 * \param *result: the spectral crest of N values from the array pointed to by *data
292 */ 292 */
293 int xtract_crest(const float *data, const int N, const void *argv, float *result); 293 int xtract_crest(const float *data, const int N, const void *argv, float *result);
294 294
295 /** \brief Extract the Spectral Power of an input vector using a method described by Bee Suan Ong (2005) 295 /** \brief Extract the Spectral Power of an input vector using a method described by Bee Suan Ong (2005)
296 * 296 *
297 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 297 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
298 * \param N: the number of elements to be considered 298 * \param N: the number of elements to be considered
299 * \param *argv: a pointer to NULL 299 * \param *argv: a pointer to NULL
300 * \param *result: the spectral power of N values from the array pointed to by *data 300 * \param *result: the spectral power of N values from the array pointed to by *data
301 */ 301 */
302 int xtract_power(const float *data, const int N, const void *argv, float *result); 302 int xtract_power(const float *data, const int N, const void *argv, float *result);
303 303
304 /* Odd to even harmonic ratio */ 304 /* Odd to even harmonic ratio */
305 /** \brief Extract the Odd to even harmonic ratio of an input vector 305 /** \brief Extract the Odd to even harmonic ratio of an input vector
306 * 306 *
307 * \param *data: a pointer to the first element in an array of floats representing the frequencies of the harmonic spectrum of an audio vector. It is sufficient to pass in a pointer to the array pointed to by *result from xtract_harmonics. 307 * \param *data: a pointer to the first element in an array of floats representing the frequencies of the harmonic spectrum of an audio vector. It is sufficient to pass in a pointer to the second half of the array pointed to by *result from xtract_harmonic_spectrum().
308 * \param N: the number of elements to be considered. If using the array pointed to by *result from xtract_harmonics, N should equal half the total array size i.e., just the frequencies of the peaks. 308 * \param N: the number of elements to be considered. If using the array pointed to by *result from xtract_harmonics, N should equal half the total array size i.e., just the frequencies of the peaks.
309 * \param *argv: a pointer to NULL 309 * \param *argv: a pointer to NULL
310 * \param *result: the odd/even harmonic ratio of N values from the array pointed to by *data 310 * \param *result: the odd/even harmonic ratio of N values from the array pointed to by *data
311 */ 311 */
312 int xtract_odd_even_ratio(const float *data, const int N, const void *argv, float *result); 312 int xtract_odd_even_ratio(const float *data, const int N, const void *argv, float *result);
313 313
314 /** \brief Extract the Sharpness of an input vector 314 /** \brief Extract the Sharpness of an input vector
315 * 315 *
316 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 316 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
317 * \param N: the number of elements to be considered 317 * \param N: the number of elements to be considered
318 * \param *argv: a pointer to NULL 318 * \param *argv: a pointer to NULL
319 * \param *result: the Sharpness of N values from the array pointed to by *data 319 * \param *result: the Sharpness of N values from the array pointed to by *data
320 */ 320 */
321 int xtract_sharpness(const float *data, const int N, const void *argv, float *result); 321 int xtract_sharpness(const float *data, const int N, const void *argv, float *result);
322 322
323 /** \brief Extract the Slope of an input vector using a method described by Peeters(2003) 323 /** \brief Extract the Slope of an input vector using a method described by Peeters(2003)
324 * 324 *
325 * \param *data: a pointer to the first element in an array of floats representing a set of BARK_BANDS bark coefficients 325 * \param *data: a pointer to the first element in an array of floats representing the spectrum of an audio vector, (e.g. the array pointed to by *result from xtract_magnitude_spectrum(), xtract_spectral_peaks() or xtract_spectral_harmonics()).
326 * \param N: the number of elements to be considered 326 * \param N: the number of elements to be considered
327 * \param *argv: a pointer to NULL 327 * \param *argv: a pointer to NULL
328 * \param *result: the Slope of N values from the array pointed to by *data 328 * \param *result: the Slope of N values from the array pointed to by *data
329 */ 329 */
330 int xtract_spectral_slope(const float *data, const int N, const void *argv, float *result); 330 int xtract_spectral_slope(const float *data, const int N, const void *argv, float *result);
361 361
362 /** \brief Extract the Pitch of an input vector using Harmonic Product Spectrum (HPS) analysis 362 /** \brief Extract the Pitch of an input vector using Harmonic Product Spectrum (HPS) analysis
363 * 363 *
364 * \warning {This function doesn't work properly} 364 * \warning {This function doesn't work properly}
365 * 365 *
366 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the second half of the array pointed to by *result from xtract_magnitude_spectrum(). 366 * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum().
367 * \param N: the number of elements to be considered 367 * \param N: the number of elements to be considered
368 * \param *argv: a pointer to NULL 368 * \param *argv: a pointer to NULL
369 * \param *result: the pitch of N values from the array pointed to by *data 369 * \param *result: the pitch of N values from the array pointed to by *data
370 */ 370 */
371 int xtract_hps(const float *data, const int N, const void *argv, float *result); 371 int xtract_hps(const float *data, const int N, const void *argv, float *result);