[96fb8ad] | 1 | /* |
---|
[e6a78ea] | 2 | Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org> |
---|
[96fb8ad] | 3 | |
---|
[e6a78ea] | 4 | This file is part of aubio. |
---|
[96fb8ad] | 5 | |
---|
[e6a78ea] | 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/>. |
---|
[96fb8ad] | 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
[7f3ccc5e] | 21 | /** \file |
---|
| 22 | |
---|
| 23 | Pitch detection using the YIN algorithm |
---|
| 24 | |
---|
| 25 | This algorithm was developped by A. de Cheveigne and H. Kawahara and |
---|
| 26 | published in: |
---|
| 27 | |
---|
| 28 | De Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency |
---|
| 29 | estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930. |
---|
| 30 | |
---|
| 31 | see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html |
---|
| 32 | |
---|
| 33 | */ |
---|
[96fb8ad] | 34 | |
---|
| 35 | #ifndef PITCHYIN_H |
---|
| 36 | #define PITCHYIN_H |
---|
| 37 | |
---|
| 38 | #ifdef __cplusplus |
---|
| 39 | extern "C" { |
---|
| 40 | #endif |
---|
| 41 | |
---|
[2ba3440] | 42 | /** pitch detection object */ |
---|
| 43 | typedef struct _aubio_pitchyin_t aubio_pitchyin_t; |
---|
[7f3ccc5e] | 44 | |
---|
[2ba3440] | 45 | /** creation of the pitch detection object |
---|
| 46 | |
---|
[3ac7cb0] | 47 | \param buf_size size of the input buffer to analyse |
---|
[2ba3440] | 48 | |
---|
[7f3ccc5e] | 49 | */ |
---|
[3ac7cb0] | 50 | aubio_pitchyin_t *new_aubio_pitchyin (uint_t buf_size); |
---|
[96fb8ad] | 51 | |
---|
[2ba3440] | 52 | /** deletion of the pitch detection object |
---|
| 53 | |
---|
| 54 | \param p pitch detection object as returned by new_aubio_pitchyin() |
---|
| 55 | |
---|
| 56 | */ |
---|
| 57 | void del_aubio_pitchyin (aubio_pitchyin_t * o); |
---|
[7f3ccc5e] | 58 | |
---|
[2ba3440] | 59 | /** execute pitch detection on an input buffer |
---|
| 60 | |
---|
| 61 | \param p pitch detection object as returned by new_aubio_pitchyin() |
---|
| 62 | \param input input signal window (length as specified at creation time) |
---|
| 63 | \param tol tolerance parameter for minima selection [default 0.85] |
---|
| 64 | |
---|
[7f3ccc5e] | 65 | */ |
---|
[d9b5009] | 66 | void aubio_pitchyin_do (aubio_pitchyin_t * o, fvec_t * in, fvec_t * out); |
---|
[96fb8ad] | 67 | |
---|
[2ba3440] | 68 | |
---|
| 69 | /** set tolerance parameter for YIN algorithm |
---|
[7f3ccc5e] | 70 | |
---|
[2ba3440] | 71 | \param o YIN pitch detection object |
---|
| 72 | \param tol tolerance parameter for minima selection [default 0.15] |
---|
[7f3ccc5e] | 73 | |
---|
| 74 | */ |
---|
[fddfa64] | 75 | uint_t aubio_pitchyin_set_tolerance (aubio_pitchyin_t * o, smpl_t tol); |
---|
[96fb8ad] | 76 | |
---|
[2ba3440] | 77 | /** get tolerance parameter for YIN algorithm |
---|
[7f3ccc5e] | 78 | |
---|
[2ba3440] | 79 | \param o YIN pitch detection object |
---|
| 80 | \return tolerance parameter for minima selection [default 0.15] |
---|
[7f3ccc5e] | 81 | |
---|
| 82 | */ |
---|
[d9b5009] | 83 | smpl_t aubio_pitchyin_get_tolerance (aubio_pitchyin_t * o); |
---|
[33bf500] | 84 | |
---|
[96fb8ad] | 85 | #ifdef __cplusplus |
---|
| 86 | } |
---|
| 87 | #endif |
---|
| 88 | |
---|
| 89 | #endif /*PITCHYIN_H*/ |
---|