Changeset acd97d1 for src/mathutils.c
 Timestamp:
 Oct 15, 2013, 10:57:38 PM (6 years ago)
 Branches:
 feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
 Children:
 735a739
 Parents:
 69c39ca
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/mathutils.c
r69c39ca racd97d1 368 368 } 369 369 370 smpl_t fvec_quadint (fvec_t * x, uint_t pos) {371 smpl_t s0, s1, s2;372 uint_t x0 = (pos < 1) ? pos : pos  1;373 uint_t x2 = (pos + 1 < x>length) ? pos + 1 : pos;374 if (x0 == pos) return (x>data[pos] <= x>data[x2]) ? pos : x2;375 if (x2 == pos) return (x>data[pos] <= x>data[x0]) ? pos : x0;376 s0 = x>data[x0];377 s1 = x>data[pos];378 s2 = x>data[x2];379 return pos + 0.5 * (s2  s0 ) / (s2  2.* s1 + s0);380 }381 382 370 smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) { 383 371 smpl_t s0, s1, s2; 372 if (pos == 0  pos == x>length  1) return pos; 384 373 uint_t x0 = (pos < 1) ? pos : pos  1; 385 374 uint_t x2 = (pos + 1 < x>length) ? pos + 1 : pos;
Note: See TracChangeset
for help on using the changeset viewer.