-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Gain Control
This page is about gain control, including automatic gain control, of the various radio hardware one might use, as well as processing within rtl_433
. It assumes a basic command of the concept of gain, and of dB, but does not assume familiarity with the block diagram and receiver operating theory of any particular hardware.
This page is very much a work in progress and quite unbaked. So far, it doesn't really attempt to discuss direct-sampling mode, or other than RTL-SDR.
An RTL-SDR dongle contains a tuner chip and a Realtek RTL2832U, more or less by definition.
An important difference is which tuner is used, particularly for this discussion.
For now, we focus on the R820T and R820T2. \todo Expand
There is a library librtlsdr
, and there are multiple versions of this library; those choosing to run old software ("LTS") might not have an up-to-date version. This page presumes that you have 2.0.1 from
https://osmocom.org/projects/rtl-sdr/wiki or equivalent.
See rtlsdr_get_tuner_gains
which talks about gain being in 0.1 dB units, and gives a list for E4000 tuners (only).
One can set gains for 6 separate stages for the E4000.
See rtlsdr_set_agc_mode
which sets the AGC mode of the RTL2832, which is digital AGC on or off.
There is a gain stage in the tuner and also one in the RTL2832. There is confusion about which stage is being talked about when one says "AGC" or fixed gain.
\todo Explain "digital AGC".
https://github.com/merbanan/rtl_433/issues/1749
https://www.rtl-sdr.com/a-software-based-vga-agc-implementation-for-the-rtl-sdr/ https://github.com/wizardyesterday/RtlSdrDiags/blob/master/doc/agcResearch/README.txt
\todo Discuss.
\todo Write!
\halfbaked This seems to be about detection code running on IQ samples, where it does not insist on signals being nearly full scale, by finding the thresholds dynamically. \todo Explain this for real when clear!
See https://triq.org/rtl_433/OPERATION.html#input-gain
For RTL-SDR, 0 for automatic gain, other values for specific gains. \todo This is very likely for the tuner gain, but confirm.
\todo There is apparently a fixed set of allowable gains, and it is not clear what happens if you ask for one that is not in the set. Explain.
Note that many signals will have signal strengths that are just below 0 (full scale), and about-0.5 is typical. This more or less means that the AGC put the signal in the right place. This then means that the noise value for that packet should be interpreted as relative to the signal; there is no absolute calibration with AGC enabled.
\todo Explain what the "noise" values are during periods of no signal. AGC will turn gain up high, and without knowing what it did, this isn't really meaningful. This is in contrast to a radio with an AGC voltage driving an S meter.
Set the digital AGC on (default off) for the RTL2832. \todo There's an implication that there is no analog variable gain in the RTL2832 - confirm and give a atasheet reference. Conventional wisdom is that this mode probably should not be used.