fvec_quadratic_peak_pos method

double fvec_quadratic_peak_pos(
  1. Pointer<fvec_t> x,
  2. int p
)

finds exact peak index by quadratic interpolation

See Quadratic Interpolation of Spectral Peaks, by Julius O. Smith III

\f$ p_{frac} = \frac{1}{2} \frac {xp-1 - xp+1} {xp-1 - 2 xp + xp+1} \in -.5, .5 \f$

\param x vector to get the interpolated peak position from \param p index of the peak in vector x \return \f$ p + p_{frac} \f$ exact peak position of interpolated maximum or minimum

Implementation

double fvec_quadratic_peak_pos(
  ffi.Pointer<fvec_t> x,
  int p,
) {
  return _fvec_quadratic_peak_pos(
    x,
    p,
  );
}