Changeset 6ab6611 for src/mathutils.c


Ignore:
Timestamp:
Feb 16, 2016, 5:50:19 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

src/mathutils.c: use smpl_t for constants

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r7cdabbe r6ab6611  
    443443smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) {
    444444  smpl_t s0, s1, s2; uint_t x0, x2;
     445  smpl_t half = .5, two = 2.;
    445446  if (pos == 0 || pos == x->length - 1) return pos;
    446447  x0 = (pos < 1) ? pos : pos - 1;
     
    451452  s1 = x->data[pos];
    452453  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);
    454455}
    455456
Note: See TracChangeset for help on using the changeset viewer.