comparison xtract/xtract_scalar.h @ 41:afb9e6fee244

Changes to xtract_inharmonicity - made parameters consistent with other xtractors that use peak spectrum. Fixed memory alloc bug in pd example.
author Jamie Bullock <jamie@postlude.co.uk>
date Mon, 11 Dec 2006 17:57:27 +0000
parents 0ea4d6430cfc
children 84e69b155098
comparison
equal deleted inserted replaced
40:678667039077 41:afb9e6fee244
45 45
46 /** \brief Extract the variance of an input vector 46 /** \brief Extract the variance of an input vector
47 * 47 *
48 * \param *data: a pointer to the first element in an array of floats 48 * \param *data: a pointer to the first element in an array of floats
49 * \param N: the number of elements to be considered 49 * \param N: the number of elements to be considered
50 * \param *argv: a pointer to a value representing the mean of the input vector 50 * \param *argv: a pointer to a float representing the mean of the input vector
51 * \param *result: the variance of N values from the array pointed to by *data 51 * \param *result: the variance of N values from the array pointed to by *data
52 */ 52 */
53 int xtract_variance(float *data, int N, void *argv, float *result); 53 int xtract_variance(float *data, int N, void *argv, float *result);
54 54
55 /** \brief Extract the deviation of an input vector 55 /** \brief Extract the deviation of an input vector
56 * 56 *
57 * \param *data: a pointer to the first element in an array of floats 57 * \param *data: a pointer to the first element in an array of floats
58 * \param N: the number of elements to be considered 58 * \param N: the number of elements to be considered
59 * \param *argv: a pointer to a value representing the variance of the input vector 59 * \param *argv: a pointer to a float representing the variance of the input vector
60 * \param *result: the deviation of N values from the array pointed to by *data 60 * \param *result: the deviation of N values from the array pointed to by *data
61 */ 61 */
62 int xtract_standard_deviation(float *data, int N, void *argv, float *result); 62 int xtract_standard_deviation(float *data, int N, void *argv, float *result);
63 63
64 /** \brief Extract the average deviation of an input vector 64 /** \brief Extract the average deviation of an input vector
65 * 65 *
66 * \param *data: a pointer to the first element in an array of floats 66 * \param *data: a pointer to the first element in an array of floats
67 * \param N: the number of elements to be considered 67 * \param N: the number of elements to be considered
68 * \param *argv: a pointer to a value representing the mean of the input vector 68 * \param *argv: a pointer to a float representing the mean of the input vector
69 * \param *result: the average deviation of N values from the array pointed to by *data 69 * \param *result: the average deviation of N values from the array pointed to by *data
70 */ 70 */
71 int xtract_average_deviation(float *data, int N, void *argv, float *result); 71 int xtract_average_deviation(float *data, int N, void *argv, float *result);
72 72
73 /** \brief Extract the skewness of an input vector 73 /** \brief Extract the skewness of an input vector
74 * 74 *
75 * \param *data: a pointer to the first element in an array of floats 75 * \param *data: a pointer to the first element in an array of floats
76 * \param N: the number of elements to be considered 76 * \param N: the number of elements to be considered
77 * \param *argv: a pointer to an array of values representing the mean and standard deviation of the input vector 77 * \param *argv: a pointer to an array of floats representing the mean and standard deviation of the input vector
78 * \param *result: the skewness of N values from the array pointed to by *data 78 * \param *result: the skewness of N values from the array pointed to by *data
79 */ 79 */
80 int xtract_skewness(float *data, int N, void *argv, float *result); 80 int xtract_skewness(float *data, int N, void *argv, float *result);
81 81
82 /** \brief Extract the kurtosis of an input vector 82 /** \brief Extract the kurtosis of an input vector
86 * \param *argv: a pointer to an array of values representing the mean and standard deviation of the input vector 86 * \param *argv: a pointer to an array of values representing the mean and standard deviation of the input vector
87 * \param *result: the kurtosis of N values from the array pointed to by *data 87 * \param *result: the kurtosis of N values from the array pointed to by *data
88 */ 88 */
89 int xtract_kurtosis(float *data, int N, void *argv, float *result); 89 int xtract_kurtosis(float *data, int N, void *argv, float *result);
90 90
91 /** \brief Extract the kurtosis of an input vector 91 /** \brief Extract the centroid of an input vector
92 * 92 *
93 * \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) 93 * \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)
94 * \param N: the number of elements to be considered 94 * \param N: the number of elements to be considered
95 * \param *argv: a pointer to NULL 95 * \param *argv: a pointer to NULL
96 * \param *result: the centroid of the values pointed to by *data 96 * \param *result: the centroid of the values pointed to by *data
216 */ 216 */
217 int xtract_rms_amplitude(float *data, int N, void *argv, float *result); 217 int xtract_rms_amplitude(float *data, int N, void *argv, float *result);
218 218
219 /** \brief Extract the Inharmonicity of an input vector 219 /** \brief Extract the Inharmonicity of an input vector
220 * 220 *
221 * \param *data: a pointer to the first element in an array of floats representing the amplitudes of the spectral peaks in an audio vector 221 * \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)
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 a multidimensional array containing the fundamental frequency of the input vector in the first element of the first dimension, and the frequencies of the spectral peaks in the second dimension 223 * \param *argv: a pointer to a float representing the fundamental frequency of the input vector.
224 * \param *result: the inharmonicity of N values from the array pointed to by *data 224 * \param *result: the inharmonicity of N values from the array pointed to by *data
225 */ 225 */
226 int xtract_inharmonicity(float *data, int N, void *argv, float *result); 226 int xtract_inharmonicity(float *data, int N, void *argv, float *result);
227 227
228 /** \brief Extract the spectral crest of an input vector using a method described by Peeters (2003) 228 /** \brief Extract the spectral crest of an input vector using a method described by Peeters (2003)