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