测试一:
原始数据: [-61,-68,-63,-61,-68,-63,-61,-68,-63,-80,-80,-81]
平滑,历史权重0.7: [-61,-63,-63,-62,-64,-64,-63,-64,-64,-69,-72,-75]
卡尔曼,q:0.04,r:0.1: [-61,-65,-64,-63,-65,-64,-63,-65,-64,-71,-75,-78]
高斯加权,$windowSize:5,$stdDev:1.0: [-64,-64,-64,-64,-64,-64,-64,-65,-69,-75,-79,-81]
测试二:
原始数据: [-61,-68,-63,-61,-68,-63,-61,-68,-63,-80,-61,-61,-68,-63]
平滑,历史权重0.7: [-61,-63,-63,-62,-64,-64,-63,-64,-64,-69,-66,-65,-66,-65]
卡尔曼,q:0.04,r:0.1: [-61,-65,-64,-63,-65,-64,-63,-65,-64,-71,-67,-64,-66,-65]
高斯加权,$windowSize:5,$stdDev:1.0: [-64,-64,-64,-64,-64,-64,-64,-65,-68,-70,-66,-64,-64,-65]
总结: 卡尔曼和高斯加权相对于简单的平滑都可以减少瞬间波动,但是当rssi正在发生有效变化的时候,卡尔曼和高斯加权相对于简单的平滑可以更加实时的跟随变化.
卡尔曼和高斯加权对比,高斯加权在发生瞬时波动的时候,下一次的数据返回影响较大,而卡尔曼滤波没有这个问题.
总结对于蓝牙rssi数据到处理,卡尔曼滤波更加适合.