1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

dft: ifdef for full mem dump of dft

This commit is contained in:
Manuel Pitz 2021-06-23 20:18:12 +02:00
parent 56b28fa999
commit b633273f12

View file

@ -140,8 +140,11 @@ public:
format = format_type_lookup("villas.human");
if (logger->level() <= SPDLOG_LEVEL_DEBUG) {
origSigSync = std::make_shared<Dumper>("/tmp/plot/origSigSync");
windowdSigSync = std::make_shared<Dumper>("/tmp/plot/windowdSigSync");
#ifdef DFT_MEM_DUMP
//origSigSync = std::make_shared<Dumper>("/tmp/plot/origSigSync");
//windowdSigSync = std::make_shared<Dumper>("/tmp/plot/windowdSigSync");
//ppsSigSync = std::make_shared<Dumper>("/tmp/plot/ppsSigSync");
#endif
phasorPhase = std::make_shared<Dumper>("/tmp/plot/phasorPhase");
phasorAmplitude = std::make_shared<Dumper>("/tmp/plot/phasorAmplitude");
phasorFreq = std::make_shared<Dumper>("/tmp/plot/phasorFreq");
@ -423,18 +426,25 @@ public:
for (unsigned i = 0; i< windowSize; i++)
tmpSmpWindow[i] = ringBuffer[(i + ringBufferPos) % windowSize];
#ifdef DFT_MEM_DUMP
if (origSigSync)
origSigSync->writeDataBinary(windowSize, tmpSmpWindow);
//if (dftCalcCnt > 1 && phasorAmplitude)
// phasorAmplitude->writeData(1, &tmpSmpWindow[windowSize - 1]);
if (dftCalcCount > 1 && phasorAmplitude)
phasorAmplitude->writeData(1, &tmpSmpWindow[windowSize - 1]);
#endif
for (unsigned i = 0; i< windowSize; i++)
tmpSmpWindow[i] *= filterWindowCoefficents[i];
#ifdef DFT_MEM_DUMP
if (windowdSigSync)
windowdSigSync->writeDataBinary(windowSize, tmpSmpWindow);
#endif
for (unsigned i = 0; i < freqCount; i++) {
dftResults[i] = 0;
for (unsigned j = 0; j < windowSize * windowMultiplier; j++) {