[core] change estimator CUSUM design params for loss to reduce oscillations. rename var.
This commit is contained in:
parent
bb02989f42
commit
b2a8f9ce9f
|
@ -139,7 +139,7 @@ SWITCH_DECLARE(switch_bool_t) switch_kalman_cusum_init(cusum_kalman_detector_t *
|
|||
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 P=0;
|
||||
|
@ -153,8 +153,8 @@ SWITCH_DECLARE (switch_bool_t) switch_kalman_cusum_detect_change(cusum_kalman_de
|
|||
|
||||
detector->N++;
|
||||
current_average = detector->last_average + (measurement - detector->last_average)/detector->N ;
|
||||
if (rtt_avg > current_average) {
|
||||
current_average = rtt_avg;
|
||||
if (avg > current_average) {
|
||||
current_average = avg;
|
||||
}
|
||||
current_q = detector-> last_q + (measurement - detector->last_average) * (measurement - current_average);
|
||||
if (detector->N != 0)
|
||||
|
|
|
@ -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]));
|
||||
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]));
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue