Used rangedbeacon.setSampleExpritation() but it makes the getdistance() imprecise - android

I'm using the altbeacon library to implement an indoor navigation application using ibks beacons, but my problem is that I want a fast scan so I used the setSampleExpiration method and set it to 10 seconds, but now the distances are imprecise. How can I have a good precision with a faster scan ?

When using Bluetooth LE to get distance estimates there is always a tradeoff between accuracy and the number of statistical samples. Because there is a lot of noise on RSSI, you need lots of samples to filter it out.
Reducing the sampling time from the default of 20 seconds to 10 seconds will make estimates change more quickly, but at the cost of this accuracy.
One thing you can do is increase the number of signal measurements. If you can increase the advertising rate on the ibks beacon (for example from 1 Hz to 10 Hz) then you will have more samples and get better estimates.

Related

Difference between RunningAverageRssiFilter, ArmaRssiFilter, Kalman filter in Altbeacon SDK

I understand that we can have different implementations for RssiFilter using setRssiFilterImplClass in Altbeacon SDK. I tried out all above filters (RunningAverageRssiFilter, ArmaRssiFilter, Kalman filter) and i found that there is not much difference in distances which i got. So what is the exact difference and what is the use case where in i have to select one of these filters.
The Android Beacon Library allows different ways to filter the noise out of Bluetooth LE beacon signal strength measurements so that distance estimates are as accurate as possible.
For most users it doesn't matter which of these mechanisms you use to filter RSSI, as you have seen, they all work similarly. Variations between filters matter mostly for moving beacons. Each filter will introduce "lag" in the distance estimate when the beacon is moving.
A quick summary:
RunningAverageRssiFilter (Default): Takes the mean value of the last 20 seconds worth of RSSI measurements for a single beacon. For moving beacons, this means that the distance estimate will tell you where the beacon was (on average) over the last 20 seconds, which for beacons moving in a straight line be where it was 10 seconds ago. The default 20 second averaging interval is configurable. This is the default because it is similar to the way Apple CoreLocation works, so it is useful for cross-platform compatibility.
ArmaRssiFilter: The 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.
KalmanFilter: There is no implementation included in the library, although there is a feature request for one. In theory, a Kalman Filter uses a statistical predictive model to try to discern the difference between noise and signal, and filter out the noise. There are many variants of Kalman Filters, and different variants may be better or worse at reducing noise in specific conditions.

Room finder using closest Beacon device

I have 10 beacon device and 10 room. Consider 1/Room and i want to know currently where i am?
For this : already use mBeconManager.setRangeNotifier and arrange beacon list in desc order on "Distance" basic.
And display room as per less distance.
But the process is very slow.
Beacon : eddystone Beacon
Platform: android
Lib: Altbeacon
Is there any other best way for this scenario or example? Can i use mBeconManager.addMonitorNotifier method?
Thanks in advance?
In general, it sounds like you are taking the right approach by sorting the results of didRangeBeaconsInRegion callback.
However, you should be aware that the beacon.distance estimate is are based on a running average of all the RSSI readings received in the past 30 seconds, which may be too long of an averaging time for your use case. You can make the distance estimates be based on a shorter 5 second averaging interval with code like below:
RunningAverageRssiFilter.setSampleExpirationMilliseconds(5000l);
However, if you do this, be warned that this will increase the "noise" on your distance estimates. To counteract this as much as possible, configure your beacons to advertise as much as you can, at least at 10Hz.
Read more here.

calculate distance from beacon when user is moving in a vehicle

How to calculate distance using BLE beacons if the user is moving in a vehicle with 2-15kmph speed?Also,if the distance won't give me accurate results is there any other mechanism with the help of which I can calculate the nearest beacon.The default implementation does not give me proper results as there is a 20sec lag in distance estimates.
Secondly,in which cases should ARMA filter be used.
Beacon distance estimates are only estimates, so you must set accuracy expectations accordingly. In order to reduce noise on radio signal levels, many samples are averaged over a period of time.
Figuring out the appropriate averaging time depends on the use case. As you have noted, the Android Beacon Library uses a 20 second running average by default. This gives a distance estimate based on where the vehicle was on average over the past 20 seconds.
For a vehicle going up to 15km/hour (~5 meters / sec) with a beacon transmission radius of 50 meters, it will be in range of the beacon for a maximum of 10 seconds. How many distance measurements do you need to get? If one is enough, average over 10 seconds. If you need more, set the period even shorter.
Understand that reducing the sample interval will add more noise error to the distance estimates, because you will have fewer statistical samples to work with. A few things you can do to make the most of the samples you do get:
Set the beacon to advertise as frequently as possible. Some beacons advertise at 1Hz or less to save battery. This leads to poor distance estimates. Increase it to 10Hz or more if possible.
Turn off bluetooth configurability/connectability on your beacon. Some Android devices will only allow one signal level sample per BLE scan (1.1 secs by default in the library) in connectable mode. This can lose you 90% of your samples at 10 Hz.
Configure the beacon transmitter to be on its highest power setting and calibrate it properly. Stronger signals have a higher signal to noise ratio, giving better distance estimates.
The ARMA filter uses a nondeterministic sample interval based on % change in each sample. It is more appropriate for use cases with slow moving beacon receivers.

