mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
With global adoption of even/odd decimators the accu type must be 32 not 64 bits
This commit is contained in:
parent
2252dcb06a
commit
d735025c6c
@ -56,7 +56,7 @@ private:
|
||||
static AirspyThread *m_this;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#endif
|
||||
|
@ -52,7 +52,7 @@ private:
|
||||
int m_fcPos;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#endif
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
int m_fcPos;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint8, SDR_RX_SAMP_SZ, 8> m_decimators;
|
||||
Decimators<qint32, qint8, SDR_RX_SAMP_SZ, 8> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint8, SDR_RX_SAMP_SZ, 8> m_decimators;
|
||||
#endif
|
||||
|
@ -56,7 +56,7 @@ private:
|
||||
unsigned int m_log2Decim; // soft decimation
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#endif
|
||||
|
@ -52,8 +52,8 @@ private:
|
||||
unsigned int m_log2Decim;
|
||||
static PerseusThread *m_this;
|
||||
|
||||
Decimators<qint64, TripleByteLE<qint32>, SDR_RX_SAMP_SZ, 24> m_decimators32; // for no decimation (accumulator is int32)
|
||||
Decimators<qint64, TripleByteLE<qint64>, SDR_RX_SAMP_SZ, 24> m_decimators64; // for actual decimation (accumulator is int64)
|
||||
Decimators<qint32, TripleByteLE<qint32>, SDR_RX_SAMP_SZ, 24> m_decimators32; // for no decimation (accumulator is int32)
|
||||
Decimators<qint32, TripleByteLE<qint64>, SDR_RX_SAMP_SZ, 24> m_decimators64; // for actual decimation (accumulator is int64)
|
||||
|
||||
void run();
|
||||
void callback(const uint8_t* buf, qint32 len); // inner call back
|
||||
|
@ -60,7 +60,7 @@ private:
|
||||
float m_phasor;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#endif
|
||||
|
@ -53,7 +53,7 @@ private:
|
||||
int m_fcPos;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators;
|
||||
#endif
|
||||
|
@ -100,9 +100,9 @@ private:
|
||||
QMutex m_mutex;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 8> m_decimators_8;
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimators_12;
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 16> m_decimators_16;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 8> m_decimators_8;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators_12;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16> m_decimators_16;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 8> m_decimators_8;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators_12;
|
||||
|
@ -563,12 +563,12 @@ public:
|
||||
advancePointer();
|
||||
}
|
||||
|
||||
void myDecimate(qint64 x1, qint64 y1, qint64 *x2, qint64 *y2)
|
||||
void myDecimate(int32_t x1, int32_t y1, int32_t *x2, int32_t *y2)
|
||||
{
|
||||
storeSample64(x1, y1);
|
||||
storeSample32(x1, y1);
|
||||
advancePointer();
|
||||
|
||||
storeSample64(*x2, *y2);
|
||||
storeSample32(*x2, *y2);
|
||||
doFIR(x2, y2);
|
||||
advancePointer();
|
||||
}
|
||||
@ -586,13 +586,13 @@ public:
|
||||
}
|
||||
|
||||
/** Simple zero stuffing and filter */
|
||||
void myInterpolateZeroStuffing(qint64 *x1, qint64 *y1, qint64 *x2, qint64 *y2)
|
||||
void myInterpolateZeroStuffing(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2)
|
||||
{
|
||||
storeSample64(*x1, *y1);
|
||||
storeSample32(*x1, *y1);
|
||||
doFIR(x1, y1);
|
||||
advancePointer();
|
||||
|
||||
storeSample64(0, 0);
|
||||
storeSample32(0, 0);
|
||||
doFIR(x2, y2);
|
||||
advancePointer();
|
||||
}
|
||||
@ -622,8 +622,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
qint64 m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique
|
||||
qint64 m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique
|
||||
qint64 m_even[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique (qint32 to activate vectorization)
|
||||
qint64 m_odd[2][HBFIRFilterTraits<HBFilterOrder>::hbOrder]; // double buffer technique
|
||||
int32_t m_samples[HBFIRFilterTraits<HBFilterOrder>::hbOrder][2]; // double buffer technique
|
||||
|
||||
int m_ptr;
|
||||
@ -705,7 +705,6 @@ protected:
|
||||
//#else
|
||||
int a = m_ptr/2 + m_size; // tip pointer
|
||||
int b = m_ptr/2 + 1; // tail pointer
|
||||
|
||||
for (int i = 0; i < HBFIRFilterTraits<HBFilterOrder>::hbOrder / 4; i++)
|
||||
{
|
||||
if ((m_ptr % 2) == 0)
|
||||
@ -739,7 +738,7 @@ protected:
|
||||
sample->setImag(qAcc >> (HBFIRFilterTraits<HBFilterOrder>::hbShift -1));
|
||||
}
|
||||
|
||||
void doFIR(qint64 *x, qint64 *y)
|
||||
void doFIR(int32_t *x, int32_t *y)
|
||||
{
|
||||
qint64 iAcc = 0;
|
||||
qint64 qAcc = 0;
|
||||
|
@ -1,5 +1,7 @@
|
||||
project (sdrbench)
|
||||
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopt-info-vec-optimized")
|
||||
|
||||
set(sdrbench_SOURCES
|
||||
mainbench.cpp
|
||||
parserbench.cpp
|
||||
|
@ -61,7 +61,7 @@ private:
|
||||
std::uniform_real_distribution<float> m_uniform_distribution;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 12> m_decimatorsII;
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimatorsII;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimatorsII;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user