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: dump phase, freq, amp of channel 1 outside signal calc loop

This commit is contained in:
Manuel Pitz 2021-06-23 20:34:40 +02:00
parent b26625184f
commit 4a8ce2097f

View file

@ -384,6 +384,7 @@ public:
maxF = estimate.x;
maxA = estimate.y;
}
}
<<<<<<< HEAD
if (dftCalcCnt > 1) {
@ -398,13 +399,21 @@ public:
smp->data[i * 4 + 2].f = atan2(dftResults[i][maxPos].imag(), dftResults[i][maxPos].real()); /* Phase */
smp->data[i * 4 + 3].f = 0; /* RoCof */
if (phasorPhase)
phasorPhase->writeData(1, &(smp->data[i * 4 + 2].f));
if (phasorAmplitude)
phasorAmplitude->writeData(1, &(smp->data[i * 4 + 1].f));
}
}
//the following is a debug output and currently only for channel 0
if (windowSize < smpMemPos){
if (phasorFreq)
phasorFreq->writeData(1, &(smp->data[0 * 4 + 0].f));
if (phasorPhase)
phasorPhase->writeData(1, &(smp->data[0 * 4 + 2].f));
if (phasorAmplitude)
phasorAmplitude->writeData(1, &(smp->data[0 * 4 + 1].f));
}
smp->length = windowSize < smpMemPos ? signalIndex.size() * 4 : 0;
dftCalcCount++;