<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 卡爾曼濾波在單片機(jī)上的使用

          卡爾曼濾波在單片機(jī)上的使用

          作者: 時(shí)間:2016-11-29 來(lái)源:網(wǎng)絡(luò) 收藏






          #ifndef _KALMAN_H_
          #define _KALMAN_H_

          本文引用地址:http://www.ex-cimer.com/article/201611/323547.htm

          extern KalmanGain;// 卡爾曼增益
          extern EstimateCovariance;//估計(jì)協(xié)方差
          extern MeasureCovariance;//測(cè)量協(xié)方差
          extern EstimateValue;//估計(jì)值
          extern void KalmanFilterInit(void);
          extern KalmanFilter( Measure);
          #endif

          #include "config.h"
          #include "math.h"

          KalmanGain;// 卡爾曼增益
          EstimateCovariance;//估計(jì)協(xié)方差
          MeasureCovariance;//測(cè)量協(xié)方差
          EstimateValue;//估計(jì)值

          void KalmanFilterInit(void);

          extern float KalmanFilter(float Measure);


          void KalmanFilterInit(void)
          {
          EstimateValue=0;

          EstimateCovariance=0.1;
          MeasureCovariance=0.02;


          }

          KalmanFilter( Measure)
          {

          //計(jì)算卡爾曼增益
          KalmanGain=EstimateCovariance*sqrt(1/(EstimateCovariance*EstimateCovariance+MeasureCovariance*MeasureCovariance));

          //計(jì)算本次濾波估計(jì)值
          EstimateValue=EstimateValue+KalmanGain*(Measure-EstimateValue);
          //更新估計(jì)協(xié)方差

          EstimateCovariance=sqrt(1-KalmanGain)*EstimateCovariance;
          //更新測(cè)量方差
          MeasureCovariance=sqrt(1-KalmanGain)*MeasureCovariance;
          //返回估計(jì)值
          return EstimateValue;
          }



          關(guān)鍵詞: 卡爾曼濾波單片

          評(píng)論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();