Changeset 9771488 for src/pitchyin.c


Ignore:
Timestamp:
Mar 21, 2006, 7:05:23 PM (18 years ago)
Author:
Paul Brossier <piem@altern.org>
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:
d94f98b
Parents:
1d4fc4a
Message:

add interpolation to yin
add interpolation to yin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitchyin.c

    r1d4fc4a r9771488  
    8989
    9090/* all the above in one */
    91 uint_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t * yin, smpl_t tol){
     91smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t * yin, smpl_t tol){
    9292        uint_t c=0,j,tau = 0;
     93        sint_t period;
    9394        smpl_t tmp = 0., tmp2 = 0.;
    9495        yin->data[c][0] = 1.;
     
    103104                tmp2 += yin->data[c][tau];
    104105                yin->data[c][tau] *= tau/tmp2;
    105                 if((yin->data[c][tau] < tol) &&
    106                                 (yin->data[c][tau-1] < yin->data[c][tau])) {
    107                         return tau-1;
     106                period = tau-3;
     107                if(tau > 4 && (yin->data[c][period] < tol) &&
     108                                (yin->data[c][period] < yin->data[c][period+1])) {
     109                        return vec_quadint_min(yin,period,1)-1;
    108110                }
    109111        }
Note: See TracChangeset for help on using the changeset viewer.