How to improve Bluetooth distance measuring using RSSI?

For my project I need to estimate the distance between a Smartphone and a bluetooth module. The Estimation doesn't have to be very precise. I only need to determine the distance with a margin of error of about 50cm.
I did test the RSSI of two bluetooth modules at distance-steps of 10 cm. I measured the RSSI 5 times for each step and got the average of the 5 measurements. The averages are shown in the graph below:
The red and blue lines resemble the two Bluetooth modules. You can see that the results are not very linear. One of the reasons for this is interference, so i searched for ways to tackle the interference issue. Two ways i found are:
Signal Noise Ratio(SNR): Understanding ibeacon distancing
ratio of the iBeacon signal strength (rssi) over the calibrated transmitter power (txPower). The txPower is the known measured signal strength in rssi at 1 meter away: http://www.princeton.edu/~achaney/tmve/wiki100k/docs/Signal-to-noise_ratio.html
However i don't really understand how the above techniques would be used to get more accuracy. For SNR i need the Noise value, how do i even get the Noise value?
For ratio rssi/txPower, I can get the txPower by simply measuring the rssi at 1 meter from the module. So I know all the needed values. But I don't know what to do from here on out. How do i use these values to get a more accurate distance estimations?
Are there any other techniques i can use to improve accuracy?
You are running into the practical limitations on this technology. Getting estimation accuracy of +/- 50 cm may be possible under ideal conditions at short distances (under 2 meters) not at long distances of over 10 meters.
I wrote a longer blog post about the limits here: http://developer.radiusnetworks.com/2014/12/04/fundamentals-of-beacon-ranging.html
To answer your specific questions:
No, there is no practical way to know what part of a single RSSI measurement comes from signal and what part comes from noise. You can take an average over many samples, which partially removes noise if the transmitter and receiver are stationary over the sample interval.
The techniques you ask about do work to give you distance estimate, but they have the limitations of the technology described above.

Determining distance accuracy from beacon

I have couple of questions regarding the Radius networks Beacon.
How can we get the accurate distance between android devices and
beacon? So far the distance we're getting through
"android-beacon-library" is fluctuating.
How can we limit the beacon's transmission radius, say allowing
beacon to transmit only for 5 meters or to 20 cms ?
Please find the image with beacon distance reading for various devices (Moto g , Nexus 5 , Nexus 4 and iPhone 5s)
You will always see fluctuation on beacon distance estimates, so you have to set your expectations appropriately. Beacon distance estimating works by starting with a measurement of the radio signal strength using the bluetooth radio on the mobile device. A stronger signal means that the beacon is closer, where a weaker signal means the beacon is further away. The beacon transmits a reference value of its expected signal strength at 1 meter, saying in effect "If you are one meter away, you should see my signal level as -56 dBm". A formula inside the mobile phone then tries to make a guess of how far it is away based on the signal level at any given time. If the signal is a little bit weaker than -56dBm, such as -65dBm, the formula might estimate that the distance is 2.5 meters.
This technique is imperfect, and there are several reasons for fluctuation:
There is always background radio noise (like the static on an old AM radio) which causes individual signal strength measurements to vary.
There is error on the analog to digital converter inside the bluetooth radio, which also causes individual signal strength measurements to vary.
The bluetooth radio waves reflect off of some objects and are absorbed by others, making the actual signal strength change at different positions the same distance away, and when other objects in the vicinity move around.
The antenna pattern on both the transmitter and the receiver are not perfectly spherical. This means that when you rotate your phone or the beacon, you will see a slightly different signal level.
There are a few things you can do to minimize the error:
Use a beacon that transmits as frequently as possible, preferably at 10Hz or more. More transmissions mean more statistical samples of the signal level, which when averaged together help mitigate errors from sources 1 and 2 above.
Use as high of a transmitter power setting on your beacon as possible. The stronger the signal, the lower the noise level will be (relatively speaking) from source 1 above.
When possible, place your beacons where there is a clear line of sight to the receiving devices. Overhead often works best.
However, the best you can hope to do is reduce the variation as much as possible. You cannot eliminate it. For this reason, you must design your app so such variation is acceptable. If it helps your use case, you can also lower the beacon transmitter power so that devices only detect the beacon when they are relatively close.
Using Radius Networks' RadBeacon USB and RadBeacon Tag models, you can adjust the transmitter power using the free RadBeacon configuration app for iOS and OSX. The apps have a slider control to increase and decrease the transmitter power.
You should note, however, that by lowering the transmitter power, you will also increase the amount of variation on your distance estimates. This is because the signal to noise ratio will be lower.
Full disclosure: I am Chief Engineer for Radius Networks.
you can't really tell the distance to one beacon. That's why indoor localization is so hard.
you can't say exactly how far a beacon should transmit its signals, but on most beacons (I don't know about Radius networks) you can change the txPower / transmit power. This varies from beacon to beacon (and also depends on the environment around the beacon), so you'll have to do your own experiments to find the sweet spot.

Categories

Resources