comparison 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
comparison
equal deleted inserted replaced
106:3693573a07fa 107:3e648eec95cb
58 #include "xtract_scalar.h" 58 #include "xtract_scalar.h"
59 #include "xtract_vector.h" 59 #include "xtract_vector.h"
60 #include "xtract_delta.h" 60 #include "xtract_delta.h"
61 #include "xtract_types.h" 61 #include "xtract_types.h"
62 #include "xtract_macros.h" 62 #include "xtract_macros.h"
63 #include "xtract_helper.h"
63 64
64 /** \defgroup libxtract API 65 /** \defgroup libxtract API
65 * 66 *
66 * Defines a very simple API that provides access to the functions in the library 67 * Defines a very simple API that provides access to the functions in the library
67 * @{ 68 * @{
68 */ 69 */
69 70
70 #define XTRACT_FEATURES 57 71 #define XTRACT_FEATURES 58
71 72
72 /** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */ 73 /** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */
73 enum xtract_features_ { 74 enum xtract_features_ {
74 XTRACT_MEAN, 75 XTRACT_MEAN,
75 XTRACT_VARIANCE, 76 XTRACT_VARIANCE,
125 XTRACT_AUTOCORRELATION_FFT, 126 XTRACT_AUTOCORRELATION_FFT,
126 XTRACT_MFCC, 127 XTRACT_MFCC,
127 XTRACT_DCT, 128 XTRACT_DCT,
128 XTRACT_HARMONIC_SPECTRUM, 129 XTRACT_HARMONIC_SPECTRUM,
129 XTRACT_LPC, 130 XTRACT_LPC,
130 XTRACT_LPCC 131 XTRACT_LPCC,
132 /* Helper functions */
133 XTRACT_WINDOWED
131 }; 134 };
132 135
133 /** \brief Enumeration of feature initialisation functions */ 136 /** \brief Enumeration of feature initialisation functions */
134 enum xtract_feature_init_ { 137 enum xtract_feature_init_ {
135 XTRACT_INIT_MFCC = 100, 138 XTRACT_INIT_MFCC = 100,
194 /** \brief Boolean */ 197 /** \brief Boolean */
195 typedef enum { 198 typedef enum {
196 XTRACT_FALSE, 199 XTRACT_FALSE,
197 XTRACT_TRUE 200 XTRACT_TRUE
198 } xtract_bool_t; 201 } xtract_bool_t;
202
203 /** \brief Window types */
204 enum xtract_window_types_ {
205 XTRACT_GAUSS,
206 XTRACT_HAMMING,
207 XTRACT_HANN,
208 XTRACT_BARTLETT,
209 XTRACT_TRIANGULAR,
210 XTRACT_BARTLETT_HANN,
211 XTRACT_BLACKMAN,
212 XTRACT_KAISER,
213 XTRACT_BLACKMAN_HARRIS
214 };
199 215
200 /** \brief Enumeration of vector format types*/ 216 /** \brief Enumeration of vector format types*/
201 typedef enum xtract_vector_ { 217 typedef enum xtract_vector_ {
202 /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */ 218 /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */
203 XTRACT_SPECTRAL, 219 XTRACT_SPECTRAL,
357 * e.g. XTRACT_DCT 373 * e.g. XTRACT_DCT
358 * 374 *
359 */ 375 */
360 int xtract_init_fft(int N, int feature_name); 376 int xtract_init_fft(int N, int feature_name);
361 377
378 /** \brief Make a window of a given type and return a pointer to it
379 *
380 * \param N: the size of the window
381 * \param type: the type of the window as given in the enumeration window_types_
382 *
383 */
384 float *xtract_init_window(const int N, const int type);
385
386 /** \brief Free a window as allocated by xtract_make_window()
387 *
388 * \param *window: a pointer to an array of floats as allocated by xtract_make_window()
389 *
390 */
391 void xtract_free_window(float *window);
392
362 /* \brief A function to build an array of function descriptors */ 393 /* \brief A function to build an array of function descriptors */
363 void *xtract_make_descriptors(); 394 void *xtract_make_descriptors();
364 395
365 /* \brief A function to free an array of function descriptors */ 396 /* \brief A function to free an array of function descriptors */
366 int xtract_free_descriptors(void *fd); 397 int xtract_free_descriptors(void *fd);