1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-04 16:01:14 -05:00

HackRF output: implementation of Fc position selection in the GUI

This commit is contained in:
f4exb 2019-03-31 23:09:50 +02:00
parent ca24d8e9f6
commit 8e6f9d8d24
18 changed files with 545 additions and 44 deletions

View File

@ -335,6 +335,7 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
<< " m_bandwidth: " << settings.m_bandwidth << " m_bandwidth: " << settings.m_bandwidth
<< " m_devSampleRate: " << settings.m_devSampleRate << " m_devSampleRate: " << settings.m_devSampleRate
<< " m_log2Interp: " << settings.m_log2Interp << " m_log2Interp: " << settings.m_log2Interp
<< " m_fcPos: " << settings.m_fcPos
<< " m_biasT: " << settings.m_biasT << " m_biasT: " << settings.m_biasT
<< " m_lnaExt: " << settings.m_lnaExt << " m_lnaExt: " << settings.m_lnaExt
<< " m_vgaGain: " << settings.m_vgaGain << " m_vgaGain: " << settings.m_vgaGain
@ -434,6 +435,13 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
forwardChange = true; 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) if ((m_settings.m_vgaGain != settings.m_vgaGain) || force)
{ {
reverseAPIKeys.append("vgaGain"); reverseAPIKeys.append("vgaGain");

View File

@ -298,6 +298,12 @@ void HackRFOutputGui::on_interp_currentIndexChanged(int index)
sendSettings(); 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) void HackRFOutputGui::on_txvga_valueChanged(int value)
{ {
if ((value < 0) || (value > 47)) if ((value < 0) || (value > 47))

View File

@ -89,6 +89,7 @@ private slots:
void on_LOppm_valueChanged(int value); void on_LOppm_valueChanged(int value);
void on_biasT_stateChanged(int state); void on_biasT_stateChanged(int state);
void on_interp_currentIndexChanged(int index); void on_interp_currentIndexChanged(int index);
void on_fcPos_currentIndexChanged(int index);
void on_lnaExt_stateChanged(int state); void on_lnaExt_stateChanged(int state);
void on_bbFilter_currentIndexChanged(int index); void on_bbFilter_currentIndexChanged(int index);
void on_txvga_valueChanged(int value); void on_txvga_valueChanged(int value);

View File

@ -349,6 +349,41 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="fcPosLabel">
<property name="text">
<string>Fc</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fcPos">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Relative position of device center frequency</string>
</property>
<item>
<property name="text">
<string>Inf</string>
</property>
</item>
<item>
<property name="text">
<string>Sup</string>
</property>
</item>
<item>
<property name="text">
<string>Cen</string>
</property>
</item>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_interp"> <widget class="QLabel" name="label_interp">
<property name="text"> <property name="text">

View File

@ -31,6 +31,7 @@ void HackRFOutputSettings::resetToDefaults()
m_LOppmTenths = 0; m_LOppmTenths = 0;
m_biasT = false; m_biasT = false;
m_log2Interp = 0; m_log2Interp = 0;
m_fcPos = FC_POS_CENTER;
m_lnaExt = false; m_lnaExt = false;
m_vgaGain = 22; m_vgaGain = 22;
m_bandwidth = 1750000; m_bandwidth = 1750000;
@ -46,6 +47,7 @@ QByteArray HackRFOutputSettings::serialize() const
SimpleSerializer s(1); SimpleSerializer s(1);
s.writeS32(1, m_LOppmTenths); s.writeS32(1, m_LOppmTenths);
s.writeS32(2, (int) m_fcPos);
s.writeBool(3, m_biasT); s.writeBool(3, m_biasT);
s.writeU32(4, m_log2Interp); s.writeU32(4, m_log2Interp);
s.writeBool(5, m_lnaExt); s.writeBool(5, m_lnaExt);
@ -73,8 +75,11 @@ bool HackRFOutputSettings::deserialize(const QByteArray& data)
if (d.getVersion() == 1) if (d.getVersion() == 1)
{ {
uint32_t uintval; uint32_t uintval;
int32_t intval;
d.readS32(1, &m_LOppmTenths, 0); 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.readBool(3, &m_biasT, false);
d.readU32(4, &m_log2Interp, 0); d.readU32(4, &m_log2Interp, 0);
d.readBool(5, &m_lnaExt, false); d.readBool(5, &m_lnaExt, false);

View File

@ -21,11 +21,18 @@
#include <QString> #include <QString>
struct HackRFOutputSettings { struct HackRFOutputSettings {
typedef enum {
FC_POS_INFRA = 0,
FC_POS_SUPRA,
FC_POS_CENTER
} fcPos_t;
quint64 m_centerFrequency; quint64 m_centerFrequency;
qint32 m_LOppmTenths; qint32 m_LOppmTenths;
quint32 m_bandwidth; quint32 m_bandwidth;
quint32 m_vgaGain; quint32 m_vgaGain;
quint32 m_log2Interp; quint32 m_log2Interp;
fcPos_t m_fcPos;
quint64 m_devSampleRate; quint64 m_devSampleRate;
bool m_biasT; bool m_biasT;
bool m_lnaExt; bool m_lnaExt;

View File

@ -58,6 +58,11 @@ void HackRFOutputThread::setLog2Interpolation(unsigned int log2Interp)
m_log2Interp = log2Interp; m_log2Interp = log2Interp;
} }
void HackRFOutputThread::setFcPos(int fcPos)
{
m_fcPos = fcPos;
}
void HackRFOutputThread::run() void HackRFOutputThread::run()
{ {
hackrf_error rc; hackrf_error rc;
@ -121,28 +126,83 @@ void HackRFOutputThread::callback(qint8* buf, qint32 len)
} }
else 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: switch (m_log2Interp)
m_interpolators.interpolate2_cen(&beginRead, buf, len); {
break; case 1:
case 2: m_interpolators.interpolate2_sup(&beginRead, buf, len);
m_interpolators.interpolate4_cen(&beginRead, buf, len); break;
break; case 2:
case 3: m_interpolators.interpolate4_sup(&beginRead, buf, len);
m_interpolators.interpolate8_cen(&beginRead, buf, len); break;
break; // case 3:
case 4: // m_interpolators.interpolate8_cen(&beginRead, buf, len);
m_interpolators.interpolate16_cen(&beginRead, buf, len); // break;
break; // case 4:
case 5: // m_interpolators.interpolate16_cen(&beginRead, buf, len);
m_interpolators.interpolate32_cen(&beginRead, buf, len); // break;
break; // case 5:
case 6: // m_interpolators.interpolate32_cen(&beginRead, buf, len);
m_interpolators.interpolate64_cen(&beginRead, buf, len); // break;
break; // case 6:
default: // m_interpolators.interpolate64_cen(&beginRead, buf, len);
break; // 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;
}
} }
} }
} }

