Also include big jumps in the calculation for the standard deviation

pull/400/head
Michael Zanetti 2021-03-05 22:22:18 +01:00
parent 96ae3cd01a
commit 1b33015354
1 changed files with 3 additions and 3 deletions

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;