2 Copyright (C) 2003-2017 Paul Brossier <piem@aubio.org>
4 This file is part of aubio.
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.
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.
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/>.
23 Pitch detection using YIN algorithm (fast implementation)
25 This algorithm was developed by A. de Cheveigne and H. Kawahara and
28 De Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency
29 estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930.
31 This implementation compute the autocorrelation function using time domain
32 convolution computed in the spectral domain.
34 see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html
35 http://recherche.ircam.fr/equipes/pcm/cheveign/ps/2002_JASA_YIN_proof.pdf
39 #ifndef AUBIO_PITCHYINFAST_H
40 #define AUBIO_PITCHYINFAST_H
46 /** pitch detection object */
47 typedef struct _aubio_pitchyinfast_t aubio_pitchyinfast_t;
49 /** creation of the pitch detection object
51 \param buf_size size of the input buffer to analyse
54 aubio_pitchyinfast_t *new_aubio_pitchyinfast (uint_t buf_size);
56 /** deletion of the pitch detection object
58 \param o pitch detection object as returned by new_aubio_pitchyin()
61 void del_aubio_pitchyinfast (aubio_pitchyinfast_t * o);
63 /** execute pitch detection an input buffer
65 \param o pitch detection object as returned by new_aubio_pitchyin()
66 \param samples_in input signal vector (length as specified at creation time)
67 \param cands_out pitch period candidates, in samples
70 void aubio_pitchyinfast_do (aubio_pitchyinfast_t * o, const fvec_t * samples_in, fvec_t * cands_out);
73 /** set tolerance parameter for YIN algorithm
75 \param o YIN pitch detection object
76 \param tol tolerance parameter for minima selection [default 0.15]
79 uint_t aubio_pitchyinfast_set_tolerance (aubio_pitchyinfast_t * o, smpl_t tol);
81 /** get tolerance parameter for YIN algorithm
83 \param o YIN pitch detection object
84 \return tolerance parameter for minima selection [default 0.15]
87 smpl_t aubio_pitchyinfast_get_tolerance (aubio_pitchyinfast_t * o);
89 /** get current confidence of YIN algorithm
91 \param o YIN pitch detection object
92 \return confidence parameter
95 smpl_t aubio_pitchyinfast_get_confidence (aubio_pitchyinfast_t * o);
101 #endif /* AUBIO_PITCHYINFAST_H */