[88199ce] | 1 | /* |
---|
[73eaa2e] | 2 | Copyright (C) 2007 Amaury Hazan <ahazan@iua.upf.edu> |
---|
| 3 | and Paul Brossier <piem@piem.org> |
---|
[88199ce] | 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 | |
---|
[8708556] | 20 | /** \file |
---|
| 21 | |
---|
| 22 | Filterbank object |
---|
| 23 | |
---|
| 24 | General-purpose spectral filterbank object. Comes with mel-filter initialization function. |
---|
| 25 | |
---|
| 26 | */ |
---|
| 27 | |
---|
[73eaa2e] | 28 | #ifndef FILTERBANK_H |
---|
| 29 | #define FILTERBANK_H |
---|
[88199ce] | 30 | |
---|
[7c6c806d] | 31 | #ifdef __cplusplus |
---|
| 32 | extern "C" { |
---|
| 33 | #endif |
---|
| 34 | |
---|
[2d8cffa] | 35 | /** filterbank object */ |
---|
[8708556] | 36 | typedef struct aubio_filterbank_t_ aubio_filterbank_t; |
---|
| 37 | |
---|
| 38 | /** create filterbank object |
---|
| 39 | |
---|
| 40 | \param win_s size of analysis buffer (and length the FFT transform) |
---|
| 41 | \param n_filters number of filters to create |
---|
| 42 | |
---|
| 43 | */ |
---|
| 44 | |
---|
| 45 | aubio_filterbank_t * new_aubio_filterbank(uint_t n_filters, uint_t win_s); |
---|
| 46 | |
---|
| 47 | /** filterbank initialization for mel filters |
---|
| 48 | |
---|
[ef1c3b7] | 49 | |
---|
| 50 | \param n_filters number of filters |
---|
| 51 | \param win_s window size |
---|
| 52 | \param samplerate |
---|
| 53 | \param freq_min lowest filter frequency |
---|
| 54 | \param freq_max highest filter frequency |
---|
[8708556] | 55 | |
---|
| 56 | */ |
---|
[f72ceeb] | 57 | aubio_filterbank_t * new_aubio_filterbank_mfcc(uint_t n_filters, uint_t win_s, uint_t samplerate, smpl_t freq_min, smpl_t freq_max); |
---|
[88199ce] | 58 | |
---|
[b276dee] | 59 | /** destroy filterbank object |
---|
| 60 | |
---|
| 61 | \param fb filterbank, as returned by new_aubio_filterbank method |
---|
| 62 | |
---|
| 63 | */ |
---|
| 64 | void del_aubio_filterbank(aubio_filterbank_t * fb); |
---|
| 65 | |
---|
| 66 | /** compute filterbank |
---|
| 67 | |
---|
| 68 | */ |
---|
| 69 | void aubio_filterbank_do(aubio_filterbank_t * fb, cvec_t * in, fvec_t *out); |
---|
[7c6c806d] | 70 | |
---|
[17961b0] | 71 | /** return the vector containing the filter coefficients of one channel |
---|
| 72 | |
---|
| 73 | */ |
---|
| 74 | fvec_t * aubio_filterbank_getchannel(aubio_filterbank_t * f, uint_t channel); |
---|
| 75 | |
---|
[7c6c806d] | 76 | #ifdef __cplusplus |
---|
| 77 | } |
---|
| 78 | #endif |
---|
[88199ce] | 79 | |
---|
[73eaa2e] | 80 | #endif // FILTERBANK_H |
---|