[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 | |
---|
[7f3ccc5e] | 40 | /** compute difference function |
---|
| 41 | |
---|
| 42 | \param input input signal |
---|
| 43 | \param yinbuf output buffer to store difference function (half shorter than input) |
---|
| 44 | |
---|
| 45 | */ |
---|
[30cbd419] | 46 | void aubio_pitchyin_diff(fvec_t * input, fvec_t * yinbuf); |
---|
[96fb8ad] | 47 | |
---|
[7f3ccc5e] | 48 | /** in place computation of the YIN cumulative normalised function |
---|
| 49 | |
---|
| 50 | \param yinbuf input signal (a square difference function), also used to store function |
---|
| 51 | |
---|
| 52 | */ |
---|
[30cbd419] | 53 | void aubio_pitchyin_getcum(fvec_t * yinbuf); |
---|
[96fb8ad] | 54 | |
---|
[7f3ccc5e] | 55 | /** detect pitch in a YIN function |
---|
| 56 | |
---|
| 57 | \param yinbuf input buffer as computed by aubio_pitchyin_getcum |
---|
| 58 | |
---|
| 59 | */ |
---|
[30cbd419] | 60 | uint_t aubio_pitchyin_getpitch(fvec_t *yinbuf); |
---|
[96fb8ad] | 61 | |
---|
[7f3ccc5e] | 62 | /** fast implementation of the YIN algorithm |
---|
| 63 | |
---|
| 64 | \param input input signal |
---|
| 65 | \param yinbuf input buffer used to compute the YIN function |
---|
| 66 | \param tol tolerance parameter for minima selection [default 0.15] |
---|
| 67 | |
---|
| 68 | */ |
---|
[9771488] | 69 | smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t *yinbuf, smpl_t tol); |
---|
[33bf500] | 70 | |
---|
[96fb8ad] | 71 | #ifdef __cplusplus |
---|
| 72 | } |
---|
| 73 | #endif |
---|
| 74 | |
---|
| 75 | #endif /*PITCHYIN_H*/ |
---|