diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-03-20 14:20:55 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-03-20 14:20:55 +0100 |
commit | 645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089 (patch) | |
tree | bca9183e0b45f21fa6f8f914b5887d0330128a8e /src | |
parent | 7e606441165c0b4780d876157b336ab092cbd84c (diff) | |
download | dabmod-645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089.tar.gz dabmod-645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089.tar.bz2 dabmod-645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089.zip |
Simplify QpskSymbolMapper a bit
Diffstat (limited to 'src')
-rw-r--r-- | src/QpskSymbolMapper.cpp | 36 | ||||
-rw-r--r-- | src/QpskSymbolMapper.h | 7 |
2 files changed, 13 insertions, 30 deletions
diff --git a/src/QpskSymbolMapper.cpp b/src/QpskSymbolMapper.cpp index 7c4299c..e26853a 100644 --- a/src/QpskSymbolMapper.cpp +++ b/src/QpskSymbolMapper.cpp @@ -19,36 +19,25 @@ along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>. */ -#include "QpskSymbolMapper.h" -#include "PcDebug.h" - -#include <stdio.h> -#include <string.h> +#include <string> +#include <cstdio> +#include <cstring> #include <stdexcept> #include <complex> -#include <math.h> +#include <cmath> #ifdef __SSE__ # include <xmmintrin.h> #endif // __SSE__ -typedef std::complex<float> complexf; +#include "QpskSymbolMapper.h" +#include "PcDebug.h" + +typedef std::complex<float> complexf; QpskSymbolMapper::QpskSymbolMapper(size_t carriers) : ModCodec(), - d_carriers(carriers) -{ - PDEBUG("QpskSymbolMapper::QpskSymbolMapper(%zu) @ %p\n", carriers, this); - -} - - -QpskSymbolMapper::~QpskSymbolMapper() -{ - PDEBUG("QpskSymbolMapper::~QpskSymbolMapper() @ %p\n", this); - -} - + d_carriers(carriers) { } int QpskSymbolMapper::process(Buffer* const dataIn, Buffer* dataOut) { @@ -62,10 +51,11 @@ int QpskSymbolMapper::process(Buffer* const dataIn, Buffer* dataOut) __m128* out = reinterpret_cast<__m128*>(dataOut->getData()); if (dataIn->getLength() % (d_carriers / 4) != 0) { - fprintf(stderr, "%zu (input size) %% (%zu (carriers) / 4) != 0\n", - dataIn->getLength(), d_carriers); throw std::runtime_error( - "QpskSymbolMapper::process input size not valid!"); + "QpskSymbolMapper::process input size not valid: " + + std::to_string(dataIn->getLength()) + + "(input size) % (" + std::to_string(d_carriers) + + " (carriers) / 4) != 0"); } const static __m128 symbols[16] = { diff --git a/src/QpskSymbolMapper.h b/src/QpskSymbolMapper.h index 98f2e60..dbcf4dd 100644 --- a/src/QpskSymbolMapper.h +++ b/src/QpskSymbolMapper.h @@ -25,20 +25,13 @@ # include <config.h> #endif - #include "ModPlugin.h" - #include <sys/types.h> - class QpskSymbolMapper : public ModCodec { public: QpskSymbolMapper(size_t carriers); - virtual ~QpskSymbolMapper(); - QpskSymbolMapper(QpskSymbolMapper&); - QpskSymbolMapper& operator=(QpskSymbolMapper&); - int process(Buffer* const dataIn, Buffer* dataOut); const char* name() { return "QpskSymbolMapper"; } |