pion / interceptor

Pluggable RTP/RTCP processors for building real time communication
https://pion.ly/
MIT License
104 stars 51 forks source link

Fix variance calculation for exponentialMovingAverage #223

Closed alexpokotilo closed 5 months ago

alexpokotilo commented 5 months ago

Variance calculation for exponentialMovingAverage was incorrect

Description

Current equation is a.variance = (1 - decreaseEMAAlpha) (a.variance + decreaseEMAAlphaxx) => a.variance = a.variance - decreaseEMAAlphaa.variance + decreaseEMAAlphaxx - decreaseEMAAlpha decreaseEMAAlphax*x this is not correct. Proposed version is correct one

@mengelbart could you please review my version ?

Reference issue

alexpokotilo commented 5 months ago

@mengelbart could you please review my version ?

alexpokotilo commented 5 months ago

new request submitted containing this fix