简体   繁体   English

使用Python中的Kalman滤波器滤除加速度计噪声

[英]Filter out the accelerometers noise using Kalman filter in Python

I get from a socket a stream of data from an accelerometer with a lot of noise. 我从插座上获得了来自加速度计的大量数据流。

something like this:
...
-0.014532123
0.183950298
0.003323536
-0.342343526
...

I tried with low pass filter but I can't get a really smoothed result.. I think I need to use Kalman filter so I have to implement a function that "corrects" every element of the stream 我尝试使用低通滤波器,但无法获得真正平滑的结果。.我想我需要使用卡尔曼滤波器,因此我必须实现一个“校正”流中每个元素的函数

stream_element_out = kalman(stream_element_in)

I'm using python and I searched all over the web, finding many examples, but I can't understand how I can apply it to my project :).. someone can explain me an easy way to implement this algorithm please? 我使用的是python,我在网上搜索了很多示例,但我不明白如何将其应用于我的项目:) ..有人可以向我解释一种实现此算法的简单方法吗? :) :)

Taking an average of the last x results could do the smoothing. 取最后x结果的平均值可以进行平滑。

x would be a constant that can be tweaked for the best results depending on your application x将是一个常数,可以根据您的应用程序对其进行调整以获得最佳结果

You can also filter out input that is more than y off from the average of the last x numbers. 您还可以过滤掉最后x数字的平均值大于y输入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM