1 | /* |
---|
2 | Copyright (C) 2007 Amaury Hazan <ahazan@iua.upf.edu> |
---|
3 | and Paul Brossier <piem@piem.org> |
---|
4 | |
---|
5 | This program is free software; you can redistribute it and/or modify |
---|
6 | it under the terms of the GNU General Public License as published by |
---|
7 | the Free Software Foundation; either version 2 of the License, or |
---|
8 | (at your option) any later version. |
---|
9 | |
---|
10 | This program is distributed in the hope that it will be useful, |
---|
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | GNU General Public License for more details. |
---|
14 | |
---|
15 | You should have received a copy of the GNU General Public License |
---|
16 | along with this program; if not, write to the Free Software |
---|
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
18 | */ |
---|
19 | |
---|
20 | /** \file |
---|
21 | |
---|
22 | Filterbank object |
---|
23 | |
---|
24 | General-purpose spectral filterbank object. Comes with mel-filter initialization function. |
---|
25 | |
---|
26 | */ |
---|
27 | |
---|
28 | #ifndef FILTERBANK_H |
---|
29 | #define FILTERBANK_H |
---|
30 | |
---|
31 | #ifdef __cplusplus |
---|
32 | extern "C" { |
---|
33 | #endif |
---|
34 | |
---|
35 | typedef struct aubio_filterbank_t_ aubio_filterbank_t; |
---|
36 | |
---|
37 | /** create filterbank object |
---|
38 | |
---|
39 | \param win_s size of analysis buffer (and length the FFT transform) |
---|
40 | \param n_filters number of filters to create |
---|
41 | |
---|
42 | */ |
---|
43 | |
---|
44 | aubio_filterbank_t * new_aubio_filterbank(uint_t n_filters, uint_t win_s); |
---|
45 | |
---|
46 | /** filterbank initialization for mel filters |
---|
47 | |
---|
48 | \param nyquist nyquist frequency, i.e. half of the sampling rate |
---|
49 | \param style libxtract style |
---|
50 | \param freqmin lowest filter frequency |
---|
51 | \param freqmax highest filter frequency |
---|
52 | |
---|
53 | */ |
---|
54 | aubio_filterbank_t * new_aubio_filterbank_mfcc(uint_t n_filters, uint_t win_s, smpl_t samplerate, smpl_t freq_min, smpl_t freq_max); |
---|
55 | |
---|
56 | |
---|
57 | /** destroy filterbank object |
---|
58 | |
---|
59 | \param fb filterbank, as returned by new_aubio_filterbank method |
---|
60 | |
---|
61 | */ |
---|
62 | void del_aubio_filterbank(aubio_filterbank_t * fb); |
---|
63 | |
---|
64 | /** compute filterbank |
---|
65 | |
---|
66 | */ |
---|
67 | void aubio_filterbank_do(aubio_filterbank_t * fb, cvec_t * in, fvec_t *out); |
---|
68 | |
---|
69 | #ifdef __cplusplus |
---|
70 | } |
---|
71 | #endif |
---|
72 | |
---|
73 | #endif // FILTERBANK_H |
---|