jamie@1
|
1 /* libxtract feature extraction library
|
jamie@1
|
2 *
|
jamie@1
|
3 * Copyright (C) 2006 Jamie Bullock
|
jamie@1
|
4 *
|
jamie@1
|
5 * This program is free software; you can redistribute it and/or modify
|
jamie@1
|
6 * it under the terms of the GNU General Public License as published by
|
jamie@1
|
7 * the Free Software Foundation; either version 2 of the License, or
|
jamie@1
|
8 * (at your option) any later version.
|
jamie@1
|
9 *
|
jamie@1
|
10 * This program is distributed in the hope that it will be useful,
|
jamie@1
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jamie@1
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jamie@1
|
13 * GNU General Public License for more details.
|
jamie@1
|
14 *
|
jamie@1
|
15 * You should have received a copy of the GNU General Public License
|
jamie@1
|
16 * along with this program; if not, write to the Free Software
|
jamie@1
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
jamie@1
|
18 * USA.
|
jamie@1
|
19 */
|
jamie@1
|
20
|
jamie@1
|
21 /* xtract_scalar.h: declares functions that extract a feature as a single value from an input vector */
|
jamie@1
|
22
|
jamie@1
|
23 #ifndef XTRACT_SCALAR
|
jamie@1
|
24 #define XTRACT_SCALAR
|
jamie@1
|
25
|
jamie@1
|
26 #ifdef __cplusplus
|
jamie@1
|
27 extern "C" {
|
jamie@1
|
28 #endif
|
jamie@1
|
29
|
jamie@1
|
30
|
jamie@1
|
31 /* Statistical features */
|
jamie@1
|
32
|
jamie@1
|
33 int xtract_mean(float *data, int N, void *argv, float *result);
|
jamie@1
|
34 /* mean is passed in as arg */
|
jamie@1
|
35 int xtract_variance(float *data, int N, void *argv, float *result);
|
jamie@1
|
36 /* variance is passed in as arg */
|
jamie@1
|
37 int xtract_standard_deviation(float *data, int N, void *argv, float *result);
|
jamie@1
|
38 /* mean is passed in as arg */
|
jamie@1
|
39 int xtract_average_deviation(float *data, int N, void *argv, float *result);
|
jamie@1
|
40 /* mean and standard deviation are passed in as arg */
|
jamie@1
|
41 int xtract_skewness(float *data, int N, void *argv, float *result);
|
jamie@1
|
42 /* mean and standard deviation are passed in as arg */
|
jamie@1
|
43 int xtract_kurtosis(float *data, int N, void *argv, float *result);
|
jamie@1
|
44
|
jamie@1
|
45 /* Irregularity */
|
jamie@1
|
46
|
jamie@1
|
47 /* Krimphoff (1994) */
|
jamie@1
|
48 int xtract_irregularity_k(float *data, int N, void *argv, float *result);
|
jamie@1
|
49 /* Jensen (1999) */
|
jamie@1
|
50 int xtract_irregularity_j(float *data, int N, void *argv, float *result);
|
jamie@1
|
51
|
jamie@1
|
52 /* Tristimulus */
|
jamie@1
|
53
|
jamie@1
|
54 /* Pollard and Jansson (1982) */
|
jamie@1
|
55 int xtract_tristimulus_1(float *data, int N, void *argv, float *result);
|
jamie@1
|
56 int xtract_tristimulus_2(float *data, int N, void *argv, float *result);
|
jamie@1
|
57 int xtract_tristimulus_3(float *data, int N, void *argv, float *result);
|
jamie@1
|
58
|
jamie@1
|
59 /* Smoothness */
|
jamie@1
|
60
|
jamie@1
|
61 /*McAdams (1999)*/
|
jamie@1
|
62 int xtract_smoothness(float *data, int N, void *argv, float *result);
|
jamie@1
|
63
|
jamie@1
|
64 /* Spectral Spread */
|
jamie@1
|
65
|
jamie@1
|
66 /* Casagrande 2005 */
|
jamie@1
|
67
|
jamie@1
|
68 int xtract_spread(float *data, int N, void *argv, float *result);
|
jamie@1
|
69
|
jamie@1
|
70 /* Zero crossing rate */
|
jamie@1
|
71
|
jamie@1
|
72 int xtract_zcr(float *data, int N, void *argv, float *result);
|
jamie@1
|
73
|
jamie@1
|
74 /* Rolloff */
|
jamie@1
|
75
|
jamie@1
|
76 /* Bee Suan Ong (2005) */
|
jamie@1
|
77 /* Threshold is the percentile at which the rolloff is determined */
|
jamie@1
|
78
|
jamie@1
|
79 int xtract_rolloff(float *data, int N, void *argv, float *result);
|
jamie@1
|
80
|
jamie@1
|
81 /* Loudness */
|
jamie@1
|
82 /* A set of BARK_BANDS bark coefficients must be passed in, the loudness is calculated approximately according to Moore, Glasberg et al, 1997 */
|
jamie@1
|
83
|
jamie@1
|
84 int xtract_loudness(float *data, int N, void *argv, float *result);
|
jamie@1
|
85
|
jamie@1
|
86 /* Spectral Flatness Measure */
|
jamie@1
|
87 /* Tristan Jehan (2005) */
|
jamie@1
|
88
|
jamie@1
|
89 int xtract_flatness(float *data, int N, void *argv, float *result);
|
jamie@1
|
90
|
jamie@1
|
91 /* Tonality Factor */
|
jamie@1
|
92 /* Tristan Jehan (2005) */
|
jamie@1
|
93
|
jamie@1
|
94 int xtract_tonality(float *data, int N, void *argv, float *result);
|
jamie@1
|
95
|
jamie@1
|
96 /* Noisiness */
|
jamie@1
|
97 /* Tae Hong Park (2000) */
|
jamie@1
|
98
|
jamie@1
|
99 int xtract_noisiness(float *data, int N, void *argv, float *result);
|
jamie@1
|
100
|
jamie@1
|
101 /* RMS amplitude */
|
jamie@1
|
102 /* Tae Hong Park (2000) */
|
jamie@1
|
103
|
jamie@1
|
104 int xtract_rms_amplitude(float *data, int N, void *argv, float *result);
|
jamie@1
|
105
|
jamie@1
|
106 /* Inharmonicity */
|
jamie@1
|
107
|
jamie@1
|
108 int xtract_inharmonicity(float *data, int N, void *argv, float *result);
|
jamie@1
|
109
|
jamie@1
|
110 /* Spectral Crest */
|
jamie@1
|
111 /* Peeters (2003) */
|
jamie@1
|
112 int xtract_crest(float *data, int N, void *argv, float *result);
|
jamie@1
|
113
|
jamie@1
|
114 /* Spectral Power */
|
jamie@1
|
115 /* Bee Suan Ong (2005) */
|
jamie@1
|
116 int xtract_power(float *data, int N, void *argv, float *result);
|
jamie@1
|
117
|
jamie@1
|
118 /* Odd to even harmonic ratio */
|
jamie@1
|
119
|
jamie@1
|
120 int xtract_odd_even_ratio(float *data, int N, void *argv, float *result);
|
jamie@1
|
121
|
jamie@1
|
122 /* Sharpness */
|
jamie@1
|
123
|
jamie@1
|
124 int xtract_sharpness(float *data, int N, void *argv, float *result);
|
jamie@1
|
125
|
jamie@1
|
126 /* Slope */
|
jamie@1
|
127 int xtract_slope(float *data, int N, void *argv, float *result);
|
jamie@1
|
128
|
jamie@1
|
129 /* F0 */
|
jamie@1
|
130 /*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 */
|
jamie@1
|
131 int xtract_f0(float *data, int N, void *argv, float *result);
|
jamie@1
|
132
|
jamie@1
|
133 /* Pitch */
|
jamie@1
|
134 /* Pitch via HPS analysis */
|
jamie@1
|
135 int xtract_hps(float *data, int N, void *argv, float *result);
|
jamie@1
|
136
|
jamie@1
|
137 #ifdef __cplusplus
|
jamie@1
|
138 }
|
jamie@1
|
139 #endif
|
jamie@1
|
140
|
jamie@1
|
141 #endif
|
jamie@1
|
142
|
jamie@1
|
143
|
jamie@1
|
144
|