1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

added 'my' interpolation methods

This commit is contained in:
f4exb 2016-12-31 04:23:59 +01:00
parent 2047463dcf
commit d0f49291c5
4 changed files with 100 additions and 0 deletions

View File

@ -510,6 +510,40 @@ public:
m_ptr = HBFIRFilterTraits<HBFilterOrder>::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<HBFilterOrder>::hbMod[m_ptr + 2 - 1];
m_samples[m_ptr][0] = 0;
m_samples[m_ptr][1] = 0;
doFIR(sample2);
m_ptr = HBFIRFilterTraits<HBFilterOrder>::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<HBFilterOrder>::hbMod[m_ptr + 2 - 1];
m_samples[m_ptr][0] = 0;
m_samples[m_ptr][1] = 0;
doFIR(x2, y2);
m_ptr = HBFIRFilterTraits<HBFilterOrder>::hbMod[m_ptr + 2 - 1];
}
protected:
qint32 m_samples[HBFIRFilterTraits<HBFilterOrder>::hbOrder + 1][2]; // Valgrind optim (from qint16)
qint16 m_ptr;

View File

@ -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<HBFilterOrder>::hbOrder - 1)][2]; // double buffer technique
int m_ptr;

View File

@ -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<HBFilterOrder>::hbOrder]; // double buffer technique
int32_t m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique

View File

@ -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)));