机器人低通滤波器和高通滤波器 [英] Android Low pass filter and High pass filter

查看:465
本文介绍了机器人低通滤波器和高通滤波器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的问题。 什么是Android的情况下,加速度计的低通滤波器和高通滤波器?

I have a very basic question. What is Low Pass filter and High Pass filter in case of Android Accelerometer?

当我看到来自加速度传感器的输出,我看如果我不使用任何过滤器,(案例:我一直在我的手机上的空闲表)我得到ž轴+已经值。现在,如果我想使用基本的物理学,它给我确切值(9.8approx)的小克,即重力加速度。

When I see the output from the Accelerometer Sensor, I see If I don't use any filter, (Case : I kept my cell phone idle on table) I get z Axis +ve value. Now If I think using basic physics, it gives me exact value(9.8approx) for small g i.e Acceleration due to gravity.

要获得线性的加速,如果我添加任何势力把手机它会改变加速度值,但是这将是 G + A 我申请。因此,要获得 A 为什么我就不能直接从我从加速度计获取值减去?

To get the linear acceleration, If I add any force to phone it will change the Accelerometer value, but it will be g + a that I applied. So to get a why can't I just subtract directly from the value I am getting from Accelerometer?

有什么用?
基本定义我明白的低通:允许低价值,高通:允许高值。 请帮我理解这一点。我很困惑与此有关。

What is the use?
Basic definition I understand for low pass : To allow low value, High Pass : To allow high value. Please help me to understand it. I am confused with this.

推荐答案

如果你的文档,你会看到SensorEvent返回其重新presents所有力的矢量数组。 <一href="http://developer.android.com/reference/android/hardware/SensorEvent.html#values">http://developer.android.com/reference/android/hardware/SensorEvent.html#values 这是加速度的组件如何分解成各轴:

If you look at the documentation you will see that SensorEvent returns an array which represents the vector of all the forces. http://developer.android.com/reference/android/hardware/SensorEvent.html#values This is how the components of the acceleration break down into each axis:

 values[0] //acceleration on x axis
 values[1] //acceleration on y axis
 values[2] //acceleration on z axis

您需要找到哪个方向的重力在随后的分解到它的组成部分运行。重力力的大小永远是9.8但方向,因此它是如何分解成各组成部分,将发生变化。 假设的,我们可以得到重力的价值和存储载体,像一个数组重力[3]

You need to find which direction gravity is operating in then decompose that into its component parts. The magnitude of the gravity force will always be 9.8 but the direction, and hence how it breaks down into the component parts, will change. Assuming that we could get the value of gravity and store that vector in an array like gravity[3]:

 gravity[0] //gravity x axis
 gravity[1] //gravity y axis
 gravity[2] //gravity z axis

总加速度, T ,在手机上为 T = G + A 。为了得到公正 A 我们需要 A = T - 克

The total acceleration, T, on the phone is T = g + a. To get just a we would need a = T - g:

 linear_acceleration[0] = event.values[0] - gravity[0];
 linear_acceleration[1] = event.values[1] - gravity[1];
 linear_acceleration[2] = event.values[2] - gravity[2];

请注意这一切都计算逐元素,因为它是一个矢量运算。

Notice how this calculates everything element by element because it's a vector operation.

最棘手的部分是找到重力因为只有一个衡量两者的重力和其他势力,同时手机的加速度计。我们有2个,我们希望找到的一个传感器不同的力量。如果我们只能看看部队在一次孤立点,我们将无法提取信息。但是,我们确实得到样品在一定范围内的次通过查看力量随着时间的推移,我们可以提取的信息是如何变化的。

The tricky part is finding gravity because there is only one accelerometer in the phone which measures both the gravity AND the other forces at the same time. We have 2 different forces that we want to find from the one sensor. If we could only look at the forces at an isolated point in time we wouldn't be able to extract the information. However we do get samples over a range of times and by looking at how the forces change over time we can extract the information.

这意味着我们需要基于这些部队如何迅速改变从一个源的结果过滤掉。加速度的由于重力的大小不迅速改变,因为它不会改变的。重力是恒力。然而,其他部队将随时间而改变。如果我们筛选出缓慢变化力如重力通过使用高通滤波器则剩余力的快速变化的像的力被施加到电话。这就是为什么高通滤波器被使用。

This means we need to filter out the results from that one source based on how quickly those forces change. The magnitude of acceleration due to gravity does not change quickly because it doesn't change at all. Gravity is a constant force. However other forces will change over time. If we filter out the slow changing forces like gravity by using a high-pass filter then the remaining forces are the fast changing ones like the forces being applied to the phone. This is why the high-pass filter is used.

这篇关于机器人低通滤波器和高通滤波器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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