pub struct Kalman { /* private fields */ }Expand description
Kalman filter over the one-way delay gradient, per draft-ietf-rmcat-gcc-02 §5.3.
§What it is for
A single inter-group delay measurement is mostly noise: scheduling jitter at either end, the receiver’s clock resolution, and TWCC’s 250 µs quantisation all move it around by more than the signal does early on. The filter estimates the trend — is the queue growing, and how fast — while adapting how much it trusts each new measurement to how noisy the measurements have been.
§Pure
No clock, no allocation, no state beyond four numbers. Every input is a parameter, which is what lets upstream’s table-driven vectors port directly.
Implementations§
Source§impl Kalman
impl Kalman
Sourcepub fn with_process_noise(self, process_noise: f64) -> Self
pub fn with_process_noise(self, process_noise: f64) -> Self
How fast the underlying gradient is assumed to drift. Larger tracks faster and is noisier.
Sourcepub fn update(&mut self, measurement: f64) -> f64
pub fn update(&mut self, measurement: f64) -> f64
Fold in one inter-group delay measurement and return the updated estimate.
measurement is arrival spread minus departure spread for a pair of groups, in
milliseconds.
Sourcepub fn update_with_period(&mut self, measurement: f64, period_ms: f64) -> f64
pub fn update_with_period(&mut self, measurement: f64, period_ms: f64) -> f64
update for a group that departed period_ms after the one before: the weight of the
sample in the noise variance is 1 - alpha, alpha = (1 - chi)^(30 / (1000 f_max)),
f_max the highest group rate over the last PERIOD_HISTORY groups (section 5.3).