aboutsummaryrefslogtreecommitdiff
path: root/xtract
diff options
context:
space:
mode:
authorJamie Bullock <jamie@postlude.co.uk>2006-10-08 15:31:40 +0000
committerJamie Bullock <jamie@postlude.co.uk>2006-10-08 15:31:40 +0000
commit9bcdb2f6cb48da938975f618e36ebd54f67766cb (patch)
tree77df7ce218d046107be383e5cca45e979eee362e /xtract
parent2260b6a200016010fa9704dd3024d2c28b4fee74 (diff)
downloadLibXtract-9bcdb2f6cb48da938975f618e36ebd54f67766cb.tar.gz
LibXtract-9bcdb2f6cb48da938975f618e36ebd54f67766cb.tar.bz2
LibXtract-9bcdb2f6cb48da938975f618e36ebd54f67766cb.zip
Added spectral centroid
Diffstat (limited to 'xtract')
-rw-r--r--xtract/libxtract.h3
-rw-r--r--xtract/xtract_scalar.h9
2 files changed, 11 insertions, 1 deletions
diff --git a/xtract/libxtract.h b/xtract/libxtract.h
index f1da9c1..c9e43d2 100644
--- a/xtract/libxtract.h
+++ b/xtract/libxtract.h
@@ -38,7 +38,7 @@ extern "C" {
#include "xtract_types.h"
#include "xtract_macros.h"
-#define XTRACT_FEATURES 42
+#define XTRACT_FEATURES 43
#define LOG_LIMIT 10e-10
#define VERY_BIG_NUMBER 2e10
#define SR_LIMIT 192000
@@ -52,6 +52,7 @@ enum features_ {
AVERAGE_DEVIATION,
SKEWNESS,
KURTOSIS,
+ CENTROID,
IRREGULARITY_K,
IRREGULARITY_J,
TRISTIMULUS_1,
diff --git a/xtract/xtract_scalar.h b/xtract/xtract_scalar.h
index 6ddea98..bea7298 100644
--- a/xtract/xtract_scalar.h
+++ b/xtract/xtract_scalar.h
@@ -82,6 +82,15 @@ int xtract_skewness(float *data, int N, void *argv, float *result);
*/
int xtract_kurtosis(float *data, int N, void *argv, float *result);
+/** \brief Extract the kurtosis of an input vector
+ *
+ * \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)
+ * \param N: the number of elements to be considered
+ * \param *argv: a pointer to NULL
+ * \param *result: the centroid of the values pointed to by *data
+ */
+int xtract_centroid(float *data, int N, void *argv, float *result);
+
/** \brief Calculate the Irregularity of an input vector using a method described by Krimphoff (1994)
*
* \param *data: a pointer to the first element in an array of floats representing the magnitude spectrum of an audio vector