Tx ph.2: restored ancient interpolator

This commit is contained in:
f4exb 2016-10-27 18:05:40 +02:00
parent 63083885be
commit 4618e007de
1 changed files with 23 additions and 1 deletions

View File

@ -35,7 +35,7 @@ public:
return true; 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) bool interpolate(Real *distance, const Complex& next, Complex* result)
{ {
*distance -= 1.0; *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: private:
float* m_taps; float* m_taps;
float* m_alignedTaps; float* m_alignedTaps;