diff --git a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp index b1df37d39..550cc0b46 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp @@ -335,6 +335,7 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc << " m_bandwidth: " << settings.m_bandwidth << " m_devSampleRate: " << settings.m_devSampleRate << " m_log2Interp: " << settings.m_log2Interp + << " m_fcPos: " << settings.m_fcPos << " m_biasT: " << settings.m_biasT << " m_lnaExt: " << settings.m_lnaExt << " m_vgaGain: " << settings.m_vgaGain @@ -434,6 +435,13 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc forwardChange = true; } + if ((m_settings.m_fcPos != settings.m_fcPos) || force) + { + if (m_hackRFThread != 0) { + m_hackRFThread->setFcPos((int) settings.m_fcPos); + } + } + if ((m_settings.m_vgaGain != settings.m_vgaGain) || force) { reverseAPIKeys.append("vgaGain"); diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp index d45f3da7d..0ff146bfa 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp @@ -298,6 +298,12 @@ void HackRFOutputGui::on_interp_currentIndexChanged(int index) sendSettings(); } +void HackRFOutputGui::on_fcPos_currentIndexChanged(int index) +{ + m_settings.m_fcPos = (HackRFOutputSettings::fcPos_t) (index < 0 ? 0 : index > 2 ? 2 : index); + sendSettings(); +} + void HackRFOutputGui::on_txvga_valueChanged(int value) { if ((value < 0) || (value > 47)) diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputgui.h b/plugins/samplesink/hackrfoutput/hackrfoutputgui.h index 921efc1c2..46d49d65c 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputgui.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutputgui.h @@ -89,6 +89,7 @@ private slots: void on_LOppm_valueChanged(int value); void on_biasT_stateChanged(int state); void on_interp_currentIndexChanged(int index); + void on_fcPos_currentIndexChanged(int index); void on_lnaExt_stateChanged(int state); void on_bbFilter_currentIndexChanged(int index); void on_txvga_valueChanged(int value); diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputgui.ui b/plugins/samplesink/hackrfoutput/hackrfoutputgui.ui index 858dd7c71..01fdecd4a 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputgui.ui +++ b/plugins/samplesink/hackrfoutput/hackrfoutputgui.ui @@ -349,6 +349,41 @@ + + + + Fc + + + + + + + + 50 + 16777215 + + + + Relative position of device center frequency + + + + Inf + + + + + Sup + + + + + Cen + + + + diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputsettings.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputsettings.cpp index 427b1075e..ee6aa53b9 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputsettings.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputsettings.cpp @@ -31,6 +31,7 @@ void HackRFOutputSettings::resetToDefaults() m_LOppmTenths = 0; m_biasT = false; m_log2Interp = 0; + m_fcPos = FC_POS_CENTER; m_lnaExt = false; m_vgaGain = 22; m_bandwidth = 1750000; @@ -46,6 +47,7 @@ QByteArray HackRFOutputSettings::serialize() const SimpleSerializer s(1); s.writeS32(1, m_LOppmTenths); + s.writeS32(2, (int) m_fcPos); s.writeBool(3, m_biasT); s.writeU32(4, m_log2Interp); s.writeBool(5, m_lnaExt); @@ -73,8 +75,11 @@ bool HackRFOutputSettings::deserialize(const QByteArray& data) if (d.getVersion() == 1) { uint32_t uintval; + int32_t intval; d.readS32(1, &m_LOppmTenths, 0); + d.readS32(2, &intval, 2); + m_fcPos = (fcPos_t) (intval < 0 ? 0 : intval > 2 ? 2 : intval); d.readBool(3, &m_biasT, false); d.readU32(4, &m_log2Interp, 0); d.readBool(5, &m_lnaExt, false); diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputsettings.h b/plugins/samplesink/hackrfoutput/hackrfoutputsettings.h index 29d32368b..59fe435d2 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputsettings.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutputsettings.h @@ -21,11 +21,18 @@ #include struct HackRFOutputSettings { + typedef enum { + FC_POS_INFRA = 0, + FC_POS_SUPRA, + FC_POS_CENTER + } fcPos_t; + quint64 m_centerFrequency; qint32 m_LOppmTenths; quint32 m_bandwidth; quint32 m_vgaGain; quint32 m_log2Interp; + fcPos_t m_fcPos; quint64 m_devSampleRate; bool m_biasT; bool m_lnaExt; diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp index 4ed07ec3f..b4a00145e 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp @@ -58,6 +58,11 @@ void HackRFOutputThread::setLog2Interpolation(unsigned int log2Interp) m_log2Interp = log2Interp; } +void HackRFOutputThread::setFcPos(int fcPos) +{ + m_fcPos = fcPos; +} + void HackRFOutputThread::run() { hackrf_error rc; @@ -121,28 +126,83 @@ void HackRFOutputThread::callback(qint8* buf, qint32 len) } else { - switch (m_log2Interp) + if (m_fcPos == 0) // Infra + { + switch (m_log2Interp) + { + case 1: + m_interpolators.interpolate2_inf(&beginRead, buf, len); + break; + case 2: + m_interpolators.interpolate4_inf(&beginRead, buf, len); + break; + // case 3: + // m_interpolators.interpolate8_cen(&beginRead, buf, len); + // break; + // case 4: + // m_interpolators.interpolate16_cen(&beginRead, buf, len); + // break; + // case 5: + // m_interpolators.interpolate32_cen(&beginRead, buf, len); + // break; + // case 6: + // m_interpolators.interpolate64_cen(&beginRead, buf, len); + // break; + default: + break; + } + } + else if (m_fcPos == 1) // Supra { - case 1: - m_interpolators.interpolate2_cen(&beginRead, buf, len); - break; - case 2: - m_interpolators.interpolate4_cen(&beginRead, buf, len); - break; - case 3: - m_interpolators.interpolate8_cen(&beginRead, buf, len); - break; - case 4: - m_interpolators.interpolate16_cen(&beginRead, buf, len); - break; - case 5: - m_interpolators.interpolate32_cen(&beginRead, buf, len); - break; - case 6: - m_interpolators.interpolate64_cen(&beginRead, buf, len); - break; - default: - break; + switch (m_log2Interp) + { + case 1: + m_interpolators.interpolate2_sup(&beginRead, buf, len); + break; + case 2: + m_interpolators.interpolate4_sup(&beginRead, buf, len); + break; + // case 3: + // m_interpolators.interpolate8_cen(&beginRead, buf, len); + // break; + // case 4: + // m_interpolators.interpolate16_cen(&beginRead, buf, len); + // break; + // case 5: + // m_interpolators.interpolate32_cen(&beginRead, buf, len); + // break; + // case 6: + // m_interpolators.interpolate64_cen(&beginRead, buf, len); + // break; + default: + break; + } + } + else if (m_fcPos == 2) // Center + { + switch (m_log2Interp) + { + case 1: + m_interpolators.interpolate2_cen(&beginRead, buf, len); + break; + case 2: + m_interpolators.interpolate4_cen(&beginRead, buf, len); + break; + case 3: + m_interpolators.interpolate8_cen(&beginRead, buf, len); + break; + case 4: + m_interpolators.interpolate16_cen(&beginRead, buf, len); + break; + case 5: + m_interpolators.interpolate32_cen(&beginRead, buf, len); + break; + case 6: + m_interpolators.interpolate64_cen(&beginRead, buf, len); + break; + default: + break; + } } } } diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h index f44139a0e..d892f5ea9 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h @@ -37,6 +37,7 @@ public: void startWork(); void stopWork(); void setLog2Interpolation(unsigned int log2_interp); + void setFcPos(int fcPos); private: QMutex m_startWaitMutex; @@ -48,6 +49,7 @@ private: SampleSourceFifo* m_sampleFifo; unsigned int m_log2Interp; + int m_fcPos; Interpolators m_interpolators; diff --git a/sdrbase/dsp/interpolators.h b/sdrbase/dsp/interpolators.h index 0e31f4e95..f84e5e53e 100644 --- a/sdrbase/dsp/interpolators.h +++ b/sdrbase/dsp/interpolators.h @@ -106,11 +106,16 @@ class Interpolators public: // interleaved I/Q input buffer void interpolate1(SampleVector::iterator* it, T* buf, qint32 len); - void interpolate2_cen(SampleVector::iterator* it, T* buf, qint32 len); + + void interpolate2_cen(SampleVector::iterator* it, T* buf, qint32 len); void interpolate2_inf(SampleVector::iterator* it, T* buf, qint32 len); void interpolate2_sup(SampleVector::iterator* it, T* buf, qint32 len); - void interpolate4_cen(SampleVector::iterator* it, T* buf, qint32 len); - void interpolate8_cen(SampleVector::iterator* it, T* buf, qint32 len); + + void interpolate4_cen(SampleVector::iterator* it, T* buf, qint32 len); + void interpolate4_inf(SampleVector::iterator* it, T* buf, qint32 len); + void interpolate4_sup(SampleVector::iterator* it, T* buf, qint32 len); + + void interpolate8_cen(SampleVector::iterator* it, T* buf, qint32 len); void interpolate16_cen(SampleVector::iterator* it, T* buf, qint32 len); void interpolate32_cen(SampleVector::iterator* it, T* buf, qint32 len); void interpolate64_cen(SampleVector::iterator* it, T* buf, qint32 len); @@ -174,23 +179,25 @@ void Interpolators::interpolate2_inf(SampleVector::itera for (int pos = 0; pos < len - 7; pos += 8) { + memset(intbuf, 0, 8*sizeof(qint32)); + intbuf[0] = (**it).m_real << interpolation_shifts::pre2; intbuf[1] = (**it).m_imag << interpolation_shifts::pre2; - m_interpolator2.myInterpolate(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3]); ++(*it); intbuf[4] = (**it).m_real << interpolation_shifts::pre2; intbuf[5] = (**it).m_imag << interpolation_shifts::pre2; - m_interpolator2.myInterpolate(&intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]); ++(*it); - buf[pos+0] = intbuf[1] >> interpolation_shifts::post2; // + imag - buf[pos+1] = -(intbuf[0] >> interpolation_shifts::post2); // - real - buf[pos+2] = -(intbuf[2] >> interpolation_shifts::post2); // - real - buf[pos+3] = -(intbuf[3] >> interpolation_shifts::post2); // - imag - buf[pos+4] = -(intbuf[5] >> interpolation_shifts::post2); // - imag - buf[pos+5] = intbuf[4] >> interpolation_shifts::post2; // + real - buf[pos+6] = intbuf[6] >> interpolation_shifts::post2; // + real - buf[pos+7] = intbuf[7] >> interpolation_shifts::post2; // + imag + m_interpolator2.myInterpolateInf(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3], &intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]); + + buf[pos+0] = intbuf[0] >> interpolation_shifts::post2; + buf[pos+1] = intbuf[1] >> interpolation_shifts::post2; + buf[pos+2] = intbuf[2] >> interpolation_shifts::post2; + buf[pos+3] = intbuf[3] >> interpolation_shifts::post2; + buf[pos+4] = intbuf[4] >> interpolation_shifts::post2; + buf[pos+5] = intbuf[5] >> interpolation_shifts::post2; + buf[pos+6] = intbuf[6] >> interpolation_shifts::post2; + buf[pos+7] = intbuf[7] >> interpolation_shifts::post2; } } @@ -201,23 +208,25 @@ void Interpolators::interpolate2_sup(SampleVector::itera for (int pos = 0; pos < len - 7; pos += 8) { + memset(intbuf, 0, 8*sizeof(qint32)); + intbuf[0] = (**it).m_real << interpolation_shifts::pre2; intbuf[1] = (**it).m_imag << interpolation_shifts::pre2; - m_interpolator2.myInterpolate(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3]); ++(*it); intbuf[4] = (**it).m_real << interpolation_shifts::pre2; intbuf[5] = (**it).m_imag << interpolation_shifts::pre2; - m_interpolator2.myInterpolate(&intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]); ++(*it); - buf[pos+0] = -(intbuf[1] >> interpolation_shifts::post2); // - imag - buf[pos+1] = intbuf[0] >> interpolation_shifts::post2; // + real - buf[pos+2] = -(intbuf[2] >> interpolation_shifts::post2); // - real - buf[pos+3] = -(intbuf[3] >> interpolation_shifts::post2); // - imag - buf[pos+4] = intbuf[5] >> interpolation_shifts::post2; // + imag - buf[pos+5] = -(intbuf[4] >> interpolation_shifts::post2); // - real - buf[pos+6] = intbuf[6] >> interpolation_shifts::post2; // + real - buf[pos+7] = intbuf[7] >> interpolation_shifts::post2; // + imag + m_interpolator2.myInterpolateSup(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3], &intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]); + + buf[pos+0] = intbuf[0] >> interpolation_shifts::post2; + buf[pos+1] = intbuf[1] >> interpolation_shifts::post2; + buf[pos+2] = intbuf[2] >> interpolation_shifts::post2; + buf[pos+3] = intbuf[3] >> interpolation_shifts::post2; + buf[pos+4] = intbuf[4] >> interpolation_shifts::post2; + buf[pos+5] = intbuf[5] >> interpolation_shifts::post2; + buf[pos+6] = intbuf[6] >> interpolation_shifts::post2; + buf[pos+7] = intbuf[7] >> interpolation_shifts::post2; } } @@ -250,6 +259,86 @@ void Interpolators::interpolate4_cen(SampleVector::itera } } +template +void Interpolators::interpolate4_inf(SampleVector::iterator* it, T* buf, qint32 len) +{ + qint32 intbuf[16]; + + for (int pos = 0; pos < len - 15; pos += 16) + { + memset(intbuf, 0, 16*sizeof(qint32)); + intbuf[0] = (**it).m_real << interpolation_shifts::pre4; + intbuf[1] = (**it).m_imag << interpolation_shifts::pre4; + ++(*it); + intbuf[8] = (**it).m_real << interpolation_shifts::pre4; + intbuf[9] = (**it).m_imag << interpolation_shifts::pre4; + ++(*it); + + m_interpolator2.myInterpolateInf(&intbuf[0], &intbuf[1], &intbuf[4], &intbuf[5], &intbuf[8], &intbuf[9], &intbuf[12], &intbuf[13]); + + m_interpolator4.myInterpolateInf(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3], &intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]); + m_interpolator4.myInterpolateInf(&intbuf[8], &intbuf[9], &intbuf[10], &intbuf[11], &intbuf[12], &intbuf[13], &intbuf[14], &intbuf[15]); + + buf[pos+0] = intbuf[0] >> interpolation_shifts::post4; + buf[pos+1] = intbuf[1] >> interpolation_shifts::post4; + buf[pos+2] = intbuf[2] >> interpolation_shifts::post4; + buf[pos+3] = intbuf[3] >> interpolation_shifts::post4; + buf[pos+4] = intbuf[4] >> interpolation_shifts::post4; + buf[pos+5] = intbuf[5] >> interpolation_shifts::post4; + buf[pos+6] = intbuf[6] >> interpolation_shifts::post4; + buf[pos+7] = intbuf[7] >> interpolation_shifts::post4; + + buf[pos+8] = intbuf[8] >> interpolation_shifts::post4; + buf[pos+9] = intbuf[9] >> interpolation_shifts::post4; + buf[pos+10] = intbuf[10] >> interpolation_shifts::post4; + buf[pos+11] = intbuf[11] >> interpolation_shifts::post4; + buf[pos+12] = intbuf[12] >> interpolation_shifts::post4; + buf[pos+13] = intbuf[13] >> interpolation_shifts::post4; + buf[pos+14] = intbuf[14] >> interpolation_shifts::post4; + buf[pos+15] = intbuf[15] >> interpolation_shifts::post4; + } +} + +template +void Interpolators::interpolate4_sup(SampleVector::iterator* it, T* buf, qint32 len) +{ + qint32 intbuf[16]; + + for (int pos = 0; pos < len - 15; pos += 16) + { + memset(intbuf, 0, 16*sizeof(qint32)); + intbuf[0] = (**it).m_real << interpolation_shifts::pre4; + intbuf[1] = (**it).m_imag << interpolation_shifts::pre4; + ++(*it); + intbuf[8] = (**it).m_real << interpolation_shifts::pre4; + intbuf[9] = (**it).m_imag << interpolation_shifts::pre4; + ++(*it); + + m_interpolator2.myInterpolateSup(&intbuf[0], &intbuf[1], &intbuf[4], &intbuf[5], &intbuf[8], &intbuf[9], &intbuf[12], &intbuf[13]); + + m_interpolator4.myInterpolateSup(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3], &intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]); + m_interpolator4.myInterpolateSup(&intbuf[8], &intbuf[9], &intbuf[10], &intbuf[11], &intbuf[12], &intbuf[13], &intbuf[14], &intbuf[15]); + + buf[pos+0] = intbuf[0] >> interpolation_shifts::post4; + buf[pos+1] = intbuf[1] >> interpolation_shifts::post4; + buf[pos+2] = intbuf[2] >> interpolation_shifts::post4; + buf[pos+3] = intbuf[3] >> interpolation_shifts::post4; + buf[pos+4] = intbuf[4] >> interpolation_shifts::post4; + buf[pos+5] = intbuf[5] >> interpolation_shifts::post4; + buf[pos+6] = intbuf[6] >> interpolation_shifts::post4; + buf[pos+7] = intbuf[7] >> interpolation_shifts::post4; + + buf[pos+8] = intbuf[8] >> interpolation_shifts::post4; + buf[pos+9] = intbuf[9] >> interpolation_shifts::post4; + buf[pos+10] = intbuf[10] >> interpolation_shifts::post4; + buf[pos+11] = intbuf[11] >> interpolation_shifts::post4; + buf[pos+12] = intbuf[12] >> interpolation_shifts::post4; + buf[pos+13] = intbuf[13] >> interpolation_shifts::post4; + buf[pos+14] = intbuf[14] >> interpolation_shifts::post4; + buf[pos+15] = intbuf[15] >> interpolation_shifts::post4; + } +} + template void Interpolators::interpolate8_cen(SampleVector::iterator* it, T* buf, qint32 len) { diff --git a/sdrbase/dsp/inthalfbandfilter.h b/sdrbase/dsp/inthalfbandfilter.h index b51189344..e51f49663 100644 --- a/sdrbase/dsp/inthalfbandfilter.h +++ b/sdrbase/dsp/inthalfbandfilter.h @@ -747,6 +747,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: AccuType 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 702e1281e..071c08d5e 100644 --- a/sdrbase/dsp/inthalfbandfilterdb.h +++ b/sdrbase/dsp/inthalfbandfilterdb.h @@ -629,6 +629,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: AccuType m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique int m_ptr; diff --git a/sdrbase/dsp/inthalfbandfilterdbf.h b/sdrbase/dsp/inthalfbandfilterdbf.h index 938bf57d3..9ae20e943 100644 --- a/sdrbase/dsp/inthalfbandfilterdbf.h +++ b/sdrbase/dsp/inthalfbandfilterdbf.h @@ -65,6 +65,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: SampleType m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique int m_ptr; diff --git a/sdrbase/dsp/inthalfbandfilterdbff.h b/sdrbase/dsp/inthalfbandfilterdbff.h index 2816f2696..f36976ab7 100644 --- a/sdrbase/dsp/inthalfbandfilterdbff.h +++ b/sdrbase/dsp/inthalfbandfilterdbff.h @@ -579,6 +579,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: SampleType m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique int m_ptr; diff --git a/sdrbase/dsp/inthalfbandfilterdbfi.h b/sdrbase/dsp/inthalfbandfilterdbfi.h index f83c4fd33..44f839c28 100644 --- a/sdrbase/dsp/inthalfbandfilterdbfi.h +++ b/sdrbase/dsp/inthalfbandfilterdbfi.h @@ -579,6 +579,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: SampleType m_samplesDB[2*(HBFIRFilterTraits::hbOrder - 1)][2]; // double buffer technique int m_ptr; diff --git a/sdrbase/dsp/inthalfbandfiltereo.h b/sdrbase/dsp/inthalfbandfiltereo.h index fb598521e..2a58f3765 100644 --- a/sdrbase/dsp/inthalfbandfiltereo.h +++ b/sdrbase/dsp/inthalfbandfiltereo.h @@ -754,6 +754,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: EOStorageType m_even[2][HBFIRFilterTraits::hbOrder]; EOStorageType m_odd[2][HBFIRFilterTraits::hbOrder]; diff --git a/sdrbase/dsp/inthalfbandfiltereo1.h b/sdrbase/dsp/inthalfbandfiltereo1.h index 5062984cf..d276867df 100644 --- a/sdrbase/dsp/inthalfbandfiltereo1.h +++ b/sdrbase/dsp/inthalfbandfiltereo1.h @@ -620,6 +620,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + 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/inthalfbandfiltereo2.h b/sdrbase/dsp/inthalfbandfiltereo2.h index be513419b..ea17f4cec 100644 --- a/sdrbase/dsp/inthalfbandfiltereo2.h +++ b/sdrbase/dsp/inthalfbandfiltereo2.h @@ -620,6 +620,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(qint32 *x1, qint32 *y1, qint32 *x2, qint32 *y2, qint32 *x3, qint32 *y3, qint32 *x4, qint32 *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: qint64 m_even[2][HBFIRFilterTraits::hbOrder]; // double buffer technique qint64 m_odd[2][HBFIRFilterTraits::hbOrder]; // double buffer technique diff --git a/sdrbase/dsp/inthalfbandfiltereof.h b/sdrbase/dsp/inthalfbandfiltereof.h index f6cf12f75..e11496b21 100644 --- a/sdrbase/dsp/inthalfbandfiltereof.h +++ b/sdrbase/dsp/inthalfbandfiltereof.h @@ -106,6 +106,38 @@ public: doInterpolateFIR(x2, y2); } + void myInterpolateInf(float *x1, float *y1, float *x2, float *y2, float *x3, float *y3, float *x4, float *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = *y1; + *y1 = -x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = -*y3; + *y3 = x; + } + + void myInterpolateSup(float *x1, float *y1, float *x2, float *y2, float *x3, float *y3, float *x4, float *y4) + { + myInterpolate(x1, y1, x2, y2); + myInterpolate(x3, y3, x4, y4); + // rotation + qint32 x; + x = *x1; + *x1 = -*y1; + *y1 = x; + *x2 = -*x2; + *y2 = -*y2; + x = *x3; + *x3 = *y3; + *y3 = -x; + } + protected: float m_even[2][HBFIRFilterTraits::hbOrder]; // double buffer technique float m_odd[2][HBFIRFilterTraits::hbOrder]; // double buffer technique