comparison xtract/xtract_scalar.h @ 59:8fd7088c8ff6

Various minor fixes
author Jamie Bullock <jamie@postlude.co.uk>
date Mon, 12 Feb 2007 17:11:31 +0000
parents 450712b21565
children afb298ce1b4d
comparison
equal deleted inserted replaced
58:3936f8492cab 59:8fd7088c8ff6
100 /** \brief Extract the variance of an input spectrum 100 /** \brief Extract the variance of an input spectrum
101 * 101 *
102 * \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()). 102 * \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()).
103 * \param N: the number of elements to be considered 103 * \param N: the number of elements to be considered
104 * \param N: the size of the array pointed to by *data 104 * \param N: the size of the array pointed to by *data
105 * \param *argv: a pointer to a float representing the mean of the input spectrum 105 * \param *argv: a pointer to a float representing the spectral mean of the input spectrum
106 * \param *result: the variance of the spectrum pointed to by *data 106 * \param *result: the variance of the spectrum pointed to by *data
107 */ 107 */
108 int xtract_spectral_variance(const float *data, const int N, const void *argv, float *result); 108 int xtract_spectral_variance(const float *data, const int N, const void *argv, float *result);
109 109
110 /** \brief Extract the deviation of an input spectrum 110 /** \brief Extract the deviation of an input spectrum
111 * 111 *
112 * \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()). 112 * \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()).
113 * \param N: the size of the array pointed to by *data 113 * \param N: the size of the array pointed to by *data
114 * \param *argv: a pointer to a float representing the variance of the input spectrum 114 * \param *argv: a pointer to a float representing the spectral variance of the input spectrum
115 * \param *result: the deviation of the spectrum pointed to by *data 115 * \param *result: the deviation of the spectrum pointed to by *data
116 */ 116 */
117 int xtract_spectral_standard_deviation(const float *data, const int N, const void *argv, float *result); 117 int xtract_spectral_standard_deviation(const float *data, const int N, const void *argv, float *result);
118 118
119 /** \brief Extract the average deviation of an input spectrum 119 /** \brief Extract the average deviation of an input spectrum
120 * 120 *
121 * \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()). 121 * \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()).
122 * \param N: the size of the array pointed to by *data 122 * \param N: the size of the array pointed to by *data
123 * \param *argv: a pointer to a float representing the mean of the input spectrum 123 * \param *argv: a pointer to a float representing the spectral mean of the input spectrum
124 * \param *result: the average deviation of the spectrum pointed to by *data 124 * \param *result: the average deviation of the spectrum pointed to by *data
125 */ 125 */
126 int xtract_spectral_average_deviation(const float *data, const int N, const void *argv, float *result); 126 int xtract_spectral_average_deviation(const float *data, const int N, const void *argv, float *result);
127 127
128 /** \brief Extract the skewness of an input spectrum 128 /** \brief Extract the skewness of an input spectrum
129 * 129 *
130 * \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()). 130 * \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()).
131 * \param N: the size of the array pointed to by *data 131 * \param N: the size of the array pointed to by *data
132 * \param *argv: a pointer to an array of floats representing the mean and standard deviation of the input spectrum 132 * \param *argv: a pointer to an array of floats representing the spectral mean and spectral standard deviation of the input spectrum
133 * \param *result: the skewness of the spectrum pointed to by *data 133 * \param *result: the skewness of the spectrum pointed to by *data
134 */ 134 */
135 int xtract_spectral_skewness(const float *data, const int N, const void *argv, float *result); 135 int xtract_spectral_skewness(const float *data, const int N, const void *argv, float *result);
136 136
137 /** \brief Extract the kurtosis of an input spectrum 137 /** \brief Extract the kurtosis of an input spectrum
138 * 138 *
139 * \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()). 139 * \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()).
140 * \param N: the size of the array pointed to by *data 140 * \param N: the size of the array pointed to by *data
141 * \param *argv: a pointer to an array of values representing the mean and standard deviation of the input spectrum 141 * \param *argv: a pointer to an array of values representing the spectral mean and spectral standard deviation of the input spectrum
142 * \param *result: the kurtosis of the spectrum pointed to by *data 142 * \param *result: the kurtosis of the spectrum pointed to by *data
143 */ 143 */
144 int xtract_spectral_kurtosis(const float *data, const int N, const void *argv, float *result); 144 int xtract_spectral_kurtosis(const float *data, const int N, const void *argv, float *result);
145 145
146 /** \brief Extract the centroid of an input vector 146 /** \brief Extract the centroid of an input vector
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 second half of the array pointed to by *result from xtract_harmonic_spectrum(). 307 * \param *data: a pointer to the first element in an array of floats representing the amplitudes of the harmonic spectrum of an audio vector. It is sufficient to pass in a pointer to the first 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 amplitudes of the peaks.
309 * \param *argv: a pointer to a float representing the fundamental frequency of the input vector. 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
391 * 391 *
392 * This function wraps xtract_f0, but provides the frequency of the lowest partial in the peak spectrum if f0 can't be found. 392 * This function wraps xtract_f0, but provides the frequency of the lowest partial in the peak spectrum if f0 can't be found.
393 * 393 *
394 */ 394 */
395 int xtract_failsafe_f0(const float *data, const int N, const void *argv, float *result); 395 int xtract_failsafe_f0(const float *data, const int N, const void *argv, float *result);
396
397 /** \brief Extract the number of non-zero elements in an input vector
398 *
399 * \param *data: a pointer to the first element in an array of floats
400 * \param N: the number of elements to be considered
401 * \param *argv: not used
402 * \param *result: the number of non-zero elements in the array pointed to by *data
403 *
404 */
405 int xtract_nonzero_count(const float *data, const int N, const void *argv, float *result);
396 406
397 /** @} */ 407 /** @} */
398 408
399 #ifdef __cplusplus 409 #ifdef __cplusplus
400 } 410 }