32 RTFilterBase(windowSize), filterWidthInSec(0.001f * filterWidthInMs)
37 RTFilterBase(windowSize), filterWidthInSec(filterWidth.toSecondsDouble())
59 double weightedSum = 0;
60 double sumOfWeight = 0;
63 auto newestTimestamp =
dataHistory.rbegin()->first.toMilliSecondsDouble();
66 double quotient = (2 * sigma * sigma);
67 double quotient2 = sigma * sqrt2PI;
71 double value = it->second;
72 double diff = 0.001 * (it->first.toMilliSecondsDouble() - newestTimestamp);
74 double squared = diff * diff;
75 const double gaussValue = std::exp(-squared / quotient) / (quotient2);
76 sumOfWeight += gaussValue;
77 weightedSum += gaussValue *
value;
81 result = weightedSum / sumOfWeight;