33 filterWidthInSec(0.001f * filterWidthInMs)
40 filterWidthInSec(filterWidth.toSecondsDouble())
62 double weightedSum = 0;
63 double sumOfWeight = 0;
67 auto newestTimestamp =
dataHistory.rbegin()->first.toMilliSecondsDouble();
70 double quotient = (2 * sigma * sigma);
71 double quotient2 = sigma * sqrt2PI;
78 double value = it->second;
79 double diff = 0.001 * (it->first.toMilliSecondsDouble() - newestTimestamp);
81 double squared = diff * diff;
82 const double gaussValue = std::exp(-squared / quotient) / (quotient2);
83 sumOfWeight += gaussValue;
84 weightedSum += gaussValue *
value;
89 result = weightedSum / sumOfWeight;