aboutsummaryrefslogtreecommitdiffstats
path: root/src/DabModulator.cpp
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-04-01 12:13:01 +0100
committerandreas128 <Andreas>2017-04-02 11:42:38 +0100
commit89ac4f53d0a10d1c07980fae5ddeb8818e7b9733 (patch)
tree01efcbbe06769e94e1a1acd3bc66299f01b30c2b /src/DabModulator.cpp
parent6243a4fac50a9c8690e13c2df65c058e69fdcae5 (diff)
downloaddabmod-89ac4f53d0a10d1c07980fae5ddeb8818e7b9733.tar.gz
dabmod-89ac4f53d0a10d1c07980fae5ddeb8818e7b9733.tar.bz2
dabmod-89ac4f53d0a10d1c07980fae5ddeb8818e7b9733.zip
Fix file reading
Diffstat (limited to 'src/DabModulator.cpp')
-rw-r--r--src/DabModulator.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp
index bd14396..81257f4 100644
--- a/src/DabModulator.cpp
+++ b/src/DabModulator.cpp
@@ -62,7 +62,8 @@ DabModulator::DabModulator(
unsigned dabMode, GainMode gainMode,
float& digGain, float normalise,
float gainmodeVariance,
- const std::string& filterTapsFilename
+ const std::string& filterTapsFilename,
+ const std::string& polyCoefFilename
) :
ModInput(),
myOutputRate(outputRate),
@@ -75,6 +76,7 @@ DabModulator::DabModulator(
myEtiSource(etiSource),
myFlowgraph(NULL),
myFilterTapsFilename(filterTapsFilename),
+ myPolyCoefFilename(polyCoefFilename),
myTiiConfig(tiiConfig)
{
PDEBUG("DabModulator::DabModulator(%u, %u, %u, %zu) @ %p\n",
@@ -218,8 +220,12 @@ int DabModulator::process(Buffer* dataOut)
}
shared_ptr<MemlessPoly> cifPoly;
- cifPoly = make_shared<MemlessPoly>("default");
- rcs.enrol(cifPoly.get());
+ if (not myPolyCoefFilename.empty()) {
+ cifPoly = make_shared<MemlessPoly>(myPolyCoefFilename);
+ std::cout << myPolyCoefFilename << "\n";
+ std::cout << cifPoly->m_taps[0] << " " << cifPoly->m_taps[1] << " "<< cifPoly->m_taps[2] << " "<< cifPoly->m_taps[3] << " "<< cifPoly->m_taps[4] << " "<< cifPoly->m_taps[5] << " "<< cifPoly->m_taps[6] << " "<< cifPoly->m_taps[7] << "\n";
+ rcs.enrol(cifPoly.get());
+ }
auto myOutput = make_shared<OutputMemory>(dataOut);
@@ -371,13 +377,19 @@ int DabModulator::process(Buffer* dataOut)
// myFlowgraph->connect(cifGuard, myOutput);
// }
//}
+ //if (cifRes) {
+ // myFlowgraph->connect(cifGuard, cifRes);
+ // myFlowgraph->connect(cifRes, cifPoly);
+ // myFlowgraph->connect(cifPoly, myOutput);
+ //} else {
+ // myFlowgraph->connect(cifGuard, cifPoly);
+ // myFlowgraph->connect(cifPoly, myOutput);
+ //}
if (cifRes) {
myFlowgraph->connect(cifGuard, cifRes);
- myFlowgraph->connect(cifRes, cifPoly);
- myFlowgraph->connect(cifPoly, myOutput);
+ myFlowgraph->connect(cifRes, myOutput);
} else {
- myFlowgraph->connect(cifGuard, cifPoly);
- myFlowgraph->connect(cifPoly, myOutput);
+ myFlowgraph->connect(cifGuard, myOutput);
}
}