Readsb --gain=auto

Experimenting with a builtin autogain for readsb.
https://github.com/wiedehopf/adsb-scripts/wiki/Automatic-installation-for-readsb

--gain=auto

It’s not configurable but should give reasonable results.
Just in case anyone fancies testing.

Edit:
Added some optional values to tweak:

--gain=auto,lowestGain,noiseLowThreshold,noiseHighThreshold,loudThreshold

defaults:

--gain=auto,0,25,31,243

Of course just --gain=auto still works and uses the defaults.

Edit2:
--gain=auto is now silent in the logs.
--gain=auto-verbose logs every gain change.
Edit3:
Starting gain is an unnecessary setting. Instead make it so a lower limit for gain can be specified.

2 Likes

Thank you for the update.
Will try it asap.

How does this compare with adaptive burst mode in dump1090-fa? More precisely how would I set loudThreshold such that it prefers local traffic close to the airport receiver?

It already does this by default.

I’ve found the parameters by experimentation.
The auto-verbose mode tells you what the algorithm is doing, you can easily use that to adjust the parameters through trial and error.

But really i didn’t mean for anyone to tweak this unless they want to experiment / read the code to understand what’s going on.

Not sure how fast adaptive-burst is.
I’d suspect this is faster just because of how fast it is adjusting down when there is loud signals.
Also don’t know who dump1090-fa autogain handles a super strong signal appearing next to the receiver (transponder being turned on). readsb should handle it well because it doesn’t look for ADS-B signals specifically, any strong signal being received even when it can’t be decoded will cause a reduction in gain.

Thanks for the reply, I will setup a test receiver and report my findings. Remember that I am providing an install script to build OGN receiver stations (https://github.com/VirusPilot/ogn-pi34) which since last year now also can forward ADSB traffic to the OGN APRS. The ADSB feature is particularly important in the near future for smaller airports in Germany that will switch to be no longer attended but takeoffs and landings still have to be recorded (automatically). So far my dump1090 changes did the job but I would certainly prefer to switch to readsb.

Adaptive burst detection is fast but I had to change a few parameters such that it does the job: EXTRA_OPTIONS="--adaptive-burst-alpha 1 --adaptive-burst-change-delay 1 --adaptive-burst-loud-runlength 1 --adaptive-burst-quiet-runlength 5 --adaptive-range-change-delay 1". Furthermore two gain steps instead of one were necessary, more details here in this thread: Adaptive burst mode - #21 by byraspi.