Changeset acd97d1 for src/mathutils.c


Ignore:
Timestamp:
Oct 15, 2013, 10:57:38 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
735a739
Parents:
69c39ca
Message:

src/mathutils.{c,h}: remove fvec_quadint, use fvec_quadratic_peak_pos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r69c39ca racd97d1  
    368368}
    369369
    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 
    382370smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) {
    383371  smpl_t s0, s1, s2;
     372  if (pos == 0 || pos == x->length - 1) return pos;
    384373  uint_t x0 = (pos < 1) ? pos : pos - 1;
    385374  uint_t x2 = (pos + 1 < x->length) ? pos + 1 : pos;
Note: See TracChangeset for help on using the changeset viewer.