RTLSDR Philosophy.

Leif Asbrink leif at sm5bsz.com
Mon Jul 9 23:04:55 UTC 2012

Hi All,

A device with limited dynamic range like the RTL2832/E4000
dongle needs a carefully designed gain control to allow
the user to move the dynamic range up or down to fit the
current RF environment.

The latest version has the required gain controls, but
to write an application that optimizes the performance
one has to know the dongle.

I would like to use the standard library for Linrad. The 
purpose would be to get support for other tuners than the
E4000 that are available today or that that may become 
available in the future. 

There is rtlsdr_get_tuner_gains that returns the lna gain
in the case of e4000. The gain values it returns for the
other tuners has a small range which means that somehow
(AGC or manual) one can set a much wider gain range.

In the case of E4000 there is IF gain and mixer gain. I
can not find those in the other tuners even though 
they have to be present in the hardware - but maybe only
in the form of AGC.

The application program needs to have:

Or something equivalent to run the E4000. To me this does not 
look right. Having each gain block as a separate object for
the application program to figure out how to handle means that
the application programmer needs to know the details of each 
tuner that might become available.

I think a much better approach would be to see the entire tuner chip
as an object. That would imply that the "set tuner gain" would
use all the gain controls inside the tuner chip in the proper order.
In the case of the E4000 tuner it would be like this:

Max gain: lna gain set to max. IF and mixer gain set to levels
          that produce 6 to 10 dB above minimum noise at the 
          RTL2832 input.

Reduced gain 1 to 10 dB: The lna should be left at max gain while
                         mixer and/or IF gain is reduced.

Further reduced gain: Reduce lna gain. The contribution from IF and
                      mixer is already negligible.

Even lower gain: When lna is at minimum we can still reduce IF gain.

The strategy would allow the application program to ask for the
gain range. Whether the gain setting would accept any value and
set the closest possible or whether it would require the user 
to query what gain levels the system allows is a matter of convenience.
The fundamental problem is whether the application program needs 
to know the internals of every supported chip.

A peace of hardware like the RTL2832/E4000 dongle needs a gain
control that spans at least 40 dB. The other tuners need the same
but in case itis only available as AGC they are not suitable for SDR.

At the moment Linrad works well with the E4000, but I do not 
think it would work with other tuners. I will wait for progress 
on the librtlsdr library. Hopefully it will be clear how an
application program can set the system gain over a range of 
at least 40 dB without knowledge of the internaldś of the tuners.


Leif  /  SM5BSZ

More information about the osmocom-sdr mailing list