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/pitchyinfft.c

    r5b194f0 r2a4ce6d  
    3737  fvec_t *yinfft;     /**< Yin function */
    3838  smpl_t tol;         /**< Yin tolerance */
    39   smpl_t confidence;  /**< confidence */
     39  uint_t peak_pos;    /**< currently selected peak pos*/
    4040  uint_t short_period; /** shortest period under which to check for octave error */
    4141};
     
    6868  p->yinfft = new_fvec (bufsize / 2 + 1);
    6969  p->tol = 0.85;
     70  p->peak_pos = 0;
    7071  p->win = new_aubio_window ("hanningz", bufsize);
    7172  p->weight = new_fvec (bufsize / 2 + 1);
     
    162163      halfperiod = FLOOR (tau / 2 + .5);
    163164      if (yin->data[halfperiod] < p->tol)
    164         output->data[0] = fvec_quadratic_peak_pos (yin, halfperiod);
     165        p->peak_pos = halfperiod;
    165166      else
    166         output->data[0] = fvec_quadratic_peak_pos (yin, tau);
     167        p->peak_pos = tau;
     168      output->data[0] = fvec_quadratic_peak_pos (yin, p->peak_pos);
    167169    }
    168170  } else {
     171    p->peak_pos = 0;
    169172    output->data[0] = 0.;
    170173  }
     
    186189smpl_t
    187190aubio_pitchyinfft_get_confidence (aubio_pitchyinfft_t * o) {
    188   o->confidence = 1. - fvec_min (o->yinfft);
    189   return o->confidence;
     191  return 1. - o->yinfft->data[o->peak_pos];
    190192}
    191193
Note: See TracChangeset for help on using the changeset viewer.