diff --git a/sdrbase/dsp/interpolator.h b/sdrbase/dsp/interpolator.h index 1ce9da83d..3021d11c1 100644 --- a/sdrbase/dsp/interpolator.h +++ b/sdrbase/dsp/interpolator.h @@ -35,7 +35,7 @@ public: return true; } - // interpolation works nearly the same way + // interpolation works nearly the same way // TODO: remove when original is used bool interpolate(Real *distance, const Complex& next, Complex* result) { *distance -= 1.0; @@ -54,6 +54,28 @@ public: } } + // original interpolator + bool interpolate(Real* distance, const Complex& next, bool* consumed, Complex* result) + { + while(*distance >= 1.0) + { + if(!(*consumed)) + { + advanceFilter(next); + *distance -= 1.0; + *consumed = true; + } + else + { + return false; + } + } + + doInterpolate((int)floor(*distance * (Real)m_phaseSteps), result); + + return true; + } + private: float* m_taps; float* m_alignedTaps;