Mercurial > hg > libxtract
diff xtract/libxtract.h @ 107:3e648eec95cb
- Added new helper functions: xtract_windowed() and xtract_features_from_subframes()
- Added windowing functions (window.c)
author | Jamie Bullock <jamie@postlude.co.uk> |
---|---|
date | Fri, 28 Dec 2007 19:34:51 +0000 |
parents | 3693573a07fa |
children | e6354b0137d3 |
line wrap: on
line diff
--- a/xtract/libxtract.h Thu Dec 27 20:37:15 2007 +0000 +++ b/xtract/libxtract.h Fri Dec 28 19:34:51 2007 +0000 @@ -60,6 +60,7 @@ #include "xtract_delta.h" #include "xtract_types.h" #include "xtract_macros.h" +#include "xtract_helper.h" /** \defgroup libxtract API * @@ -67,7 +68,7 @@ * @{ */ -#define XTRACT_FEATURES 57 +#define XTRACT_FEATURES 58 /** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */ enum xtract_features_ { @@ -127,7 +128,9 @@ XTRACT_DCT, XTRACT_HARMONIC_SPECTRUM, XTRACT_LPC, - XTRACT_LPCC + XTRACT_LPCC, + /* Helper functions */ + XTRACT_WINDOWED }; /** \brief Enumeration of feature initialisation functions */ @@ -197,6 +200,19 @@ XTRACT_TRUE } xtract_bool_t; +/** \brief Window types */ +enum xtract_window_types_ { + XTRACT_GAUSS, + XTRACT_HAMMING, + XTRACT_HANN, + XTRACT_BARTLETT, + XTRACT_TRIANGULAR, + XTRACT_BARTLETT_HANN, + XTRACT_BLACKMAN, + XTRACT_KAISER, + XTRACT_BLACKMAN_HARRIS +}; + /** \brief Enumeration of vector format types*/ typedef enum xtract_vector_ { /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */ @@ -359,6 +375,21 @@ */ int xtract_init_fft(int N, int feature_name); +/** \brief Make a window of a given type and return a pointer to it + * + * \param N: the size of the window + * \param type: the type of the window as given in the enumeration window_types_ + * + */ +float *xtract_init_window(const int N, const int type); + +/** \brief Free a window as allocated by xtract_make_window() + * + * \param *window: a pointer to an array of floats as allocated by xtract_make_window() + * + */ +void xtract_free_window(float *window); + /* \brief A function to build an array of function descriptors */ void *xtract_make_descriptors();