[core] change estimator CUSUM design params for loss to reduce oscillations. rename var.

This commit is contained in:
Dragos Oancea 2020-06-01 11:41:36 +00:00 committed by Andrey Volk
parent bb02989f42
commit b2a8f9ce9f
2 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@ SWITCH_DECLARE(switch_bool_t) switch_kalman_cusum_init(cusum_kalman_detector_t *
return TRUE; return TRUE;
} }
SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detector, float measurement, float rtt_avg) SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detector, float measurement, float avg)
{ {
float K=0; float K=0;
float P=0; float P=0;
@ -153,8 +153,8 @@ SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_de
detector->N++; detector->N++;
current_average = detector->last_average + (measurement - detector->last_average)/detector->N ; current_average = detector->last_average + (measurement - detector->last_average)/detector->N ;
if (rtt_avg > current_average) { if (avg > current_average) {
current_average = rtt_avg; current_average = avg;
} }
current_q = detector-> last_q + (measurement - detector->last_average) * (measurement - current_average); current_q = detector-> last_q + (measurement - detector->last_average) * (measurement - current_average);
if (detector->N != 0) if (detector->N != 0)

View File

@ -1953,7 +1953,7 @@ static void rtcp_stats_init(switch_rtp_t *rtp_session)
rtp_session->detectors[EST_RTT] = switch_core_alloc(rtp_session->pool, sizeof(*detectors[0])); rtp_session->detectors[EST_RTT] = switch_core_alloc(rtp_session->pool, sizeof(*detectors[0]));
switch_kalman_cusum_init(rtp_session->detectors[EST_RTT],0.005,0.5); switch_kalman_cusum_init(rtp_session->detectors[EST_RTT],0.005,0.5);
rtp_session->detectors[EST_LOSS] = switch_core_alloc(rtp_session->pool, sizeof(*detectors[0])); rtp_session->detectors[EST_LOSS] = switch_core_alloc(rtp_session->pool, sizeof(*detectors[0]));
switch_kalman_cusum_init(rtp_session->detectors[EST_LOSS],0.005,0.5); switch_kalman_cusum_init(rtp_session->detectors[EST_LOSS], 0.5, 1);
} }
} }