[650e39b] | 1 | /* |
---|
[e6a78ea] | 2 | Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org> |
---|
[650e39b] | 3 | |
---|
[e6a78ea] | 4 | This file is part of aubio. |
---|
[650e39b] | 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/>. |
---|
[650e39b] | 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
[7f3ccc5e] | 21 | /** \file |
---|
| 22 | |
---|
| 23 | Pitch detection using a spectral implementation of the YIN algorithm |
---|
| 24 | |
---|
| 25 | This algorithm was derived from the YIN algorithm (see pitchyin.c). In this |
---|
| 26 | implementation, a Fourier transform is used to compute a tapered square |
---|
| 27 | difference function, which allows spectral weighting. Because the difference |
---|
| 28 | function is tapered, the selection of the period is simplified. |
---|
| 29 | |
---|
| 30 | Paul Brossier, ``Automatic annotation of musical audio for interactive |
---|
| 31 | systems'', Chapter 3, Pitch Analysis, PhD thesis, Centre for Digital music, |
---|
[e8830c4] | 32 | Queen Mary University of London, London, UK, 2006. |
---|
[7f3ccc5e] | 33 | |
---|
| 34 | */ |
---|
[650e39b] | 35 | |
---|
| 36 | #ifndef PITCHYINFFT_H |
---|
| 37 | #define PITCHYINFFT_H |
---|
| 38 | |
---|
| 39 | #ifdef __cplusplus |
---|
| 40 | extern "C" { |
---|
| 41 | #endif |
---|
| 42 | |
---|
[7f3ccc5e] | 43 | /** pitch detection object */ |
---|
[650e39b] | 44 | typedef struct _aubio_pitchyinfft_t aubio_pitchyinfft_t; |
---|
| 45 | |
---|
[7f3ccc5e] | 46 | /** execute pitch detection on an input buffer |
---|
| 47 | |
---|
| 48 | \param p pitch detection object as returned by new_aubio_pitchyinfft |
---|
| 49 | \param input input signal window (length as specified at creation time) |
---|
[22d33e2] | 50 | \param output pitch period candidates, in samples |
---|
[7f3ccc5e] | 51 | |
---|
| 52 | */ |
---|
[fddfa64] | 53 | void aubio_pitchyinfft_do (aubio_pitchyinfft_t * p, fvec_t * in, fvec_t * out); |
---|
[7f3ccc5e] | 54 | /** creation of the pitch detection object |
---|
| 55 | |
---|
[3ac7cb0] | 56 | \param buf_size size of the input buffer to analyse |
---|
[7f3ccc5e] | 57 | |
---|
| 58 | */ |
---|
[3ac7cb0] | 59 | aubio_pitchyinfft_t *new_aubio_pitchyinfft (uint_t buf_size); |
---|
[ceed6dc] | 60 | /** deletion of the pitch detection object |
---|
| 61 | |
---|
| 62 | \param p pitch detection object as returned by new_aubio_pitchyinfft() |
---|
| 63 | |
---|
| 64 | */ |
---|
[fddfa64] | 65 | void del_aubio_pitchyinfft (aubio_pitchyinfft_t * p); |
---|
[650e39b] | 66 | |
---|
[22d33e2] | 67 | /** get tolerance parameter for YIN algorithm |
---|
| 68 | |
---|
| 69 | \param o YIN pitch detection object |
---|
| 70 | |
---|
| 71 | \return tolerance parameter for minima selection [default 0.15] |
---|
| 72 | |
---|
| 73 | */ |
---|
| 74 | smpl_t aubio_pitchyinfft_get_tolerance (aubio_pitchyinfft_t * p); |
---|
| 75 | |
---|
| 76 | /** set tolerance parameter for YIN algorithm |
---|
| 77 | |
---|
| 78 | \param o YIN pitch detection object |
---|
| 79 | \param tol tolerance parameter for minima selection [default 0.15] |
---|
| 80 | |
---|
| 81 | */ |
---|
| 82 | uint_t aubio_pitchyinfft_set_tolerance (aubio_pitchyinfft_t * p, smpl_t tol); |
---|
| 83 | |
---|
[650e39b] | 84 | #ifdef __cplusplus |
---|
| 85 | } |
---|
| 86 | #endif |
---|
| 87 | |
---|
| 88 | #endif /*PITCHYINFFT_H*/ |
---|