Theory behind ARMA and Running Average filter and are there any alternative algorithms for calculating distance from RSSI of signal?

99封情书 提交于 2021-01-29 04:55:27

问题


I can see that the Android Bacon Library features two algorithms for measuring distance: the running average filter and the ARMA filter.

How are these related to the library's implementation (apart from using the filter's formula)? Where can I find some background information about these that explains the theory behind it? Are there any known alternative algorithms that can be studied and tried out for measuring the distance?


回答1:


There are two basic steps to giving a distance estimate on BLE beacons.

  1. Collect RSSI samples

  2. Convert RSSI samples to a distance estimate.

Both of these steps have different possible algorithms. The ARMA and Running Average filters are two different algorithms used for collecting the RSSI samples.

Understand that beacon send out packets at a periodic rate, typically at 1-10 times per second. Each of these packets, when received by the phone will have its own signal level measurement called RSSI. Because of radio noise and measurement error, there is a large amount of variance on each RSSI sample which can lead to big swings in distance estimates. So typically you want to take a number of RSSI samples and average them together to reduce this error.

The running average algorithm simply takes 20 seconds worth of samples (by default, the time period is configurable), throws out the top and bottom 10 percent of the RSSI readings and takes the mean of the remainder. This is similar to how iOS averages samples, so it is the default algoritm for the library for cross-platform compatibility reasons. But it has the disadvantage that the distance estimate lags behind, telling you where the phone is relative to the beacon an average of 10 seconds ago. This may be inappropriate for use cases where the phone is moving relative to the beacon.

The ARMA (Autoregressive Moving Average) algorithm statistically weights the more recent samples more heavily that the older samples, leading to less lag in the distance estimates. But its behavior can be a bit indeterminate and is subject to more varying performance in different radio conditions.

Which algorithm is right for you depends on your use case. Testing both to see which performs better for you is generally the best approach. While there are other possible algorithms for data collection, these are the only two built in to the library. Since it is open source, you are welcome to create your own and submit them as a pull request.

For step 2, there are also a number of possible algorithms. The two most common are a curve fitted formula and a path loss formula. The curve fitted formula is the library default and the path loss alternative is available only in a branch of the library under development. You are welcome to use the latter, but it requires building the library from source. Again, as an open source library you are welcome and encouraged to develop your own alternative algorithms.



来源:https://stackoverflow.com/questions/37387814/theory-behind-arma-and-running-average-filter-and-are-there-any-alternative-algo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!