Merge PR #400: Improve adaptive logging filter

This commit is contained in:
Jenkins nymea 2021-04-19 11:38:20 +02:00
commit b62060d57d

View File

@ -124,11 +124,11 @@ void StateValueFilterAdaptive::update()
m_outputValueCount++;
}
}
// Poor mans solution to calculate standard deviation. Not as precise, but much faster than looping over history again
m_standardDeviation = ((m_standardDeviation * m_windowSize) + qAbs(changeRatioToAverage)) / (m_windowSize + 1);
}
// Poor mans solution to calculate standard deviation. Not as precise, but much faster than looping over history again
m_standardDeviation = ((m_standardDeviation * m_windowSize) + qAbs(changeRatioToAverage)) / (m_windowSize + 1);
// reset stats on overflow of counters
if (m_inputValueCount < m_outputValueCount) {
m_outputValueCount = 0;