diff --git a/sdrbase/dsp/decimatorsff.cpp b/sdrbase/dsp/decimatorsff.cpp index 0134865e8..dc7afbcb0 100644 --- a/sdrbase/dsp/decimatorsff.cpp +++ b/sdrbase/dsp/decimatorsff.cpp @@ -32,7 +32,7 @@ void DecimatorsFF::decimate1(FSampleVector::iterator* it, const float* buf, qint void DecimatorsFF::decimate2_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double intbuf[2]; + float intbuf[2]; for (int pos = 0; pos < nbIAndQ - 3; pos += 4) { @@ -54,7 +54,7 @@ void DecimatorsFF::decimate2_cen(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate2_inf(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal, yimag; + float xreal, yimag; for (int pos = 0; pos < nbIAndQ - 7; pos += 8) { @@ -74,7 +74,7 @@ void DecimatorsFF::decimate2_inf(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate2_sup(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal, yimag; + float xreal, yimag; for (int pos = 0; pos < nbIAndQ - 7; pos += 8) { @@ -94,7 +94,7 @@ void DecimatorsFF::decimate2_sup(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate4_inf(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal, yimag; + float xreal, yimag; for (int pos = 0; pos < nbIAndQ - 7; pos += 8) { @@ -116,7 +116,7 @@ void DecimatorsFF::decimate4_sup(FSampleVector::iterator* it, const float* buf, // Inf (LSB): // x y x y x y x y / x -> 0,-3,-4,7 / y -> 1,2,-5,-6 // [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - double xreal, yimag; + float xreal, yimag; for (int pos = 0; pos < nbIAndQ - 7; pos += 8) { @@ -132,7 +132,7 @@ void DecimatorsFF::decimate4_sup(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate8_inf(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal[2], yimag[2]; + float xreal[2], yimag[2]; for (int pos = 0; pos < nbIAndQ - 15; pos += 8) { @@ -154,7 +154,7 @@ void DecimatorsFF::decimate8_inf(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate8_sup(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal[2], yimag[2]; + float xreal[2], yimag[2]; for (int pos = 0; pos < nbIAndQ - 15; pos += 8) { @@ -178,7 +178,7 @@ void DecimatorsFF::decimate16_inf(FSampleVector::iterator* it, const float* buf, { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 0, 1, -3, 2, -4, -5, 7, -6] - double xreal[4], yimag[4]; + float xreal[4], yimag[4]; for (int pos = 0; pos < nbIAndQ - 31; ) { @@ -205,7 +205,7 @@ void DecimatorsFF::decimate16_sup(FSampleVector::iterator* it, const float* buf, { // Offset tuning: 4x downsample and rotate, then // downsample 4x more. [ rotate: 1, 0, -2, 3, -5, -4, 6, -7] - double xreal[4], yimag[4]; + float xreal[4], yimag[4]; for (int pos = 0; pos < nbIAndQ - 31; ) { @@ -230,7 +230,7 @@ void DecimatorsFF::decimate16_sup(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate32_inf(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal[8], yimag[8]; + float xreal[8], yimag[8]; for (int pos = 0; pos < nbIAndQ - 63; ) { @@ -260,7 +260,7 @@ void DecimatorsFF::decimate32_inf(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate32_sup(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal[8], yimag[8]; + float xreal[8], yimag[8]; for (int pos = 0; pos < nbIAndQ - 63; ) { @@ -290,7 +290,7 @@ void DecimatorsFF::decimate32_sup(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate64_inf(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal[16], yimag[16]; + float xreal[16], yimag[16]; for (int pos = 0; pos < nbIAndQ - 127; ) { @@ -329,7 +329,7 @@ void DecimatorsFF::decimate64_inf(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate64_sup(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double xreal[16], yimag[16]; + float xreal[16], yimag[16]; for (int pos = 0; pos < nbIAndQ - 127; ) { @@ -368,7 +368,7 @@ void DecimatorsFF::decimate64_sup(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate4_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double intbuf[4]; + float intbuf[4]; for (int pos = 0; pos < nbIAndQ - 7; pos += 8) { @@ -402,7 +402,7 @@ void DecimatorsFF::decimate4_cen(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate8_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double intbuf[8]; + float intbuf[8]; for (int pos = 0; pos < nbIAndQ - 15; pos += 16) { @@ -461,7 +461,7 @@ void DecimatorsFF::decimate8_cen(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate16_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double intbuf[16]; + float intbuf[16]; for (int pos = 0; pos < nbIAndQ - 31; pos += 32) { @@ -569,7 +569,7 @@ void DecimatorsFF::decimate16_cen(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate32_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double intbuf[32]; + float intbuf[32]; for (int pos = 0; pos < nbIAndQ - 63; pos += 64) { @@ -774,7 +774,7 @@ void DecimatorsFF::decimate32_cen(FSampleVector::iterator* it, const float* buf, void DecimatorsFF::decimate64_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ) { - double intbuf[64]; + float intbuf[64]; for (int pos = 0; pos < nbIAndQ - 127; pos += 128) { diff --git a/sdrbase/dsp/decimatorsff.h b/sdrbase/dsp/decimatorsff.h index 92e9a9e96..ca491ee58 100644 --- a/sdrbase/dsp/decimatorsff.h +++ b/sdrbase/dsp/decimatorsff.h @@ -17,7 +17,7 @@ #ifndef SDRBASE_DSP_DECIMATORSFF_H_ #define SDRBASE_DSP_DECIMATORSFF_H_ -#include "dsp/inthalfbandfilterdbf.h" +#include "dsp/inthalfbandfiltereof.h" #include "export.h" #define DECIMATORSFF_HB_FILTER_ORDER 64 @@ -46,12 +46,12 @@ public: void decimate64_sup(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ); void decimate64_cen(FSampleVector::iterator* it, const float* buf, qint32 nbIAndQ); - IntHalfbandFilterDBF m_decimator2; // 1st stages - IntHalfbandFilterDBF m_decimator4; // 2nd stages - IntHalfbandFilterDBF m_decimator8; // 3rd stages - IntHalfbandFilterDBF m_decimator16; // 4th stages - IntHalfbandFilterDBF m_decimator32; // 5th stages - IntHalfbandFilterDBF m_decimator64; // 6th stages + IntHalfbandFilterEOF m_decimator2; // 1st stages + IntHalfbandFilterEOF m_decimator4; // 2nd stages + IntHalfbandFilterEOF m_decimator8; // 3rd stages + IntHalfbandFilterEOF m_decimator16; // 4th stages + IntHalfbandFilterEOF m_decimator32; // 5th stages + IntHalfbandFilterEOF m_decimator64; // 6th stages }; diff --git a/sdrbench/mainbench.cpp b/sdrbench/mainbench.cpp index 43590c8c4..82605a5eb 100644 --- a/sdrbench/mainbench.cpp +++ b/sdrbench/mainbench.cpp @@ -27,7 +27,8 @@ MainBench::MainBench(qtwebapp::LoggerWithFile *logger, const ParserBench& parser QObject(parent), m_logger(logger), m_parser(parser), - m_uniform_distribution(-1.0, 1.0) + m_uniform_distribution_f(-1.0, 1.0), + m_uniform_distribution_s16(-32768,32767) { qDebug() << "MainBench::MainBench: start"; m_instance = this; @@ -62,22 +63,24 @@ void MainBench::run() void MainBench::testDecimateII() { QElapsedTimer timer; - qint64 nsecs; + qint64 nsecs = 0; qDebug() << "MainBench::testDecimateII: create test data"; qint16 *buf = new qint16[m_parser.getNbSamples()*2]; m_convertBuffer.resize(m_parser.getNbSamples()/(1< m_uniform_distribution; + std::uniform_real_distribution m_uniform_distribution_f; + std::uniform_int_distribution m_uniform_distribution_s16; #ifdef SDR_RX_SAMPLE_24BIT Decimators m_decimatorsII;