[96fb8ad] | 1 | /* |
---|
[e6a78ea] | 2 | Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org> |
---|
| 3 | |
---|
| 4 | This file is part of aubio. |
---|
| 5 | |
---|
| 6 | aubio is free software: you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation, either version 3 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | aubio is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
| 18 | |
---|
[96fb8ad] | 19 | */ |
---|
| 20 | |
---|
[6ebcb08] | 21 | /** \file |
---|
| 22 | |
---|
| 23 | Onset detection functions |
---|
| 24 | |
---|
| 25 | All of the following onset detection function take as arguments the FFT of a |
---|
| 26 | windowed signal (as created with aubio_pvoc). They output one smpl_t per |
---|
| 27 | buffer and per channel (stored in a vector of size [channels]x[1]). |
---|
| 28 | |
---|
| 29 | These functions were first adapted from Juan Pablo Bello's code, and now |
---|
| 30 | include further improvements and modifications made within aubio. |
---|
| 31 | |
---|
| 32 | */ |
---|
[96fb8ad] | 33 | |
---|
| 34 | |
---|
| 35 | #ifndef ONSETDETECTION_H |
---|
| 36 | #define ONSETDETECTION_H |
---|
| 37 | |
---|
| 38 | #ifdef __cplusplus |
---|
| 39 | extern "C" { |
---|
| 40 | #endif |
---|
| 41 | |
---|
| 42 | /** onsetdetection structure */ |
---|
[31907fd] | 43 | typedef struct _aubio_specdesc_t aubio_specdesc_t; |
---|
[6ebcb08] | 44 | /** execute onset detection function on a spectral frame |
---|
| 45 | |
---|
| 46 | Generic function to compute onset detection. |
---|
| 47 | |
---|
[31907fd] | 48 | \param o onset detection object as returned by new_aubio_specdesc() |
---|
[6ebcb08] | 49 | \param fftgrain input signal spectrum as computed by aubio_pvoc_do |
---|
| 50 | \param onset output vector (one sample long, to send to the peak picking) |
---|
| 51 | |
---|
| 52 | */ |
---|
[31907fd] | 53 | void aubio_specdesc_do (aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); |
---|
[6ebcb08] | 54 | /** creation of an onset detection object |
---|
| 55 | |
---|
| 56 | \param type onset detection mode |
---|
| 57 | \param size length of the input spectrum frame |
---|
| 58 | \param channels number of input channels |
---|
| 59 | |
---|
| 60 | */ |
---|
[31907fd] | 61 | aubio_specdesc_t * new_aubio_specdesc(char_t * onset_mode, uint_t buf_size, uint_t channels); |
---|
[6ebcb08] | 62 | /** deletion of an onset detection object |
---|
| 63 | |
---|
[31907fd] | 64 | \param o onset detection object as returned by new_aubio_specdesc() |
---|
[6ebcb08] | 65 | |
---|
| 66 | */ |
---|
[31907fd] | 67 | void del_aubio_specdesc(aubio_specdesc_t *o); |
---|
[e9d8cfe] | 68 | |
---|
[96fb8ad] | 69 | #ifdef __cplusplus |
---|
| 70 | } |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | #endif /* ONSETDETECTION_H */ |
---|