View File

@ -37,6 +37,7 @@ public:
void startWork(); void startWork();
void stopWork(); void stopWork();
void setLog2Interpolation(unsigned int log2_interp); void setLog2Interpolation(unsigned int log2_interp);
void setFcPos(int fcPos);
private: private:
QMutex m_startWaitMutex; QMutex m_startWaitMutex;
@ -48,6 +49,7 @@ private:
SampleSourceFifo* m_sampleFifo; SampleSourceFifo* m_sampleFifo;
unsigned int m_log2Interp; unsigned int m_log2Interp;
int m_fcPos;
Interpolators<qint8, SDR_TX_SAMP_SZ, 8> m_interpolators; Interpolators<qint8, SDR_TX_SAMP_SZ, 8> m_interpolators;

View File

@ -106,11 +106,16 @@ class Interpolators
public: public:
// interleaved I/Q input buffer // interleaved I/Q input buffer
void interpolate1(SampleVector::iterator* it, T* buf, qint32 len); 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_inf(SampleVector::iterator* it, T* buf, qint32 len);
void interpolate2_sup(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 interpolate16_cen(SampleVector::iterator* it, T* buf, qint32 len);
void interpolate32_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); void interpolate64_cen(SampleVector::iterator* it, T* buf, qint32 len);
@ -174,23 +179,25 @@ void Interpolators<T, SdrBits, OutputBits>::interpolate2_inf(SampleVector::itera
for (int pos = 0; pos < len - 7; pos += 8) for (int pos = 0; pos < len - 7; pos += 8)
{ {
memset(intbuf, 0, 8*sizeof(qint32));
intbuf[0] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[0] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2;
intbuf[1] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[1] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2;
m_interpolator2.myInterpolate(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3]);
++(*it); ++(*it);
intbuf[4] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[4] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2;
intbuf[5] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[5] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2;
m_interpolator2.myInterpolate(&intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]);
++(*it); ++(*it);
buf[pos+0] = intbuf[1] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + imag m_interpolator2.myInterpolateInf(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3], &intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]);
buf[pos+1] = -(intbuf[0] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - real
buf[pos+2] = -(intbuf[2] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - real buf[pos+0] = intbuf[0] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+3] = -(intbuf[3] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - imag buf[pos+1] = intbuf[1] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+4] = -(intbuf[5] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - imag buf[pos+2] = intbuf[2] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+5] = intbuf[4] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + real buf[pos+3] = intbuf[3] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+6] = intbuf[6] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + real buf[pos+4] = intbuf[4] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+7] = intbuf[7] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + imag buf[pos+5] = intbuf[5] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+6] = intbuf[6] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+7] = intbuf[7] >> interpolation_shifts<SdrBits, OutputBits>::post2;
} }
} }
@ -201,23 +208,25 @@ void Interpolators<T, SdrBits, OutputBits>::interpolate2_sup(SampleVector::itera
for (int pos = 0; pos < len - 7; pos += 8) for (int pos = 0; pos < len - 7; pos += 8)
{ {
memset(intbuf, 0, 8*sizeof(qint32));
intbuf[0] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[0] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2;
intbuf[1] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[1] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2;
m_interpolator2.myInterpolate(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3]);
++(*it); ++(*it);
intbuf[4] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[4] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre2;
intbuf[5] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2; intbuf[5] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre2;
m_interpolator2.myInterpolate(&intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]);
++(*it); ++(*it);
buf[pos+0] = -(intbuf[1] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - imag m_interpolator2.myInterpolateSup(&intbuf[0], &intbuf[1], &intbuf[2], &intbuf[3], &intbuf[4], &intbuf[5], &intbuf[6], &intbuf[7]);
buf[pos+1] = intbuf[0] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + real
buf[pos+2] = -(intbuf[2] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - real buf[pos+0] = intbuf[0] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+3] = -(intbuf[3] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - imag buf[pos+1] = intbuf[1] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+4] = intbuf[5] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + imag buf[pos+2] = intbuf[2] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+5] = -(intbuf[4] >> interpolation_shifts<SdrBits, OutputBits>::post2); // - real buf[pos+3] = intbuf[3] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+6] = intbuf[6] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + real buf[pos+4] = intbuf[4] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+7] = intbuf[7] >> interpolation_shifts<SdrBits, OutputBits>::post2; // + imag buf[pos+5] = intbuf[5] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+6] = intbuf[6] >> interpolation_shifts<SdrBits, OutputBits>::post2;
buf[pos+7] = intbuf[7] >> interpolation_shifts<SdrBits, OutputBits>::post2;
} }
} }
@ -250,6 +259,86 @@ void Interpolators<T, SdrBits, OutputBits>::interpolate4_cen(SampleVector::itera
} }
} }
template<typename T, uint SdrBits, uint OutputBits>
void Interpolators<T, SdrBits, OutputBits>::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<SdrBits, OutputBits>::pre4;
intbuf[1] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre4;
++(*it);
intbuf[8] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre4;
intbuf[9] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::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<SdrBits, OutputBits>::post4;
buf[pos+1] = intbuf[1] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+2] = intbuf[2] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+3] = intbuf[3] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+4] = intbuf[4] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+5] = intbuf[5] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+6] = intbuf[6] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+7] = intbuf[7] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+8] = intbuf[8] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+9] = intbuf[9] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+10] = intbuf[10] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+11] = intbuf[11] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+12] = intbuf[12] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+13] = intbuf[13] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+14] = intbuf[14] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+15] = intbuf[15] >> interpolation_shifts<SdrBits, OutputBits>::post4;
}
}
template<typename T, uint SdrBits, uint OutputBits>
void Interpolators<T, SdrBits, OutputBits>::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<SdrBits, OutputBits>::pre4;
intbuf[1] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::pre4;
++(*it);
intbuf[8] = (**it).m_real << interpolation_shifts<SdrBits, OutputBits>::pre4;
intbuf[9] = (**it).m_imag << interpolation_shifts<SdrBits, OutputBits>::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<SdrBits, OutputBits>::post4;
buf[pos+1] = intbuf[1] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+2] = intbuf[2] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+3] = intbuf[3] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+4] = intbuf[4] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+5] = intbuf[5] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+6] = intbuf[6] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+7] = intbuf[7] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+8] = intbuf[8] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+9] = intbuf[9] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+10] = intbuf[10] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+11] = intbuf[11] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+12] = intbuf[12] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+13] = intbuf[13] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+14] = intbuf[14] >> interpolation_shifts<SdrBits, OutputBits>::post4;
buf[pos+15] = intbuf[15] >> interpolation_shifts<SdrBits, OutputBits>::post4;
}
}
template<typename T, uint SdrBits, uint OutputBits> template<typename T, uint SdrBits, uint OutputBits>
void Interpolators<T, SdrBits, OutputBits>::interpolate8_cen(SampleVector::iterator* it, T* buf, qint32 len) void Interpolators<T, SdrBits, OutputBits>::interpolate8_cen(SampleVector::iterator* it, T* buf, qint32 len)
{ {

View File

@ -747,6 +747,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
AccuType m_samples[HBFIRFilterTraits<HBFilterOrder>::hbOrder + 1][2]; // Valgrind optim (from qint16) AccuType m_samples[HBFIRFilterTraits<HBFilterOrder>::hbOrder + 1][2]; // Valgrind optim (from qint16)
qint16 m_ptr; qint16 m_ptr;

View File

@ -629,6 +629,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
AccuType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique AccuType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique
int m_ptr; int m_ptr;

View File

@ -65,6 +65,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
SampleType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique SampleType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique
int m_ptr; int m_ptr;

View File

@ -579,6 +579,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
SampleType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique SampleType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique
int m_ptr; int m_ptr;

View File

@ -579,6 +579,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
SampleType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique SampleType m_samplesDB[2*(HBFIRFilterTraits<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique
int m_ptr; int m_ptr;

View File

@ -754,6 +754,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
EOStorageType m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; EOStorageType m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder];
EOStorageType m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; EOStorageType m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder];

View File

@ -620,6 +620,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
int32_t m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique int32_t m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique
int32_t m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique int32_t m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique

View File

@ -620,6 +620,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
qint64 m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique qint64 m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique
qint64 m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique qint64 m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique

View File

@ -106,6 +106,38 @@ public:
doInterpolateFIR(x2, y2); 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: protected:
float m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique float m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique
float m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique float m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique