Adaptive gain issues

I wonder if the loud un decoded messages relate to large amount of single messages??

I think it is actually getting pretty close to picking the sweet spot in gain. From fixed gain operation, around 30 seems to be the best, so that is where the adaptive gain fixes itself.

Whether is wants to lower if further, I understand that there is a 30db range??, so if the start is at 60, I take it that it will not go lower than 30 even if it wanted to. So would lowering that initial gain setting to say40, would give it more options of below 30??

Hmm can someone explain this line?:

Sep 29 18:24:31 odroidn2 dump1090-fa[2581]: adaptive: available dynamic range (27.3dB) < required dynamic range (30.0dB), switching to downward scan

so why does it stop at 30??

Sep 29 18:25:00 odroidn2 dump1090-fa[2581]: adaptive: available dynamic range (30.6dB) >= required dynamic range (30.0dB), stopping downwards scan here

where is this dynamic range 30db set??

It is set in /etc/default/dump1090-fa
See extract below:

# Target dynamic range in dB (leave blank to autoselect based on SDR type)
ADAPTIVE_DYNAMIC_RANGE_TARGET=

And if you want to “set this” not to be auto select on the SDR type, what do you put in, no, a figure, ??? , a colour. An instruction with a bit missing from it. And more to follow re that, because the instructions and what happens is vastly different.

It is a number. As it says, Target dynamic range in dB

Sorry this is going to be an example of poor description in regards how things work. Please explain how this happens:

From the read me for adaptive gain;

To enable this mode:

Set adaptive-dynamic-range yes in piaware-config; or
Set ADAPTIVE_DYNAMIC_RANGE=yes in /etc/default/dump1090-fa ; or
Pass the --adaptive-range option on the command line.

Here is an image of my adaptive gain at work, looks like it is working well:


BUT here is my set up for this unit:

Initial receiver gain, in dB. If adaptive gain is enabled (see below) the actual gain

may change over time

RECEIVER_GAIN=60

Adjust gain to try to achieve optimal dynamic range / noise floor?

*** ADAPTIVE_DYNAMIC_RANGE=

Target dynamic range in dB (leave blank to autoselect based on SDR type)

ADAPTIVE_DYNAMIC_RANGE_TARGET=yes

Reduce gain when loud message bursts from nearby aircraft are seen?

ADAPTIVE_BURST=yes

Gain range to allow when changing gain, in dB (empty = no limit)

ADAPTIVE_MIN_GAIN=
ADAPTIVE_MAX_GAIN=

You will note in the ADAPTIVE_DYNAMIC_RANGE= line there is no yes, as there is supposed to be according to the instructions. When first installed, the default, as written activated by default, it is there.

This image is of the unit with adaptive gain working the longest. You will note from 1400 till 1920 is with the ADAPTIVE_DYNAMIC_RANGE= with a yes. 1920 the yes is removed.

What is going on here???

You are doing well at identifying how poorly these instructions are Lawrence, thanks. Right it states it is a range, range between what and what 10 to 120, 15 to 20, ??? gosh can’t seem to find that important detail. It is these types of instructions that are frustrating, vague and time consuming when you are trying to work out what is going on, like not using a yes when you are supposed to.

It is Dynamic Range. That means it is the ratio in dB between the highest and lowest values you are receiving. So with a value of 30, when met, your highest signal will be 30dB greater than your weakest.

A value in dB, like the comment says.

The assumption is that if you are tweaking these knobs you know something about the underlying mechanisms. You don’t need to tweak those knobs in 90% of all cases, why do you think you need to tweak that knob, exactly?

I can’t really give a crash course in RF fundamentals in the config file.

The short version is that adaptive gain will adjust gain to find the highest gain that puts the noise floor at least X dB below the maximum possible signal strength, where X is the target dynamic range. This gives at least X dB of dynamic range for received messages.

So far I don’t see an issue here. Is there some outstanding problem you’re having with adaptive gain when using the default settings?

1 Like

Well lets start with the default setting of:

To enable this mode:

  • Set adaptive-dynamic-range yes in piaware-config; or
  • Set ADAPTIVE_DYNAMIC_RANGE=yes in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-range option on the command line.

In this image, from installing the script, 7 hours of basically a flat line in gain with the setting

ADAPTIVE_DYNAMIC_RANGE=yes

There is no further description in the readme on what happens if you don’t have yes. Will a no not enable ADAPTIVE_DYNAMIC_RANGE ? What about nothing, = ?

Well by error in having nothing in that line and having ADAPTIVE_BURST=yes, I find 30 hours of gain data that looks like it is properly adapting to external factors and not just basically a flat line of no adaption. But there is no yes to enable the function, how can this happen??

Anything other than yes disables the option.

So in this case you have adaptive dynamic range mode disabled and adaptive burst mode enabled.
They are separate things and can be enabled/disabled independently. What was the initial gain set to? If you’d left it at the default of 60, I expect that is way too high for your equipment and so adaptive burst mode kept pulling it down when it saw overly loud messages - that’s why you see all the variation.

