andrew@0: /* andrew@0: Copyright (C) 2003 Paul Brossier andrew@0: andrew@0: This program is free software; you can redistribute it and/or modify andrew@0: it under the terms of the GNU General Public License as published by andrew@0: the Free Software Foundation; either version 2 of the License, or andrew@0: (at your option) any later version. andrew@0: andrew@0: This program is distributed in the hope that it will be useful, andrew@0: but WITHOUT ANY WARRANTY; without even the implied warranty of andrew@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the andrew@0: GNU General Public License for more details. andrew@0: andrew@0: You should have received a copy of the GNU General Public License andrew@0: along with this program; if not, write to the Free Software andrew@0: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. andrew@0: */ andrew@0: andrew@0: /** \file andrew@0: andrew@0: Pitch detection using the YIN algorithm andrew@0: andrew@0: This algorithm was developped by A. de Cheveigne and H. Kawahara and andrew@0: published in: andrew@0: andrew@0: De Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency andrew@0: estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930. andrew@0: andrew@0: see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html andrew@0: andrew@0: */ andrew@0: andrew@0: #ifndef PITCHYIN_H andrew@0: #define PITCHYIN_H andrew@0: andrew@0: #ifdef __cplusplus andrew@0: extern "C" { andrew@0: #endif andrew@0: andrew@0: /** compute difference function andrew@0: andrew@0: \param input input signal andrew@0: \param yinbuf output buffer to store difference function (half shorter than input) andrew@0: andrew@0: */ andrew@0: void aubio_pitchyin_diff(fvec_t * input, fvec_t * yinbuf); andrew@0: andrew@0: /** in place computation of the YIN cumulative normalised function andrew@0: andrew@0: \param yinbuf input signal (a square difference function), also used to store function andrew@0: andrew@0: */ andrew@0: void aubio_pitchyin_getcum(fvec_t * yinbuf); andrew@0: andrew@0: /** detect pitch in a YIN function andrew@0: andrew@0: \param yinbuf input buffer as computed by aubio_pitchyin_getcum andrew@0: andrew@0: */ andrew@0: ba_uint_t aubio_pitchyin_getpitch(fvec_t *yinbuf); andrew@0: andrew@0: /** fast implementation of the YIN algorithm andrew@0: andrew@0: \param input input signal andrew@0: \param yinbuf input buffer used to compute the YIN function andrew@0: \param tol tolerance parameter for minima selection [default 0.15] andrew@0: andrew@0: */ andrew@0: smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t *yinbuf, smpl_t tol); andrew@0: andrew@0: #ifdef __cplusplus andrew@0: } andrew@0: #endif andrew@0: andrew@0: #endif /*PITCHYIN_H*/