aboutsummaryrefslogtreecommitdiff
path: root/xtract/xtract_vector.h
blob: 16a6cc3424a440b150107f35ada8cd77b0f9c678 (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
/* 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 vector from an input vector */

#ifndef XTRACT_VECTOR
#define XTRACT_VECTOR

#ifdef __cplusplus
extern "C" {
#endif

/* Extracts normalized (0-1) frequency domain magnitude spectrum from time domain signal */
int xtract_magnitude_spectrum(float *data, int N, void *argv, float *result);


/* Autocorrelation */
int xtract_autocorrelation(float *data, int N, void *argv, float *result);


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

/* Average Magnitude Difference Function */
int xtract_amdf(float *data, int N, void *argv, float *result);
    
/* Average Squared Difference Function */
int xtract_asdf(float *data, int N, void *argv, float *result);
    
/* MFCC */
/* Rabiner */
int xtract_mfcc(float *data, int N, void *argv, float *result);

/* Bark band */

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

/* Discrete cosine transform */
int xtract_dct(float *data, int N, void *argv, float *result);

/* Frequency and amplitude of spectral peaks */
/* Takes peak threshold as percentage below max peak, and sr as argv, returns a pointer to an array of size N, containing N/2 freqs and N/2 amplitudes, amplitudes are on a decibel scale with dbFS = 0 */
int xtract_peaks(float *data, int N, void *argv, float *result);
    
#ifdef __cplusplus
}
#endif

#endif