Skip to content

Optimizing gain

wiedehopf edited this page Mar 10, 2021 · 17 revisions

Automatic method

Automatic-gain-optimization-for-readsb-and-dump1090-fa

Manual method

Use this command to get the percentage of strong messages:

grep -sh /run/{dump1090,dump1090-fa,readsb}/stats.json -e '' | 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)}'

Alternatively you can use the percentage given in graphs1090, it's the same percentage

Percentages from 0.5 to 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% or less.

If most of your traffic isn't close by but low / close by aircraft are important to you, go for 0.5 % or even lower to make sure the close by traffic is received without overload.

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

If you're using graphs1090, adjusting gain so your weakest signal is between -25 to -30 dBFS usually yields similar results, again it's just a guideline. In case of focus on nearby aircraft you can also go lower with the weakest signal to something like -35 dBFS.

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 2 percent.

Available gain settings for the typically used SDRs are:

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

Using a gain of -10 turns on 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.

Originally posted here: Thoughts on optimzing gain (FA)