Changeset 6ab6611
- Timestamp:
- Feb 16, 2016, 5:50:19 PM (9 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- d04875c
- Parents:
- 7cdabbe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r7cdabbe r6ab6611 443 443 smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) { 444 444 smpl_t s0, s1, s2; uint_t x0, x2; 445 smpl_t half = .5, two = 2.; 445 446 if (pos == 0 || pos == x->length - 1) return pos; 446 447 x0 = (pos < 1) ? pos : pos - 1; … … 451 452 s1 = x->data[pos]; 452 453 s2 = x->data[x2]; 453 return pos + 0.5 * (s0 - s2 ) / (s0 - 2.* s1 + s2);454 return pos + half * (s0 - s2 ) / (s0 - two * s1 + s2); 454 455 } 455 456
Note: See TracChangeset
for help on using the changeset viewer.