summaryrefslogtreecommitdiffstats
path: root/src/GuardIntervalInserter.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-22 09:10:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-22 14:07:53 +0100
commitce490c8c25bdbb1fc40fc43d8631a807f6effa6a (patch)
treeac7aab1be66a4722376b94a3b65531b13ac2129a /src/GuardIntervalInserter.h
parent45b180cd1a0ccbd12b5fb1baf82a9430e4567d2b (diff)
downloaddabmod-ce490c8c25bdbb1fc40fc43d8631a807f6effa6a.tar.gz
dabmod-ce490c8c25bdbb1fc40fc43d8631a807f6effa6a.tar.bz2
dabmod-ce490c8c25bdbb1fc40fc43d8631a807f6effa6a.zip
Add OFDM windowing support to GuardIntervalInserter
Diffstat (limited to 'src/GuardIntervalInserter.h')
-rw-r--r--src/GuardIntervalInserter.h60
1 files changed, 43 insertions, 17 deletions
diff --git a/src/GuardIntervalInserter.h b/src/GuardIntervalInserter.h
index e6b3b64..b2ac782 100644
--- a/src/GuardIntervalInserter.h
+++ b/src/GuardIntervalInserter.h
@@ -1,6 +1,11 @@
/*
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
+
+ Copyright (C) 2017
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://opendigitalradio.org
*/
/*
This file is part of ODR-DabMod.
@@ -26,26 +31,47 @@
#endif
#include "ModPlugin.h"
+#include "RemoteControl.h"
#include <stdint.h>
+#include <vector>
/* The GuardIntervalInserter prepends the cyclic prefix to all
- * symbols in the transmission frame. */
-class GuardIntervalInserter : public ModCodec
+ * symbols in the transmission frame.
+ *
+ * If windowOverlap is non-zero, it will also add a cyclic suffix of
+ * that length, enlarge the cyclic prefix too, and make symbols
+ * overlap using a raised cosine window.
+ * */
+class GuardIntervalInserter : public ModCodec , public RemoteControllable
{
-public:
- GuardIntervalInserter(
- size_t nbSymbols,
- size_t spacing,
- size_t nullSize,
- size_t symSize);
-
- int process(Buffer* const dataIn, Buffer* dataOut);
- const char* name() { return "GuardIntervalInserter"; }
-
-protected:
- size_t d_nbSymbols;
- size_t d_spacing;
- size_t d_nullSize;
- size_t d_symSize;
+ public:
+ GuardIntervalInserter(
+ size_t nbSymbols,
+ size_t spacing,
+ size_t nullSize,
+ size_t symSize,
+ size_t windowOverlap = 0);
+
+ int process(Buffer* const dataIn, Buffer* dataOut);
+ const char* name() { return "GuardIntervalInserter"; }
+
+ /******* REMOTE CONTROL ********/
+ virtual void set_parameter(const std::string& parameter,
+ const std::string& value);
+
+ virtual const std::string get_parameter(
+ const std::string& parameter) const;
+
+ protected:
+ void update_window(size_t new_window_overlap);
+
+ size_t d_nbSymbols;
+ size_t d_spacing;
+ size_t d_nullSize;
+ size_t d_symSize;
+
+ mutable std::mutex d_windowMutex;
+ size_t d_windowOverlap;
+ std::vector<float> d_window;
};