aboutsummaryrefslogtreecommitdiff
path: root/xtract/xtract_scalar.h
blob: d0d780b7172ef09ba4afa79a90020e44eee8a32c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* libxtract feature extraction library
 *  
 * Copyright (C) 2006 Jamie Bullock
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.
 */

/* xtract_scalar.h: declares functions that extract a feature as a single value from an input vector */

#ifndef XTRACT_SCALAR
#define XTRACT_SCALAR

#ifdef __cplusplus
extern "C" {
#endif


/* Statistical features */

int xtract_mean(float *data, int N, void *argv, float *result);
/* mean is passed in as arg */
int xtract_variance(float *data, int N, void *argv, float *result);
/* variance is passed in as arg */
int xtract_standard_deviation(float *data, int N, void *argv, float *result);
/* mean is passed in as arg */
int xtract_average_deviation(float *data, int N, void *argv, float *result);
/* mean and standard deviation are passed in as arg */
int xtract_skewness(float *data, int N, void *argv,  float *result);
/* mean and standard deviation are passed in as arg */
int xtract_kurtosis(float *data, int N, void *argv,  float *result);

/* Irregularity */

/* Krimphoff (1994) */
int xtract_irregularity_k(float *data, int N, void *argv, float *result);
/* Jensen (1999) */
int xtract_irregularity_j(float *data, int N, void *argv, float *result);

/* Tristimulus */

/* Pollard and Jansson (1982) */
int xtract_tristimulus_1(float *data, int N, void *argv, float *result);
int xtract_tristimulus_2(float *data, int N, void *argv, float *result);
int xtract_tristimulus_3(float *data, int N, void *argv, float *result);

/* Smoothness */

/*McAdams (1999)*/
int xtract_smoothness(float *data, int N, void *argv, float *result);

/* Spectral Spread */

/* Casagrande 2005 */

int xtract_spread(float *data, int N, void *argv, float *result);

/* Zero crossing rate */

int xtract_zcr(float *data, int N, void *argv, float *result);

/* Rolloff */

/* Bee Suan Ong (2005) */
/* Threshold is the percentile at which the rolloff is determined */

int xtract_rolloff(float *data, int N, void *argv, float *result);

/* Loudness */
/* A set of BARK_BANDS bark coefficients must be passed in, the loudness is calculated approximately according to Moore, Glasberg et al, 1997 */

int xtract_loudness(float *data, int N, void *argv, float *result);

/* Spectral Flatness Measure */
/* Tristan Jehan (2005) */

int xtract_flatness(float *data, int N, void *argv, float *result);

/* Tonality Factor */
/* Tristan Jehan (2005) */

int xtract_tonality(float *data, int N, void *argv, float *result);

/* Noisiness */
/* Tae Hong Park (2000) */

int xtract_noisiness(float *data, int N, void *argv, float *result);

/* RMS amplitude */
/* Tae Hong Park (2000) */

int xtract_rms_amplitude(float *data, int N, void *argv, float *result);

/* Inharmonicity */

int xtract_inharmonicity(float *data, int N, void *argv, float *result);

/* Spectral Crest */
/* Peeters (2003) */
int xtract_crest(float *data, int N, void *argv, float *result);
    
/* Spectral Power */
/* Bee Suan Ong (2005) */
int xtract_power(float *data, int N, void *argv, float *result);
    
/* Odd to even harmonic ratio */

int xtract_odd_even_ratio(float *data, int N, void *argv, float *result);

/* Sharpness */

int xtract_sharpness(float *data, int N, void *argv, float *result);

/* Slope */
int xtract_slope(float *data, int N, void *argv, float *result);

/* F0 */
/*This method takes a guess which can come from taking the ZCR of an autocorrelation function, and then finds the spectral peak that most closely matches the gess */
int xtract_f0(float *data, int N, void *argv, float *result);

/* Pitch */
/* Pitch via HPS analysis */
int xtract_hps(float *data, int N, void *argv, float *result);

#ifdef __cplusplus
}
#endif

#endif