diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-30 10:06:47 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-30 10:06:47 +0100 |
commit | c56f572c1026a774bcec768821e64ac31354ceff (patch) | |
tree | 42119732d24b14f170921bcb5d376d3b27bc556b /src/OfdmGenerator.cpp | |
parent | 18276a5d2eac39b08caa2ce44e196e7a98f1a108 (diff) | |
download | dabmod-c56f572c1026a774bcec768821e64ac31354ceff.tar.gz dabmod-c56f572c1026a774bcec768821e64ac31354ceff.tar.bz2 dabmod-c56f572c1026a774bcec768821e64ac31354ceff.zip |
Clear PAPRStats when config gets changed
Diffstat (limited to 'src/OfdmGenerator.cpp')
-rw-r--r-- | src/OfdmGenerator.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/OfdmGenerator.cpp b/src/OfdmGenerator.cpp index 1a819ee..b00d66b 100644 --- a/src/OfdmGenerator.cpp +++ b/src/OfdmGenerator.cpp @@ -187,6 +187,14 @@ int OfdmGenerator::process(Buffer* const dataIn, Buffer* dataOut) // For performance reasons, do not calculate MER for every symbol. myMERCalcIndex = (myMERCalcIndex + 1) % myNbSymbols; + // The PAPRStats' clear() is not threadsafe, do not access it + // from the RC functions. + if (myPaprClearRequest.load()) { + myPaprBeforeCFR.clear(); + myPaprAfterCFR.clear(); + myPaprClearRequest.store(false); + } + for (size_t i = 0; i < myNbSymbols; ++i) { myFftIn[0][0] = 0; myFftIn[0][1] = 0; @@ -358,12 +366,15 @@ void OfdmGenerator::set_parameter(const std::string& parameter, if (parameter == "cfr") { ss >> myCfr; + myPaprClearRequest.store(true); } else if (parameter == "clip") { ss >> myCfrClip; + myPaprClearRequest.store(true); } else if (parameter == "errorclip") { ss >> myCfrErrorClip; + myPaprClearRequest.store(true); } else if (parameter == "clip_stats" or parameter == "papr") { throw ParameterError("Parameter '" + parameter + "' is read-only"); |