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

hook-rms: fix integration error. previously using the next value to

update accumulator
This commit is contained in:
Steffen Vogel 2022-04-08 16:47:31 +02:00
parent 32aadb3a5e
commit 849876a349

View file

@ -102,12 +102,12 @@ public:
/* Square the new value */
double newValue = pow(smp->data[index].f, 2);
/* Get the old value from the history */
double oldValue = smpMemory[i][smpMemoryPosition % windowSize];
/* Append the new value to the history memory */
smpMemory[i][smpMemoryPosition % windowSize] = newValue;
/* Get the old value from the history */
double oldValue = smpMemory[i][(smpMemoryPosition + 1) % windowSize];
/* Update the accumulator */
accumulator[index] += newValue;
accumulator[index] -= oldValue;