|
@@ -0,0 +1,22 @@
|
|
|
|
+http://kazus.ru/forums/showthread.php?p=1025804#
|
|
|
|
+
|
|
|
|
+typedef struct
|
|
|
|
+{
|
|
|
|
+ float Result; //đĺçóëüňčđóţůĺĺ çíŕ÷ĺíčĺ
|
|
|
|
+ float Value; //čńőîäíîĺ çíŕ÷ĺíčĺ
|
|
|
|
+ float Previous; //đĺçóëüňŕň âű÷čńëĺíč˙ â ďđĺäűäóůĺé číňĺđŕöčč
|
|
|
|
+ float K; //ęîýôôčöčĺíň ńňŕáčëčçŕöčč, ďî-óěîë÷ŕíčţ = 0.1
|
|
|
|
+} KalmanFloatTypeDefStruct;
|
|
|
|
+
|
|
|
|
+void KalmanFloatCalc (KalmanFloatTypeDefStruct * KalmanFloatStruct)
|
|
|
|
+{
|
|
|
|
+ KalmanFloatStruct->Result = KalmanFloatStruct->K * KalmanFloatStruct->Value;
|
|
|
|
+ KalmanFloatStruct->Value = 1.0 - KalmanFloatStruct->K;
|
|
|
|
+ KalmanFloatStruct->Previous *= KalmanFloatStruct->Value;
|
|
|
|
+ KalmanFloatStruct->Result += KalmanFloatStruct->Previous;
|
|
|
|
+ KalmanFloatStruct->Previous = KalmanFloatStruct->Result;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+-=-=-=-=-
|
|
|
|
+Âç˙ňî îňńţäŕ:
|
|
|
|
+http://avrproject.ru/publ/poleznaja_informacija/filtr_kalmana_bascom_avr/4-1-0-164
|