0

I am wanting to know the formula of calculating the percentage of a value between two numbers, for example -65dBm is 100% signal and -93dBm is 0% signal.

I'd like to know the formula of a value between those two numbers, example: I need to know what the percentage will be if the signal level is at 70dBm.

  • 2
    There will be plenty of ways to model this since you have only provided two data points (65,100) and (93,0). You could use a linear curve, an exponential curve, or some other logically crafted choice suiting the situation you want to model. Any choice of model should be backed up by some logic concerning the real world situation you want to model. – String Apr 08 '19 at 09:03
  • I have no idea what you're saying but all I am wanting is the percent of a value between those two data points. – Raymond Rudman Apr 08 '19 at 09:07
  • 2
    I think it would be wise to not consider desibel values, because they have quite unlinear relationships. Try to convert the values to their physical, real-world counterparts. – Matti P. Apr 08 '19 at 09:11

1 Answers1

1

Here are two suggestions to show you why your question is not well defined per se. I have suggested two possible curves to model data points between the known extremes at $(65,100)$ and $(93,0)$. Which curve do you prefer and why?

enter image description here

String
  • 18,395
  • Okay this is a little bit complicated and confusing but to me it looks like the blue would be correct. What is the formula to calculate that percentage (82.14) – Raymond Rudman Apr 08 '19 at 09:36
  • @RaymondRudman: That would be: $$p=\frac{100}{65-93}(x-93)$$ – String Apr 08 '19 at 09:38
  • Thank you, have created my code from what you said and everything is working :)

    $percentage = 100 - (($max + ($current*-1)) * 100 / ($max - $min));

    – Raymond Rudman Apr 08 '19 at 10:40