Changeset 2a4ce6d for src/pitch/pitchyinfft.c
- Timestamp:
- Oct 1, 2017, 11:44:42 AM (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:
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitch/pitchyinfft.c
r5b194f0 r2a4ce6d 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.