RFSOCDescriptor gains information and control

Hey everyone,

In some of the projects I’ve tried to leverage information from RFSOCDescriptor::gainRange and RFSOCDescriptor::gainValues and run into some confusion about them.

For LNA stage the information is straightforward: the gainValues contains elements with actualGainValue ranging from 0 to 30 in increments of 1, and the gainRange is min=0, max=30, step=1. So far so good.

The TIA is a bit more confusing: the actualGainValue are 0, 9, 12, but the range is min=0, max=12, step=1. I guess this is because Range can not represent non-uniform steps, so it is understandable.

The PAD is there I start to be quite confused :slight_smile: The actualGainValue are values from 0 to 30 in increments of 1. But the gainRange is min=0, max=52, step=1.

The IAMP is where I am lost =) The actualGainValue are from 1 to 63 in increments of 1. But the gainRange is min=-12, max=12, step=1.

I’ve double-checked with the LimeSuiteNG code to be sure I didn’t make mistake in my API usage, and it seems to be how the LMS7002M_SDRDevice::SetGainInformationInDescriptor currently reports information.

Is there a mistake in the ranges for the PAD and IAMP?

Another question is about ChannelConfig::Direction::gain: is the the same “unit” as the actualGainValue ? As in, ideally the gain configuration is to stay within the values of actualGainValue ?

I’ve tried finding places in LimeSuiteNG to help understanding usage and got confused by the code in LimeSDR_XTRX::RunTestConfig: the PAD value is within gainRange but outside of actualGainValue, and the IAMP is outside of both gainRange and actualGainValue.

So yeah, I am a bit confused about how to properly respect the gain values/limits/etc.