Android how to get SNR (signal to noise ratio)

I was wondering if anyone knows how to programmatically get the SNR ratio or LTE / WCDMA signal to noise ratio of signals on Android phones. SNR can be viewed from the secret code * # 0011 # on Samsung models, but not on other phones, such as Nexus 5. I thought that if the API does not exist, maybe a calculation from existing APIs?

I know that you can get detailed information about the signals using the SignalStrength API, but I analyzed the details that I saw and can not find any SNR readings.

Any help or suggestions are welcome!

Thanks!

Additional Information:

I have to add that I was looking for Signal Strength from this topic [link] How to get the LTE signal strength in Android? , and so my starting point is for my question.

My results for the following:

LteSignalStrength β†’ fluctuates between 15-30 depending on the location, I do not know what it is.

LteRsrp β†’ shows dBm, I think this is how phones determine signal quality (just about anyway).

LteRsrq -> shows from -7 to -11, not sure

LteRssnr β†’ always 300 for some reason, I don’t know why ...

LteCqi β†’ Channel quality indicator? some huge amount that seems to be the maximum 32-bit integer value is not sure

Is there a way to get SNR from this API or am I looking for a nonexistent needle in a haystack?

Screenshot of Samsung GalaxyNote2 showing SNR from * # 0011 # secret code: enter image description here

+7
android
source share
2 answers

I have been intensively researching this topic since August 2014. First, I hope you are familiar with some knowledge of telecommunications and the Android Open Source Project (AOSP). Well, based on my research, I declare that:

  • If you look at the internal native AOSP classes, it seems that Android gives SignalStrength values ​​by sending return values ​​from the AT + CSQ command (please check your own AOSP reference-ril.c class ) through a modem. And only from this. The problem is that this command only gives the signal quality associated with the block error rate (BLER), and does not report anything about other incoming signals; In the LTE modem, in some devices everything is fine, but when you switch to a UMTS network, everything becomes unclear / inconsistent;
  • You can calculate the incoming interference (SNR and others) using some conclusions from the communication formulas (related to RSSI, RSCP, EcNo, etc.) yourself with the received signal levels from other cells or using AT + CGREG and AT + CREG ( check the reference-ril.c class again ).
  • I dug up all the internal AOSP classes, trace methods, and diagrams associated with telephony. I looked at everything from the SDK level (where we use the TelephonyManager and PhoneStateListener API classes), for native-level classes of the radio interface written in c / C ++. At any moment, I found an SNQ calculation that was really based on other cells, but only passed as a value received from a modem with AT + CSQ (this command gives only signal quality and BLER). This sounds strange to me, because interference is a value calculated on other received signals, including those that are not from GSM. So for me, the incoming SNR obtained from the Android API is somewhat chrome or incomplete.

Based on the foregoing, I believe that:

  • Google is not 3GPP. And 3GPP is not Google. Android is a huge and complex project with over 12 million lines of code. It is very likely that communication / theoretical information can be skipped among Android and telecommunications;
  • In particular, I am looking for CQI, and I suspect that CQI is in the context of LQR (Link Quality Report) calculated in L2 PPP (point-to-point protocol);
  • The topic of this topic is really problematic. There will be no holy grail, because different devices have different (possibly closed) hardware drivers. We need to support different software for each device. You may need to recompile all Android ROMs for each device if you need to have the correct value for the whole device.

I hope this brings you light. If you have additional information, please share it.

+11
source share

I use the following to get SNR:

public class PhoneStateListener extends android.telephony.PhoneStateListener { @Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { double snr = (double) SignalStrength.class.getMethod("getLteRssnr").invoke(signalStrength)/10D; } } 

You just need to register for signaling events:

 TelephonyManager mTelephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); PhoneStateListener mPhoneStateListener = new PhoneStateListener(); mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); 
+1
source share

All Articles