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: make sure the dft mem is fully initalized

This commit is contained in:
Manuel Pitz 2021-06-23 20:27:09 +02:00
parent 835a8ff29c
commit 15a71df357

View file

@ -383,9 +383,13 @@ public:
maxA = estimate.y;
}
<<<<<<< HEAD
if (dftCalcCnt > 1) {
if (phasorFreq)
phasorFreq->writeDataBinary(1, &maxF);
=======
if (windowSize < smpMemPos) {
>>>>>>> dft: make sure the dft mem is fully initalized
smp->data[i * 4 + 0].f = maxF; /* Frequency */
smp->data[i * 4 + 1].f = (maxA / pow(2, 0.5)); /* Amplitude */
@ -398,8 +402,10 @@ public:
phasorAmplitude->writeData(1, &(smp->data[i * 4 + 1].f));
}
}
dftCalcCnt++;
smp->length = signalIndex.size() * 4;
smp->length = windowSize < smpMemPos ? signalIndex.size() * 4 : 0;
dftCalcCount++;
}
if ((smp->sequence - lastSequence) > 1)
@ -407,7 +413,7 @@ public:
lastSequence = smp->sequence;
if (runDft)
if(runDft && windowSize < smpMemPos)
return Reason::OK;
return Reason::SKIP_SAMPLE;