Changeset 9499eefb for src/mathutils.h


Ignore:
Timestamp:
Apr 8, 2013, 5:19:10 PM (11 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:
69d642a
Parents:
002563f
Message:

src/mathutils.{c,h}: add fvec_quadratic_peak_pos, a fixed replacement for fvec_quadint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.h

    r002563f r9499eefb  
    236236smpl_t fvec_quadint (fvec_t * x, uint_t pos);
    237237
     238/** finds exact peak index by quadratic interpolation
     239
     240  See [Quadratic Interpolation of Spectral
     241  Peaks](https://ccrma.stanford.edu/~jos/sasp/Quadratic_Peak_Interpolation.html),
     242  by Julius O. Smith III
     243
     244  \f$ p_{frac} = \frac{1}{2} \frac {x[p-1] - x[p+1]} {x[p-1] - 2 x[p] + x[p+1]} \in [ -.5, .5] \f$
     245
     246  \param x vector to get the interpolated peak position from
     247  \param p index of the peak in vector `x`
     248  \return \f$ p + p_{frac} \f$ exact peak position of interpolated maximum or minimum
     249
     250*/
     251smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t p);
     252
    238253/** Quadratic interpolation using Lagrange polynomial.
    239254 
Note: See TracChangeset for help on using the changeset viewer.