Changeset 3e48568 for src/pitch/pitchyinfft.c
- Timestamp:
- Jul 30, 2017, 10:53:43 PM (7 years ago)
- 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:
- 2a4ce6d
- Parents:
- 34ce715
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitch/pitchyinfft.c
r34ce715 r3e48568 37 37 fvec_t *yinfft; /**< Yin function */ 38 38 smpl_t tol; /**< Yin tolerance */ 39 smpl_t confidence; /**< confidence*/39 uint_t peak_pos; /**< currently selected peak pos*/ 40 40 uint_t short_period; /** shortest period under which to check for octave error */ 41 41 }; … … 68 68 p->yinfft = new_fvec (bufsize / 2 + 1); 69 69 p->tol = 0.85; 70 p->peak_pos = 0; 70 71 p->win = new_aubio_window ("hanningz", bufsize); 71 72 p->weight = new_fvec (bufsize / 2 + 1); … … 162 163 halfperiod = FLOOR (tau / 2 + .5); 163 164 if (yin->data[halfperiod] < p->tol) 164 output->data[0] = fvec_quadratic_peak_pos (yin, halfperiod);165 p->peak_pos = halfperiod; 165 166 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); 167 169 } 168 170 } else { 171 p->peak_pos = 0; 169 172 output->data[0] = 0.; 170 173 } … … 186 189 smpl_t 187 190 aubio_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]; 190 192 } 191 193
Note: See TracChangeset
for help on using the changeset viewer.