summaryrefslogtreecommitdiffstats
path: root/src/QpskSymbolMapper.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-20 14:20:55 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-20 14:20:55 +0100
commit645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089 (patch)
treebca9183e0b45f21fa6f8f914b5887d0330128a8e /src/QpskSymbolMapper.cpp
parent7e606441165c0b4780d876157b336ab092cbd84c (diff)
downloaddabmod-645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089.tar.gz
dabmod-645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089.tar.bz2
dabmod-645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089.zip
Simplify QpskSymbolMapper a bit
Diffstat (limited to 'src/QpskSymbolMapper.cpp')
-rw-r--r--src/QpskSymbolMapper.cpp36
1 files changed, 13 insertions, 23 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] = {