-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any tool to calculate the coefficient A,B and C for formula 'd=A*(r/t)^B+C'? #47
Comments
0.25 43 4.4.4 |
We imported out data into R (the free statistical computing software) and used the nls function (non-linear least squares) to fit the data with a power curve. Here is the power curve equation we used: function(x, b0, b1, b2) {b0 + b1*(x^b2)} The nls function solves for the coefficients b0, b1, and b2 which are used in our formula for A, B, and C. Here's a tutorial on curve fitting in R for more information http://www.walkingrandomly.com/?p=5254 @RichardFans, if you can use the procedure above to get the coefficients, I will add them to the project for the device you mention. |
please wait for us to do more test. in addition, we use this beacon for the test above: |
Is there a way to disable ModelSpecificDistance calculations. We are not using the distance feature of the beacon. We need to only identify a beacon and don't need to know how far the beacon is from the mobile device. If it is not possible ti disable, is there already a list for popular android devices. We may not be able to do the above mentioned tests as done by RichardFans. |
@jessolo, there is no need to disable these calculations. By default, if the Android device model using the library is not in the built-in list, then the library will fall back to using the calculations for the Nexus 5. The consequence of the fallback is less accurate distance estimates. But if you don't use the distance estimates, then it doesn't matter to you. |
Actually it is detecting the default model. But it throws a Runtime On Fri, Nov 14, 2014 at 3:51 PM, David G. Young notifications@github.com
|
This is certainly not expected behavior. Can you please attach a stack trace of the exception? |
InputStream stream = ModelSpecificDistanceCalculator.class.getResourceAsStream("/"+path); But the above exception is definitely not because of this. It is possible to load from the web and the file is getting saved. But unable to read from the file. |
Hi, David. I've tried to get A, B and C coefficients for ASUS Zenfone 4 using procedure that you've posted for RichardFans. But I've got some errors while trying to do that. I use a vector of RSSI values as xdata, vector of measured distance values as ydata and function that you've posted above. I set initial value of b0 to 0.1, b1 = 1, b2 = 0.1. Unfortunately, I have no experience with R software, so I may do mistakes in script. Could you please help me to fix them, if they appeared. So, here is my example script for several measured values: xdata = c(-41,-47,-49,-52,-57) plot(xdata,ydata) b0 = 0.1 fit = nls(ydata ~ b0 + b1*(b2^xdata), start=list(b0=b0,b1=b1,b2=b2)) summary(fit) new = data.frame(xdata = seq(min(xdata),max(xdata),len=200)) sum(resid(fit)^2) confint(fit) Thank you in advance. |
One issue with your approach is the use of raw RSSI values instead of the ratio of measured RSSI over RSSI at 1 meter. This is what we plot against distance to solve for the formula coefficients. I also recommend that you capture more data for the best results (with distances up to ~20 meters at least). I’m also not an R expert so I’m not sure if your method is wrong, I can just say that it’s a little different than what we did. Instead of having powerfit.r:
Nexus5.csv:
You can get the coefficients from these with the following command:
|
Ok, thanks a lot. I captured some values just for test and I'll do more measurements for getting coefficients. The main problem was using raw RSSI values, I think. Because in this case I've got an model error or infinite loop error while running the script. |
Hi i tried to calculate the coefficients as well, for the test i used jnebeker values and i'm getting the same Power Curve Coefficients as him. Are these allready the Coefficients that need to be defined in the model-distance-calculations.json? I tried to do this with the values that were used to get the Nexus5 in the .json but im getting completly different Coefficients.
I used these http://altbeacon.github.io/android-beacon-library/distance-calcs/nexus5.html
This is what im getting:
How do i get to these coefficients?
Thank you in advance. |
@Fiodora, your method is correct. One reason for the difference in coefficients is that these coefficients:
were calculated using a different data set, so you should be getting different values. The steps you're following to get the coefficients for the data on this page are correct, but the ratio values you calculated appear to be slightly off. Instead of dividing by the iPhone 5S average RSSI at 1 meter when calculating the ratio, divide by the Nexus 5 RSSI at 1 meter. In the distance formula we want the RSSI ratio to be of measurements from the same device. The reason we have the separate iPhone 5S value is to provide an absolute reference for a known device, which we can use to account for the slight differences in power for different beacons. Here are the ratio values and corresponding coefficients that I calculated for this data:
I will update the Nexus 5 example measurements page to reflect these coefficients to prevent any further confusion. |
can sone one help how to do coeffient values for Samsung Galaxy, Samsung Note, LG to find the distance for ibeacons in android.appreciate your help? |
@RichardFans do you still have the original data of the phones you tested, including the iPhone 5s reference value at 1 meter? It would be great if you could send this to me, we are working on putting together a database. |
we just have done RSSI measurements on Xiaomi3/2s/4, and want to know how to calculate the coefficient, so that we can add the results to model-distance-calculations.json.
The text was updated successfully, but these errors were encountered: