Changeset bfbfafa for src/pitch/pitchyin.c
- Timestamp:
- Oct 3, 2017, 10:31:12 PM (6 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:
- 2e5c52e
- Parents:
- 7b7a58e (diff), 25db68c (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/pitchyin.c
r7b7a58e rbfbfafa 37 37 fvec_t *yin; 38 38 smpl_t tol; 39 smpl_t confidence;39 uint_t peak_pos; 40 40 }; 41 41 … … 68 68 o->yin = new_fvec (bufsize / 2); 69 69 o->tol = 0.15; 70 o->peak_pos = 0; 70 71 return o; 71 72 } … … 157 158 if (tau > 4 && (yin_data[period] < tol) && 158 159 (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; 161 163 } 162 164 } 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); 166 167 } 167 168 168 169 smpl_t 169 170 aubio_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]; 172 172 } 173 173
Note: See TracChangeset
for help on using the changeset viewer.