android – 过滤加速度计数据噪声

如何在Android中过滤加速度计数据的噪音?我想为我的样品数据创建一个高通滤波器,以便我可以消除低频分量,并专注于高频分量。我已经读过卡尔曼滤波器可能是最好的候选人,但是如何在我的应用程序中集成或使用这种方法,这些方法将主要用Android Java编写?还是可以首先完成?还是通过Android NDK?有没有机会这样做可以实时完成?

任何想法都将不胜感激。谢谢!

苹果SDK的样本实际上是以更简单的方式实现过滤,即通过使用斜率:

//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];
http://stackoverflow.com/questions/1638864/filtering-accelerometer-data-noise

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:android – 过滤加速度计数据噪声