[96fb8ad] | 1 | /* |
---|
| 2 | Copyright (C) 2003 Paul Brossier |
---|
| 3 | |
---|
| 4 | This program is free software; you can redistribute it and/or modify |
---|
| 5 | it under the terms of the GNU General Public License as published by |
---|
| 6 | the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | (at your option) any later version. |
---|
| 8 | |
---|
| 9 | This program is distributed in the hope that it will be useful, |
---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | GNU General Public License for more details. |
---|
| 13 | |
---|
| 14 | You should have received a copy of the GNU General Public License |
---|
| 15 | along with this program; if not, write to the Free Software |
---|
| 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 17 | */ |
---|
| 18 | |
---|
[7f3ccc5e] | 19 | /** \file |
---|
| 20 | |
---|
| 21 | Pitch detection using the YIN algorithm |
---|
| 22 | |
---|
| 23 | This algorithm was developped by A. de Cheveigne and H. Kawahara and |
---|
| 24 | published in: |
---|
| 25 | |
---|
| 26 | De Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency |
---|
| 27 | estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930. |
---|
| 28 | |
---|
| 29 | see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html |
---|
| 30 | |
---|
| 31 | */ |
---|
[96fb8ad] | 32 | |
---|
| 33 | #ifndef PITCHYIN_H |
---|
| 34 | #define PITCHYIN_H |
---|
| 35 | |
---|
| 36 | #ifdef __cplusplus |
---|
| 37 | extern "C" { |
---|
| 38 | #endif |
---|
| 39 | |
---|
[2ba3440] | 40 | /** pitch detection object */ |
---|
| 41 | typedef struct _aubio_pitchyin_t aubio_pitchyin_t; |
---|
[7f3ccc5e] | 42 | |
---|
[2ba3440] | 43 | /** creation of the pitch detection object |
---|
| 44 | |
---|
| 45 | \param bufsize size of the input buffer to analyse |
---|
| 46 | |
---|
[7f3ccc5e] | 47 | */ |
---|
[2ba3440] | 48 | aubio_pitchyin_t * new_aubio_pitchyin (uint_t bufsize); |
---|
[96fb8ad] | 49 | |
---|
[2ba3440] | 50 | /** deletion of the pitch detection object |
---|
| 51 | |
---|
| 52 | \param p pitch detection object as returned by new_aubio_pitchyin() |
---|
| 53 | |
---|
| 54 | */ |
---|
| 55 | void del_aubio_pitchyin (aubio_pitchyin_t * o); |
---|
[7f3ccc5e] | 56 | |
---|
[2ba3440] | 57 | /** execute pitch detection on an input buffer |
---|
| 58 | |
---|
| 59 | \param p pitch detection object as returned by new_aubio_pitchyin() |
---|
| 60 | \param input input signal window (length as specified at creation time) |
---|
| 61 | \param tol tolerance parameter for minima selection [default 0.85] |
---|
| 62 | |
---|
[7f3ccc5e] | 63 | */ |
---|
[d9b5009] | 64 | void aubio_pitchyin_do (aubio_pitchyin_t * o, fvec_t * in, fvec_t * out); |
---|
[96fb8ad] | 65 | |
---|
[2ba3440] | 66 | |
---|
| 67 | /** set tolerance parameter for YIN algorithm |
---|
[7f3ccc5e] | 68 | |
---|
[2ba3440] | 69 | \param o YIN pitch detection object |
---|
| 70 | \param tol tolerance parameter for minima selection [default 0.15] |
---|
[7f3ccc5e] | 71 | |
---|
| 72 | */ |
---|
[2ba3440] | 73 | uint_t aubio_pitchyin_set_tolerance (aubio_pitchyin_t *o, smpl_t tol); |
---|
[96fb8ad] | 74 | |
---|
[2ba3440] | 75 | /** get tolerance parameter for YIN algorithm |
---|
[7f3ccc5e] | 76 | |
---|
[2ba3440] | 77 | \param o YIN pitch detection object |
---|
| 78 | \return tolerance parameter for minima selection [default 0.15] |
---|
[7f3ccc5e] | 79 | |
---|
| 80 | */ |
---|
[d9b5009] | 81 | smpl_t aubio_pitchyin_get_tolerance (aubio_pitchyin_t * o); |
---|
[33bf500] | 82 | |
---|
[96fb8ad] | 83 | #ifdef __cplusplus |
---|
| 84 | } |
---|
| 85 | #endif |
---|
| 86 | |
---|
| 87 | #endif /*PITCHYIN_H*/ |
---|