[88199ce] | 1 | /* |
---|
[06cae6c] | 2 | Copyright (C) 2007-2009 Paul Brossier <piem@aubio.org> |
---|
| 3 | and Amaury Hazan <ahazan@iua.upf.edu> |
---|
| 4 | |
---|
[1c2e186] | 5 | This file is part of aubio. |
---|
[06cae6c] | 6 | |
---|
[1c2e186] | 7 | aubio is free software: you can redistribute it and/or modify |
---|
[06cae6c] | 8 | it under the terms of the GNU General Public License as published by |
---|
| 9 | the Free Software Foundation, either version 3 of the License, or |
---|
| 10 | (at your option) any later version. |
---|
| 11 | |
---|
[1c2e186] | 12 | aubio is distributed in the hope that it will be useful, |
---|
[06cae6c] | 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 |
---|
[1c2e186] | 18 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
[06cae6c] | 19 | |
---|
[88199ce] | 20 | */ |
---|
| 21 | |
---|
[8708556] | 22 | /** \file |
---|
| 23 | |
---|
| 24 | Filterbank object |
---|
| 25 | |
---|
[06cae6c] | 26 | General-purpose spectral filterbank object. |
---|
[8708556] | 27 | |
---|
| 28 | */ |
---|
| 29 | |
---|
[73eaa2e] | 30 | #ifndef FILTERBANK_H |
---|
| 31 | #define FILTERBANK_H |
---|
[88199ce] | 32 | |
---|
[7c6c806d] | 33 | #ifdef __cplusplus |
---|
[3b3b03e] | 34 | extern "C" |
---|
| 35 | { |
---|
[7c6c806d] | 36 | #endif |
---|
| 37 | |
---|
[2d8cffa] | 38 | /** filterbank object */ |
---|
[e6c11e3] | 39 | typedef struct _aubio_filterbank_t aubio_filterbank_t; |
---|
[8708556] | 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 | |
---|
[3b3b03e] | 48 | aubio_filterbank_t *new_aubio_filterbank (uint_t n_filters, uint_t win_s); |
---|
[8708556] | 49 | |
---|
[b276dee] | 50 | /** destroy filterbank object |
---|
| 51 | |
---|
| 52 | \param fb filterbank, as returned by new_aubio_filterbank method |
---|
| 53 | |
---|
| 54 | */ |
---|
[3b3b03e] | 55 | void del_aubio_filterbank (aubio_filterbank_t * fb); |
---|
[b276dee] | 56 | |
---|
| 57 | /** compute filterbank |
---|
| 58 | |
---|
[06cae6c] | 59 | \param fb filterbank containing nfilt x win_s filter coefficients |
---|
| 60 | \param in input spectrum containing chans x win_s spectrum |
---|
| 61 | \param out output vector containing chans x nfilt output values |
---|
| 62 | |
---|
[b276dee] | 63 | */ |
---|
[3b3b03e] | 64 | void aubio_filterbank_do (aubio_filterbank_t * fb, cvec_t * in, fvec_t * out); |
---|
[7c6c806d] | 65 | |
---|
[06cae6c] | 66 | /** return a pointer to the fvec object containing all filter coefficients |
---|
| 67 | |
---|
| 68 | \param f filterbank object to get coefficients from |
---|
[17961b0] | 69 | |
---|
| 70 | */ |
---|
[3b3b03e] | 71 | fvec_t *aubio_filterbank_get_coeffs (aubio_filterbank_t * f); |
---|
[17961b0] | 72 | |
---|
[33916b8] | 73 | /** copy filter coefficients to the filterbank |
---|
| 74 | |
---|
| 75 | \param f filterbank object to get coefficients from |
---|
| 76 | |
---|
| 77 | */ |
---|
| 78 | uint_t aubio_filterbank_set_coeffs (aubio_filterbank_t * f, fvec_t * filters); |
---|
| 79 | |
---|
[7c6c806d] | 80 | #ifdef __cplusplus |
---|
| 81 | } |
---|
| 82 | #endif |
---|
[88199ce] | 83 | |
---|
[3b3b03e] | 84 | #endif // FILTERBANK_H |
---|