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:
parent
32aadb3a5e
commit
849876a349
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue