summaryrefslogtreecommitdiffstats
path: root/src/DabModulator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DabModulator.cpp')
-rw-r--r--src/DabModulator.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp
index 667d885..8a52401 100644
--- a/src/DabModulator.cpp
+++ b/src/DabModulator.cpp
@@ -26,6 +26,7 @@
*/
#include <string>
+#include <boost/make_shared.hpp>
#include "DabModulator.h"
#include "PcDebug.h"
@@ -46,6 +47,7 @@
#include "Resampler.h"
#include "ConvEncoder.h"
#include "FIRFilter.h"
+#include "TII.h"
#include "PuncturingEncoder.h"
#include "TimeInterleaver.h"
#include "TimestampDecoder.h"
@@ -55,25 +57,25 @@
using namespace boost;
DabModulator::DabModulator(
- struct modulator_offset_config& modconf,
+ double tist_offset_s, unsigned tist_delay_stages,
RemoteControllers* rcs,
- Logger& logger,
+ const tii_config_t& tiiConfig,
unsigned outputRate, unsigned clockRate,
unsigned dabMode, GainMode gainMode,
float digGain, float normalise,
std::string filterTapsFilename
) :
ModCodec(ModFormat(1), ModFormat(0)),
- myLogger(logger),
myOutputRate(outputRate),
myClockRate(clockRate),
myDabMode(dabMode),
myGainMode(gainMode),
myDigGain(digGain),
myNormalise(normalise),
- myEtiReader(EtiReader(modconf, myLogger)),
+ myEtiReader(EtiReader(tist_offset_s, tist_delay_stages, rcs)),
myFlowgraph(NULL),
myFilterTapsFilename(filterTapsFilename),
+ myTiiConfig(tiiConfig),
myRCs(rcs)
{
PDEBUG("DabModulator::DabModulator(%u, %u, %u, %u) @ %p\n",
@@ -196,6 +198,14 @@ int DabModulator::process(Buffer* const dataIn, Buffer* dataOut)
(float)mySpacing * (float)myOutputRate / 2048000.0f,
cic_ratio));
+ shared_ptr<TII> tii;
+ try {
+ tii = make_shared<TII>(myDabMode, myTiiConfig);
+ tii->enrol_at(*myRCs);
+ }
+ catch (std::runtime_error& e) {
+ etiLog.level(error) << "Could not initialise TII, skipping!";
+ }
shared_ptr<OfdmGenerator> cifOfdm(
new OfdmGenerator((1 + myNbSymbols), myNbCarriers, mySpacing));
@@ -346,6 +356,10 @@ int DabModulator::process(Buffer* const dataIn, Buffer* dataOut)
myFlowgraph->connect(cifFreq, cifDiff);
myFlowgraph->connect(cifNull, cifSig);
myFlowgraph->connect(cifDiff, cifSig);
+ if (tii) {
+ myFlowgraph->connect(tii, cifSig);
+ }
+
if (useCicEq) {
myFlowgraph->connect(cifSig, cifCicEq);
myFlowgraph->connect(cifCicEq, cifOfdm);