LibXtract  0.7.1
xtract_helper.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Jamie Bullock
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to
6  * deal in the Software without restriction, including without limitation the
7  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8  * sell copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20  * IN THE SOFTWARE.
21  *
22  */
23 
26 #ifndef XTRACT_HELPER_H
27 #define XTRACT_HELPER_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #ifdef _MSC_VER
34  #ifndef __cplusplus
35  typedef int bool;
36  #define false 0
37  #define true 1
38  #endif
39 #else
40  #include <stdbool.h>
41 #endif
42 
43 
64 int xtract_windowed(const double *data, const int N, const void *argv, double *result);
65 
78 int xtract_features_from_subframes(const double *data, const int N, const int feature, const void *argv, double *result);
79 
81 int xtract_is_denormal(double const d);
82 
84 bool xtract_is_poweroftwo(unsigned int x);
85 
86 
97  int xtract_smoothed(const double *data, const int N, const void *argv, double *result);
98 
99 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif
107 
108 
109 
int xtract_features_from_subframes(const double *data, const int N, const int feature, const void *argv, double *result)
Divides the array pointed to by *data into two subframes, and applies a given feature to each subfram...
int xtract_windowed(const double *data, const int N, const void *argv, double *result)
Apply a window function to an array of length N.
int xtract_is_denormal(double const d)
Test whether a number is denormal.
int xtract_smoothed(const double *data, const int N, const void *argv, double *result)
Smooth a vector.
bool xtract_is_poweroftwo(unsigned int x)
Test whether a number is a power of two.