过滤加速度数据中的噪声 [英] Filtering accelerometer data noise

查看:512
本文介绍了过滤加速度数据中的噪声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何过滤在Android上的加速度数据的噪音?我想创造一个高通滤波器,用于我的样本数据,这样我可以消除低频分量,并专注于高频成分。我已阅读,卡尔曼滤波可能是我们的最佳人选,但如何整合或使用此方法在我的应用程序,将主要写的Andr​​oid的Java?或者可以将它摆在首位做些什么呢?或通过的Andr​​oid NDK?是否有任何机会,这可以实时完成?

How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high frequency components. I have read that Kalman filter might be the best candidate for this, but how do I integrate or use this method in my application which will mostly written in Android Java? or can it be done in the first place? or through Android NDK? Is there by any chance that this can be done in real-time?

任何想法会更加AP preciated。谢谢!

Any idea will be much appreciated. Thank you!

推荐答案

从苹果公司的SDK样品实际实现过滤以更简单的方式是利用斜坡:

The samples from Apple's SDK actually implement the filtering in an even simpler way which is by using ramping:


//ramp-speed - play with this value until satisfied
const float kFilteringFactor = 0.1f;

//last result storage - keep definition outside of this function, eg. in wrapping object
float accel[3]; 

//acceleration.x,.y,.z is the input from the sensor

//result.x,.y,.z is the filtered result

//high-pass filter to eliminate gravity
accel[0] = acceleration.x * kFilteringFactor + accel[0] * (1.0f - kFilteringFactor);
accel[1] = acceleration.y * kFilteringFactor + accel[1] * (1.0f - kFilteringFactor);
accel[2] = acceleration.z * kFilteringFactor + accel[2] * (1.0f - kFilteringFactor);
result.x = acceleration.x - accel[0];
result.y = acceleration.y - accel[1];
result.z = acceleration.z - accel[2];

这篇关于过滤加速度数据中的噪声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