Changeset 5fe5591 for src/tempo


Ignore:
Timestamp:
Mar 8, 2014, 9:37:22 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, 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.