[88199ce] | 1 | /* |
---|
| 2 | Copyright (C) 2007 Amaury Hazan |
---|
[8708556] | 3 | adapted to aubio from LibXtract |
---|
[88199ce] | 4 | http://libxtract.sourceforge.net/ |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | This program is free software; you can redistribute it and/or modify |
---|
| 8 | it under the terms of the GNU General Public License as published by |
---|
| 9 | the Free Software Foundation; either version 2 of the License, or |
---|
| 10 | (at your option) any later version. |
---|
| 11 | |
---|
| 12 | This program is distributed in the hope that it will be useful, |
---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | GNU General Public License for more details. |
---|
| 16 | |
---|
| 17 | You should have received a copy of the GNU General Public License |
---|
| 18 | along with this program; if not, write to the Free Software |
---|
| 19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 20 | */ |
---|
| 21 | |
---|
[8708556] | 22 | /** \file |
---|
| 23 | |
---|
| 24 | Filterbank object |
---|
| 25 | |
---|
| 26 | General-purpose spectral filterbank object. Comes with mel-filter initialization function. |
---|
| 27 | |
---|
| 28 | */ |
---|
| 29 | |
---|
[88199ce] | 30 | #ifndef AUBIOFILTERBANK_H |
---|
[fe28ff3] | 31 | #define AUBIOFILTERBANK_H |
---|
[88199ce] | 32 | |
---|
[7c6c806d] | 33 | #ifdef __cplusplus |
---|
| 34 | extern "C" { |
---|
| 35 | #endif |
---|
| 36 | |
---|
[88199ce] | 37 | |
---|
| 38 | |
---|
[8708556] | 39 | typedef struct aubio_filterbank_t_ aubio_filterbank_t; |
---|
| 40 | |
---|
| 41 | /** create filterbank object |
---|
| 42 | |
---|
| 43 | \param win_s size of analysis buffer (and length the FFT transform) |
---|
| 44 | \param n_filters number of filters to create |
---|
| 45 | |
---|
| 46 | */ |
---|
| 47 | |
---|
| 48 | aubio_filterbank_t * new_aubio_filterbank(uint_t n_filters, uint_t win_s); |
---|
| 49 | |
---|
| 50 | /** destroy filterbank object |
---|
| 51 | |
---|
| 52 | \param fb filterbank, as returned by new_aubio_filterbank method |
---|
| 53 | |
---|
| 54 | */ |
---|
| 55 | void del_aubio_filterbank(aubio_filterbank_t * fb); |
---|
| 56 | |
---|
| 57 | /** filterbank initialization for mel filters |
---|
| 58 | |
---|
| 59 | \param fb filterbank, as returned by new_aubio_filterbank method |
---|
| 60 | \param nyquist nyquist frequency, i.e. half of the sampling rate |
---|
| 61 | \param style libxtract style |
---|
| 62 | \param freqmin lowest filter frequency |
---|
| 63 | \param freqmax highest filter frequency |
---|
| 64 | |
---|
| 65 | */ |
---|
| 66 | void aubio_filterbank_mfcc_init(aubio_filterbank_t * fb, smpl_t nyquist, int style, smpl_t freq_min, smpl_t freq_max); |
---|
[88199ce] | 67 | |
---|
| 68 | // Initialization |
---|
| 69 | |
---|
| 70 | /** \brief A function to initialise a mel filter bank |
---|
| 71 | * |
---|
| 72 | * It is up to the caller to pass in a pointer to memory allocated for freq_bands arrays of length N. This function populates these arrays with magnitude coefficients representing the mel filterbank on a linear scale |
---|
| 73 | */ |
---|
[7c6c806d] | 74 | int aubio_mfcc_init(int N, smpl_t nyquist, int style, smpl_t freq_min, smpl_t freq_max, int freq_bands, smpl_t ** fft_tables); |
---|
| 75 | |
---|
| 76 | #ifdef __cplusplus |
---|
| 77 | } |
---|
| 78 | #endif |
---|
[88199ce] | 79 | |
---|
[fe28ff3] | 80 | #endif |
---|