Ignore:
Timestamp:
Mar 8, 2014, 9:37:22 PM (10 years ago)
Author:
Paul Brossier <piem@piem.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:
c05d61f
Parents:
7380327
Message:

src/tempo/beattracking.c: improve confidence values by using interpolated peak magnitude and avoiding nan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tempo/beattracking.c

    r7380327 r5fe5591  
    422422{
    423423  if (bt->gp) {
    424     return fvec_max (bt->acfout) / fvec_sum(bt->acfout);
    425   } else {
    426     return 0.;
    427   }
    428 }
     424    smpl_t acf_sum = fvec_sum(bt->acfout);
     425    if (acf_sum != 0.) {
     426      return fvec_quadratic_peak_mag (bt->acfout, bt->gp) / acf_sum;
     427    }
     428  }
     429  return 0.;
     430}
Note: See TracChangeset for help on using the changeset viewer.