Ignore:
Timestamp:
Oct 1, 2017, 11:44:42 AM (7 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
Children:
16c12a1
Parents:
5b194f0 (diff), 3e48568 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'yin_confidence' of https://github.com/emuell/aubio into emuell-yin_confidence

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitchyin.c

    r5b194f0 r2a4ce6d  
    3737  fvec_t *yin;
    3838  smpl_t tol;
    39   smpl_t confidence;
     39  uint_t peak_pos;
    4040};
    4141
     
    6868  o->yin = new_fvec (bufsize / 2);
    6969  o->tol = 0.15;
     70  o->peak_pos = 0;
    7071  return o;
    7172}
     
    157158    if (tau > 4 && (yin_data[period] < tol) &&
    158159        (yin_data[period] < yin_data[period + 1])) {
    159       out->data[0] = fvec_quadratic_peak_pos (yin, period);
    160       goto beach;
     160      o->peak_pos = (uint_t)period;
     161      out->data[0] = fvec_quadratic_peak_pos (yin, o->peak_pos);
     162      return;
    161163    }
    162164  }
    163   out->data[0] = fvec_quadratic_peak_pos (yin, fvec_min_elem (yin));
    164 beach:
    165   return;
     165  o->peak_pos = (uint_t)fvec_min_elem (yin);
     166  out->data[0] = fvec_quadratic_peak_pos (yin, o->peak_pos);
    166167}
    167168
    168169smpl_t
    169170aubio_pitchyin_get_confidence (aubio_pitchyin_t * o) {
    170   o->confidence = 1. - fvec_min (o->yin);
    171   return o->confidence;
     171  return 1. - o->yin->data[o->peak_pos];
    172172}
    173173
Note: See TracChangeset for help on using the changeset viewer.