Skip to content

Optimizing gain

wiedehopf edited this page Dec 29, 2023 · 23 revisions

Automatic method

Automatic gain optimization

Manual method

for the commands to change the gain for some common setups, see this page:

How to set gain

Use this command to get the percentage of strong messages:

grep -sh . /run/{dump1090-fa,readsb}/stats.json | jq '.total.local | ((.accepted | add), .strong_signals, .signal, .noise)' | xargs -n4 echo | awk '{printf "\nPercentage of strong messages: %.3f\nSignal: %.1f\nNoise: %.1f\n", $(2) * 100 / $(1), $(3), $(4)}'

Show current gain

grep -sh -e gain /etc/default/{dump1090-fa,readsb}

Target percentage:

Percentages around 5 are what you should be aiming for. If you live close to an airport even 10% can be an optimal value, i'd still prefer 5%.

If you have very occasional helicopters / small plane that fly close by but most other traffic is far away you might need to go for 0.5 % or even lower to make sure the close by traffic is received.

This is just a guideline, experimenting until you actual start losing close by planes due to overloaded receiver is encouraged.

Now you adjust the gain:

After waiting at least 5 minutes you can check the percentage again using the command mentioned before.

If the percentage is too high for your taste, reduce the gain, if it is too low increase it. If you are unsure of what you want just aim for 5 percent.

Available gain settings (from lowest to highest gain setting):

0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4
28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 -10

Setting gain to AGC / -10 (results in an effective gain of 58)

Using a gain of -10 turns on hardware AGC (Automatic Gain Control), for ADS-B it results in the MAXIMUM possible gain. It does NOT work as its name implies, due to ADS-B only being short bursts of data, it results in an effective gain of 58. This is more than you can set with the manual gain settings. (58 not being available as manual gain is a shortcoming of the rtl-sdr drivers)

Repeat until the number is to your liking:

If you don't care about losing messages from planes that are close to you and are just aiming for maximum range then you can go higher but i wouldn't recommend it, you might not get any extra range by using a higher gain. (The noise is amplified with the signal, so if the noise is "louder" than the signal no amount of gain will make you receive that signal)

If most planes are far away and flying high and every few days a helicopter flies by very close and you lose it when it comes closer you will need to reduce the gain to accomodate seeing that helicopter and the percentages will be quite meaningless.

After you are done you can check back after a day or two to get a more precise percentage again using the command. The percentage is only reset when dump1090 is restarted.

Another approach is to adjust the weakest signal to be from -30 to -34

For that it's best to use graphs1090: https://github.com/wiedehopf/graphs1090#graphs1090 Note that -30 is less than -20 when looking at RSSI (https://en.wikipedia.org/wiki/Negative_number#The_number_line) So you increase/decrease gain step by step until the light blue line (weakest signal) is in the range of -30 to -34. That should typically give good reception while not overloading for close flights.

Originally posted here: Thoughts on optimzing gain (FA)

Clone this wiki locally