A mostly flat gain is normal for adaptive dynamic range mode - usually environmental noise does not change much.

tl;dr seems to be working as expected given the configuration.

Sorry didn’t see anything written indicating that adaptive dynamic range and adaptive burst are separate features and that if adaptive dynamic range was not enabled, nothing else would function.

Given the graph detail of that 7 hours of the Adaptive dynamic range switched on with a db sitting at about 36 and then the rest of that graph indicating the adaptive burst readings, if I wanted to override the default settings for dynamic range, what would my ADAPTIVE_DYNAMIC_RANGE_TARGET setting be??

And whilst I have your attention, just to confirm other comments, this adaptive gain will only be suitable for SDR’s, not say Airspy?

Uh, well, that’s not correct.

I don’t understand what you are asking here.

The choice of dynamic range target mostly depends on the receiver hardware in use. For example I’d expect all R820T2/RTL2832U-based dongles to be able to achieve a similar dynamic range, regardless of what you put in front of them. That’s why it defaults by SDR type. Why do you want to change the dynamic range target, do you think that your particular dongle has a wider potential dynamic range than other similar dongles?

Currently adaptive gain only functions on rtlsdr dongles.

There’s currently no mainline support for Airspy dongles in dump1090-fa so the question about the Airspy is mostly meaningless. airspy_adsb is doing its own thing for adaptive gain that I haven’t been following in detail.

Thank you for brilliantly pointing out how vague some readme’s that developers put up for projects. Because in this readme someone put:

To override this target:
*** Set adaptive-dynamic-range-target in piaware-config; or**
*** Set ADAPTIVE_DYNAMIC_RANGE_TARGET in /etc/default/dump1090-fa ; or**
*** Pass the --adaptive-range-target option on the command line.**

You state where X is the target dynamic range.. I want to set a dynamic range, given my data read, what is my dynamic range, the mysterious X.

Not sure I can help you further here. It’s a configuration option that requires knowledge of how the adaptive gain dynamic range algorithm works, and you seem unwilling to learn how that works.

30. Which is the default value for rtlsdr dongles if you leave it blank.

I guess one more try. To reiterate what I said earlier, this is how the algorithm works:

The short version is that adaptive gain will adjust gain to find the highest gain that puts the noise floor at least X dB below the maximum possible signal strength, where X is the target dynamic range. This gives at least X dB of dynamic range for received messages.

You pick X mostly based on the characteristics of the SDR itself, after all the variable gain stages. rtlsdr dongles get reasonable performance when the noise floor - after all amplification - is below -30dBFS. So we default to X = 30dB for rtlsdr dongles. Adaptive dynamic range will then vary the gain of the variable-gain stages in front of the SDR until the noise floor is below -30dBFS.

If the noise floor is below -30dBFS, that means that the weakest signal that can be detected is around -30dBFS, and the strongest signal that can be detected is around 0dBFS, giving about 30dB of dynamic range for a given gain setting. That is, there is a 30dB difference between the weakest and strongest signals that can be received.

You could set the dynamic range target larger, let’s say 35dB. Then dynamic range will try to keep the noise floor below -35dBFS. Whether this is actually achievable or not will depend on the exact hardware that you have; generally I found that, at those levels, the noise floor is dominated by noise that is independent of gain (inherent noise in the chip itself, ADC quantization noise, etc). What that means is that if you decrease the gain by, say, 1dB, the noise floor might only decrease by 0.3dB. To go from a noise floor at -30dBFS to a noise floor at -35dBFS, you have to decrease gain by a lot more than 5dB. It’s probably not a good tradeoff overall, but have an experiment and see what works; the 30 value is just what I found to be a reasonable default when testing.

But if you know the characteristics of your hardware, and you know what gain setting is a reasonable default, then I’d suggest not using adaptive dynamic range at all and just setting that gain directly. If you want to use a fixed default gain and also use adaptive burst mode, then set your default gain as the maximum adaptive gain (ADAPTIVE_MAX_GAIN); adaptive burst mode can then decrease the gain, but it’ll never increase it past your configured maximum.

Here’s a graph of actual noise floor / dynamic range versus gain for a PS+ I have on hand here:

The “dynamic range target” is the green line. Adaptive dynamic range will pick the largest gain setting that keeps dynamic range above the green line (in my case, that’s 49.6dB). If you change ADAPTIVE_DYNAMIC_RANGE_TARGET, you’re changing where the green line is.

Thank you for your advice.

On my RPi model 4 with DietPi Bullseye (64-bit Armv8), I have left all settings of dump1090-f un-changed i.e. at default.

The adaptive gain checks every hour and serts gain to required value. Up till now it has always set it at 49.6 (antenna is V-Stub whip on mag-mount base placed on window sill, dongle is Radarbox24 FlightStick with builtin SAW+LNA)

Today at 9:20 pm EDT, I noted sudden dip reception. Checked gain, there was a corresponding dip. I rebooted Pi and it became normal.

Dont understand what prompted Adaptive Gain to drop the gain so low. :confused: , but good thing is trhat rebooting fixed the problem whatever it was.