diff options
Diffstat (limited to 'src/GuardIntervalInserter.h')
-rw-r--r-- | src/GuardIntervalInserter.h | 60 |
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; }; |