- Timestamp:
- May 17, 2006, 8:16:59 PM (19 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 78fa561
- Parents:
- ba11e53
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitchfcomb.c
rba11e53 r7f3ccc5e 15 15 along with this program; if not, write to the Free Software 16 16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 18 */19 20 /*21 22 This file was taken from the tuneit project, in the file23 tuneit.c -- Detect fundamental frequency of a sound24 see http://delysid.org/tuneit.html25 26 a fast harmonic comb filter algorithm for pitch tracking27 17 28 18 */ -
src/pitchfcomb.h
rba11e53 r7f3ccc5e 18 18 */ 19 19 20 /** \file 21 22 Pitch detection using a fast harmonic comb filter 23 24 This pitch extraction method implements a fast harmonic comb filter to 25 determine the fundamental frequency of a harmonic sound. 26 27 This file was derived from the tuneit project, written by Mario Lang to 28 detect the fundamental frequency of a sound. 29 30 see http://delysid.org/tuneit.html 31 32 */ 33 20 34 #ifndef _PITCHFCOMB_H 21 35 #define _PITCHFCOMB_H … … 25 39 #endif 26 40 41 /** pitch detection object */ 27 42 typedef struct _aubio_pitchfcomb_t aubio_pitchfcomb_t; 28 43 44 /** execute pitch detection on an input buffer 45 46 \param p pitch detection object as returned by new_aubio_pitchfcomb 47 \param input input signal window (length as specified at creation time) 48 49 */ 29 50 smpl_t aubio_pitchfcomb_detect (aubio_pitchfcomb_t *p, fvec_t * input); 51 /** creation of the pitch detection object 52 53 \param bufsize size of the input buffer to analyse 54 \param hopsize step size between two consecutive analysis instant 55 \param samplerate sampling rate of the signal 56 57 */ 30 58 aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t bufsize, uint_t hopsize, uint_t samplerate); 59 /** deletion of the pitch detection object 60 61 \param p pitch detection object as returned by new_aubio_pitchfcomb 62 63 */ 31 64 void del_aubio_pitchfcomb (aubio_pitchfcomb_t *p); 32 65 -
src/pitchmcomb.c
rba11e53 r7f3ccc5e 161 161 vec_alpha_normalise(mag,p->alpha); /* alpha normalisation */ 162 162 /* skipped */ /* low pass filtering */ 163 /** \bug : vec_movind_thres writesout of bounds */163 /** \bug vec_moving_thres may write out of bounds */ 164 164 vec_adapt_thres(mag,tmp,p->win_post,p->win_pre); /* adaptative threshold */ 165 165 vec_add(mag,-p->threshold); /* fixed threshold */ … … 325 325 aubio_pitchmcomb_t * new_aubio_pitchmcomb(uint_t bufsize, uint_t hopsize, uint_t channels, uint_t samplerate) { 326 326 aubio_pitchmcomb_t * p = AUBIO_NEW(aubio_pitchmcomb_t); 327 /* * \bugshould check if size / 8 > post+pre+1 */327 /* bug: should check if size / 8 > post+pre+1 */ 328 328 uint_t i; 329 329 uint_t spec_size; -
src/pitchmcomb.h
rba11e53 r7f3ccc5e 19 19 20 20 /** \file 21 * spectral pitch detection function 22 * 23 * \todo check/fix peak picking 24 */ 21 22 Pitch detection using multiple-comb filter 23 24 This fundamental frequency estimation algorithm implements spectral 25 flattening, multi-comb filtering and peak histogramming. 26 27 This method was designed by Juan P. Bello and described in: 28 29 Juan-Pablo Bello. ``Towards the Automated Analysis of Simple Polyphonic 30 Music''. PhD thesis, Centre for Digital Music, Queen Mary University of 31 London, London, UK, 2003. 32 33 */ 25 34 26 35 #ifndef PITCHMCOMB_H … … 31 40 #endif 32 41 42 /** pitch detection object */ 33 43 typedef struct _aubio_pitchmcomb_t aubio_pitchmcomb_t; 34 44 45 /** execute pitch detection on an input spectral frame 46 47 \param p pitch detection object as returned by new_aubio_pitchmcomb 48 \param fftgrain input signal spectrum as computed by aubio_pvoc_do 49 50 */ 35 51 smpl_t aubio_pitchmcomb_detect(aubio_pitchmcomb_t * p, cvec_t * fftgrain); 36 52 uint_t aubio_pitch_cands(aubio_pitchmcomb_t * p, cvec_t * fftgrain, smpl_t * cands); 53 /** creation of the pitch detection object 54 55 \param bufsize size of the input buffer to analyse 56 \param hopsize step size between two consecutive analysis instant 57 \param channels number of channels to analyse 58 \param samplerate sampling rate of the signal 59 60 */ 37 61 aubio_pitchmcomb_t * new_aubio_pitchmcomb(uint_t bufsize, uint_t hopsize, uint_t channels, uint_t samplerate); 62 /** deletion of the pitch detection object 63 64 \param p pitch detection object as returned by new_aubio_pitchfcomb 65 66 */ 38 67 void del_aubio_pitchmcomb(aubio_pitchmcomb_t *p); 39 68 -
src/pitchyin.h
rba11e53 r7f3ccc5e 17 17 */ 18 18 19 /* This algorithm was developped by A. de Cheveigne and H. Kawahara and 20 * published in: 21 * 22 * de Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency 23 * estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930. 24 * 25 * see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html 26 */ 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 */ 27 32 28 33 #ifndef PITCHYIN_H … … 33 38 #endif 34 39 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 */ 35 46 void aubio_pitchyin_diff(fvec_t * input, fvec_t * yinbuf); 36 47 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 */ 37 53 void aubio_pitchyin_getcum(fvec_t * yinbuf); 38 54 55 /** detect pitch in a YIN function 56 57 \param yinbuf input buffer as computed by aubio_pitchyin_getcum 58 59 */ 39 60 uint_t aubio_pitchyin_getpitch(fvec_t *yinbuf); 40 61 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 */ 41 69 smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t *yinbuf, smpl_t tol); 42 70 -
src/pitchyinfft.c
rba11e53 r7f3ccc5e 16 16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 17 */ 18 19 /* This algorithm was developped by A. de Cheveigne and H. Kawahara and20 * published in:21 *22 * de Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency23 * estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930.24 *25 * see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html26 *27 * This implementation is using an FFT to compute the square difference28 * function, which allows spectral weighting29 *30 */31 18 32 19 #include "aubio_priv.h" … … 139 126 /* 3 point quadratic interpolation */ 140 127 //return vec_quadint_min(yin,tau,1); 141 /* additional check nlikelyoctave doubling in higher frequencies */128 /* additional check for (unlikely) octave doubling in higher frequencies */ 142 129 if (tau>35) { 143 130 return vec_quadint_min(yin,tau,1)+1; -
src/pitchyinfft.h
rba11e53 r7f3ccc5e 17 17 */ 18 18 19 /* This algorithm was developped by A. de Cheveigne and H. Kawahara and 20 * published in: 21 * 22 * de Cheveigné, A., Kawahara, H. (2002) "YIN, a fundamental frequency 23 * estimator for speech and music", J. Acoust. Soc. Am. 111, 1917-1930. 24 * 25 * see http://recherche.ircam.fr/equipes/pcm/pub/people/cheveign.html 26 */ 19 /** \file 20 21 Pitch detection using a spectral implementation of the YIN algorithm 22 23 This algorithm was derived from the YIN algorithm (see pitchyin.c). In this 24 implementation, a Fourier transform is used to compute a tapered square 25 difference function, which allows spectral weighting. Because the difference 26 function is tapered, the selection of the period is simplified. 27 28 Paul Brossier, ``Automatic annotation of musical audio for interactive 29 systems'', Chapter 3, Pitch Analysis, PhD thesis, Centre for Digital music, 30 Queen Mary University of London, London, UK, 2003. 31 32 */ 27 33 28 34 #ifndef PITCHYINFFT_H … … 33 39 #endif 34 40 41 /** pitch detection object */ 35 42 typedef struct _aubio_pitchyinfft_t aubio_pitchyinfft_t; 36 43 44 /** execute pitch detection on an input buffer 45 46 \param p pitch detection object as returned by new_aubio_pitchyinfft 47 \param input input signal window (length as specified at creation time) 48 \param tol tolerance parameter for minima selection [default 0.85] 49 50 */ 37 51 smpl_t aubio_pitchyinfft_detect (aubio_pitchyinfft_t *p, fvec_t * input, smpl_t tol); 52 /** creation of the pitch detection object 53 54 \param bufsize size of the input buffer to analyse 55 56 */ 38 57 aubio_pitchyinfft_t * new_aubio_pitchyinfft (uint_t bufsize); 39 58 void del_aubio_pitchyinfft (aubio_pitchyinfft_t *p);
Note: See TracChangeset
for help on using the changeset viewer.