mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
reanable the average
This commit is contained in:
parent
3a7ddb0f75
commit
3b0d89c525
1 changed files with 3 additions and 3 deletions
|
@ -83,7 +83,8 @@ public:
|
|||
info("parsed config thresh=%f signal_index=%d", thresh, idx);
|
||||
|
||||
avg_array = new double[avg_length];
|
||||
//avg_array = {0};
|
||||
for ( uint i = 0; i < avg_length; i++)
|
||||
avg_array[i] = 0;
|
||||
|
||||
|
||||
state = State::PARSED;
|
||||
|
@ -102,7 +103,6 @@ public:
|
|||
if (isEdge) {
|
||||
if (edgeCounter >= 1){
|
||||
double currentSmpRate = (double)(seqNr - lastSeqNr);
|
||||
|
||||
realSmpRateAvg += (currentSmpRate - avg_array[avg_pos % avg_length]) / avg_length;
|
||||
avg_array[avg_pos % avg_length] = currentSmpRate;
|
||||
avg_pos++;
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
|
||||
lastSeqNr = seqNr;
|
||||
|
||||
info("Edge detected: seq=%u, realTime.sec=%ld, realTime.nsec=%ld, smpRate=%f.10", seqNr, realTime.tv_sec, realTime.tv_nsec, realSmpRateAvg);
|
||||
info("Edge detected: seq=%u, realTime.sec=%ld, realTime.nsec=%ld, smpRate=%f", seqNr, realTime.tv_sec, realTime.tv_nsec, realSmpRateAvg);
|
||||
|
||||
edgeCounter++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue