diff --git a/sdrbase/dsp/inthalfbandfilter.h b/sdrbase/dsp/inthalfbandfilter.h index 4f5b9bef4..ed7c2b67a 100644 --- a/sdrbase/dsp/inthalfbandfilter.h +++ b/sdrbase/dsp/inthalfbandfilter.h @@ -510,6 +510,40 @@ public: m_ptr = HBFIRFilterTraits::hbMod[m_ptr + 2 - 1]; } + void myInterpolate(Sample* sample1, Sample* sample2) + { + m_samples[m_ptr][0] = sample1->real(); + m_samples[m_ptr][1] = sample1->imag(); + + doFIR(sample1); + + m_ptr = HBFIRFilterTraits::hbMod[m_ptr + 2 - 1]; + + m_samples[m_ptr][0] = 0; + m_samples[m_ptr][1] = 0; + + doFIR(sample2); + + m_ptr = HBFIRFilterTraits::hbMod[m_ptr + 2 - 1]; + } + + void myInterpolate(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2) + { + m_samples[m_ptr][0] = *x1; + m_samples[m_ptr][1] = *y1; + + doFIR(x1, y1); + + m_ptr = HBFIRFilterTraits::hbMod[m_ptr + 2 - 1]; + + m_samples[m_ptr][0] = 0; + m_samples[m_ptr][1] = 0; + + doFIR(x2, y2); + + m_ptr = HBFIRFilterTraits::hbMod[m_ptr + 2 - 1]; + } + protected: qint32 m_samples[HBFIRFilterTraits::hbOrder + 1][2]; // Valgrind optim (from qint16) qint16 m_ptr; diff --git a/sdrbase/dsp/inthalfbandfilterdb.h b/sdrbase/dsp/inthalfbandfilterdb.h index 17f86b40d..b81e19d3c 100644 --- a/sdrbase/dsp/inthalfbandfilterdb.h +++ b/sdrbase/dsp/inthalfbandfilterdb.h @@ -402,6 +402,28 @@ public: advancePointer(); } + void myInterpolate(Sample* sample1, Sample* sample2) + { + storeSample((FixReal) sample1->real(), (FixReal) sample1->imag()); + doFIR(sample1); + advancePointer(); + + storeSample(0, 0); + doFIR(sample2); + advancePointer(); + } + + void myInterpolate(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2) + { + storeSample(*x1, *y1); + doFIR(x1, y1); + advancePointer(); + + storeSample(0, 0); + doFIR(x2, y2); + advancePointer(); + } + protected: qint32 m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique int m_ptr; diff --git a/sdrbase/dsp/inthalfbandfiltereo1.h b/sdrbase/dsp/inthalfbandfiltereo1.h index f7385b8aa..4f9f44fba 100644 --- a/sdrbase/dsp/inthalfbandfiltereo1.h +++ b/sdrbase/dsp/inthalfbandfiltereo1.h @@ -405,6 +405,28 @@ public: advancePointer(); } + void myInterpolate(Sample* sample1, Sample* sample2) + { + storeSample((FixReal) sample1->real(), (FixReal) sample1->imag()); + doFIR(sample1); + advancePointer(); + + storeSample(0, 0); + doFIR(sample2); + advancePointer(); + } + + void myInterpolate(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2) + { + storeSample(*x1, *y1); + doFIR(x1, y1); + advancePointer(); + + storeSample(0, 0); + doFIR(x2, y2); + advancePointer(); + } + protected: int32_t m_even[2][HBFIRFilterTraits::hbOrder]; // double buffer technique int32_t m_odd[2][HBFIRFilterTraits::hbOrder]; // double buffer technique diff --git a/sdrbase/dsp/inthalfbandfilterst.h b/sdrbase/dsp/inthalfbandfilterst.h index 1cf117d77..94336a4fd 100644 --- a/sdrbase/dsp/inthalfbandfilterst.h +++ b/sdrbase/dsp/inthalfbandfilterst.h @@ -403,6 +403,28 @@ public: advancePointer(); } + void myInterpolate(Sample* sample1, Sample* sample2) + { + storeSample((FixReal) sample1->real(), (FixReal) sample1->imag()); + doFIR(sample1); + advancePointer(); + + storeSample(0, 0); + doFIR(sample2); + advancePointer(); + } + + void myInterpolate(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2) + { + storeSample(*x1, *y1); + doFIR(x1, y1); + advancePointer(); + + storeSample(0, 0); + doFIR(x2, y2); + advancePointer(); + } + protected: int32_t m_samplesDB[2*HBFilterOrder][2]; // double buffer technique with even/odd amnd I/Q stride int32_t m_samplesAligned[HBFilterOrder][2] __attribute__ ((aligned (16)));