I'm using fmcomms3 (AD9361) with a zynq demoboard running under linux.
I want to implement an RF scanner function to lock on signals which BW is 5MHz, and that average power is above a threshold.
1- If I configure the RF BW to 5MHz, is the returned RSSI equal to the average power of the channel?
2- I tune the LO every 500ms for scanning. I also implement an AGC. With this config, do you think that the returned RSSI will be precise?
3- is there a libad9361 function to call to return the RSSI, other than system call: /sys/bus/iio/devices/iio:device1> cat in_voltage0_rssi ?
Thanks for your help.
1 & 2) AD9361's RSSI measurement is in dB. If you are looking for RSSI in dBm, you need to run calibration tests and find a mapping between RSSI measured and the power level at the antenna port. More advice from the reference manual, "To calibrate the RSSI word to an absolute reference, inject a signal into the antenna port of the completed system and read the RSSI word. From this test, generate a correction factor that equates the RSI word to the injected signal level at the antenna port. This calibration is separate from the gain step calibration."
3) You can use iio_channel_attr_read() function call and read the rssi attribute as follows:
ret_val = iio_channel_attr_read(iio_device_find_channel(phy, "voltage0",false), "rssi", &rssi);
In fact, I'm not looking for RSSI in dBm. I just want to verify the presence of a signal (power) in a given frequency carrier. So, I think that relative power to noise (RSSI?) is sufficient.
Thus, let me ask again the first question: is the returned RSSI is representing the average "relative power" of the channel which is 5MHz?
Yes. It represents the relative power of the channel.