Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
19555481
提交
19555481
authored
10月 07, 2016
作者:
Mike Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9581: [windows] fix function signatures in switch_estimators.c
上级
241bbd15
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
switch_estimators.c
src/switch_estimators.c
+7
-7
没有找到文件。
src/switch_estimators.c
浏览文件 @
19555481
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
* (Phil Kim book)
* (Phil Kim book)
*
*
*/
*/
void
switch_kalman_init
(
kalman_estimator_t
*
est
,
float
Q
,
float
R
)
SWITCH_DECLARE
(
void
)
switch_kalman_init
(
kalman_estimator_t
*
est
,
float
Q
,
float
R
)
{
{
est
->
val_estimate_last
=
0
;
est
->
val_estimate_last
=
0
;
est
->
P_last
=
0
;
est
->
P_last
=
0
;
...
@@ -112,7 +112,7 @@ constants:
...
@@ -112,7 +112,7 @@ constants:
epsilon = 0.005
epsilon = 0.005
h = 0.05
h = 0.05
*/
*/
switch_bool_t
switch_kalman_cusum_init
(
cusum_kalman_detector_t
*
detect_change
,
float
epsilon
,
float
h
)
SWITCH_DECLARE
(
switch_bool_t
)
switch_kalman_cusum_init
(
cusum_kalman_detector_t
*
detect_change
,
float
epsilon
,
float
h
)
{
{
cusum_kalman_detector_t
*
detector_change
=
detect_change
;
cusum_kalman_detector_t
*
detector_change
=
detect_change
;
...
@@ -141,7 +141,7 @@ switch_bool_t switch_kalman_cusum_init (cusum_kalman_detector_t *detect_change,
...
@@ -141,7 +141,7 @@ switch_bool_t switch_kalman_cusum_init (cusum_kalman_detector_t *detect_change,
return
TRUE
;
return
TRUE
;
}
}
switch_bool_t
switch_kalman_cusum_detect_change
(
cusum_kalman_detector_t
*
detector
,
float
measurement
,
float
avg
)
SWITCH_DECLARE
(
switch_bool_t
)
switch_kalman_cusum_detect_change
(
cusum_kalman_detector_t
*
detector
,
float
measurement
,
float
rtt_avg
)
{
{
float
K
=
0
;
float
K
=
0
;
float
P
=
0
;
float
P
=
0
;
...
@@ -155,8 +155,8 @@ switch_bool_t switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detect
...
@@ -155,8 +155,8 @@ switch_bool_t switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detect
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
(
avg
>
current_average
)
{
if
(
rtt_
avg
>
current_average
)
{
current_average
=
avg
;
current_average
=
rtt_
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
)
...
@@ -194,7 +194,7 @@ switch_bool_t switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detect
...
@@ -194,7 +194,7 @@ switch_bool_t switch_kalman_cusum_detect_change(cusum_kalman_detector_t * detect
/* Kalman filter abstract ( measure and estimate 1 single value per system model )
/* Kalman filter abstract ( measure and estimate 1 single value per system model )
* Given the measurment and the system model together with the current state ,
* Given the measurment and the system model together with the current state ,
* the function puts an estimate in the estimator struct */
* the function puts an estimate in the estimator struct */
switch_bool_t
switch_kalman_estimate
(
kalman_estimator_t
*
est
,
float
measurement
,
int
system_model
)
SWITCH_DECLARE
(
switch_bool_t
)
switch_kalman_estimate
(
kalman_estimator_t
*
est
,
float
measurement
,
int
system_model
)
{
{
/*system model can be about: loss, jitter, rtt*/
/*system model can be about: loss, jitter, rtt*/
float
val_estimate
;
float
val_estimate
;
...
@@ -237,7 +237,7 @@ switch_bool_t switch_kalman_estimate (kalman_estimator_t * est, float measuremen
...
@@ -237,7 +237,7 @@ switch_bool_t switch_kalman_estimate (kalman_estimator_t * est, float measuremen
return
SWITCH_TRUE
;
return
SWITCH_TRUE
;
}
}
switch_bool_t
switch_kalman_is_slow_link
(
kalman_estimator_t
*
est_loss
,
kalman_estimator_t
*
est_rtt
)
SWITCH_DECLARE
(
switch_bool_t
)
switch_kalman_is_slow_link
(
kalman_estimator_t
*
est_loss
,
kalman_estimator_t
*
est_rtt
)
{
{
float
thresh_packet_loss
=
5
;
/* % */
float
thresh_packet_loss
=
5
;
/* % */
float
thresh_rtt
=
0
.
8
;
/*seconds*/
float
thresh_rtt
=
0
.
8
;
/*seconds*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论