Thoughts on optimizing gain

@wiedehopf: you’re right, the number of planes seems lower not although it could be a coincidence. Traffic heavily depends on weather.

Is it correct that if the SDR is overloaded reception of all planes stop? They sure do not disappear all at once on the map but this is probably because a loss of signal up to 30 s is accepptable. So one could write a sort of program that counts the amount of time per day where no signal at all was detected. This should be easier to implement than my previousely proposed approach of counting lost approaching close planes.

Right now I run testwise with a gain of 21 and with feeding the preamp directly with 5V. Airspy provides 4.5 V only so this may make a difference.

Can you elaborate this further? How to I amplify weak signals more than strong ones?

1 Like

No just the signals that are too strong are not being received. As ADS-B messages are not continuous but short bursts, the rest of the time you still receive other messages fine.
And even with lower gain the same message would have been the strongest at that time, so you will either receive the message or not. But it normally would not block other messages from being received.
With the oversampling of the airspy it might actually have received another message overlapping with the strong message, and the overload means you can’t receive either message.
But that should not occur too often even with the airspy.

The voltage could only further increase gain? You already have determined you have too much of that? The uputronics product page says the 4.5 V are just fine for the amp.

We’ll see if it makes a difference i guess.

This sounds relevant: Distribution of Gain and Selectivity in Receivers
But i will bow to the expert, i’m not too well versed regarding RF reception.

I’m curious why the uputronics filter doesn’t have a low pass filter at the input like the rtl-sdr blog LNA, probably it’s only necessary with very strong TV/FM broadcast towers nearby.
If i understand
That’s what the distribution of gain boils down if i understand correctly: you want to always stay in the linear portion of your amplifiers.

1 Like

If this is the case my method does not work. But there must be a method to measure overload. I.e. Airspy has a 12 bit ADC. So one should be able to count the amount of time where signal is 2^12=4096.

Yes more voltage is supposed to increase gain further. It’s just a test.

1 Like

Yes that should be possible. Also check my last post, i edited in some more text.

1 Like

Thanks! Honestly, I only understand it partially. I understand that the filter should be before the amp which afaik the Uputronic does. Then, use automatic gain control (AGC).

Now the question is how such a gain control should look like. In normal radio reception there is one continuous signal of equal strength which gives you plenty of time to tune gain.

With ADS-B and the like we have short bursts of different signal strength. But we know the signal repeats every second and it can’t change strength too much within two bursts. That should allow us to apply some sophisticated gain control. If we see an aircraft’s signal going into saturation one could reduce gain during the time slot one expects the next burst from this plane. Increase gain inbetween. I’m not sure how quickly the SDRs can change gain, a message is only ~100 us long.

Why do you think this? There is a bandpass filter that cuts everything away below and above the desired frequency. Anyway, I am more worried about nearby mobile phones (and base stations) in the GSM900 band than FM stations that are fare away and in another frequency.

1 Like

In the uputronics the bandpass is behind the amplifier, in the same place a SAW filter would be.
Insertion loss of these strong filters is not a good idea in front of the amplifier.

Probably unless you live near an FM / TV broadcast antenna it’s not a problem.
It’s just that those have much more power than mobile phones antennas as they are often meant for larger distances.
The filter in front of the amp is only a good idea if you have rather strong interference. Otherwise you can theoretically get better sensitivity without it.

The rtl-sdr blog LNA is the following arrangement:
Antenna → high pass filter → LNA → SAW filter → LNA → SAW filter → to receiver

Now that first filter does not have the same strong cutout of unwanted frequencies as a SAW filter but the signal loss at the desired frequency is less.
The uputronics might still be better quality with the ceramic filter option or even with the SAW filter i don’t know.

I’m not really sure what prog meant with the remark, just wanted to post some reading on the term.
Maybe he just wanted to point out that a good antenna and quality/short cable to the amplifier is very important.

Aircraft also respond to interrogation and give messages independent of that.
So with the interrogation there can be up to something like 30 messages per second per aircraft.
That is probably the exception though.
So it would be hard to anticipate.
But you could timeshare the gain, alternate between 16 and 19 every second.

As it is not critical to receive every message from every aircraft such an arrangement could make sense.

1 Like

You can’t. Forget about the AGC - The detailed explanation is too technical for this thread, but the global idea is that the behavior of the AGC is not instantaneous. It needs to learn about the signal before taking any action. With Mode S (and any short lived signals), it will be always lagging behind the signals.

Here we go.

If you add 20 dB of external gain, you need to compensate for it with some attenuation to keep the signals at the analog front end (AFE) in the expected amplitude range. The overall optimization targets the lowest noise figure still greater than the ambient system noise figure at the highest possible linearity. That’s why we have a gain setting in Airspy, which is actually a programmable multi-stage attenuator.

So, what should I do?
As a rule of thumb, always adjust the gain of the receiver according to your total external gain = gain of the antenna + gain of the preamp(s)

Fully exploiting the available dynamic range is the art of matching the minimum and the maximum signal levels out of your transmission line to those of the receiver.

Things to avoid:

  • Too much gain will reduce the available dynamic range which will cause overload with strong signals.
  • Too little gain will simply miss the weaker signals and the available dynamic range won’t be fully utilized.

Misconceptions:

  • Stop using the ADC saturation or any dBFS reading as a metric for signal quality. Receivers are much, much more complex than that. If the gain distribution is not right (RF gain, Mixer conversion gain, IF gain) , you can easily end up with bad reception quality regardless of the ADC saturation, and still have good readings. SNR is a much useful metric to use, but it is not necessarily trivial for everybody.
  • ADC is not everything. There’s a very long chain of analog processing in front of the the ADC, and analog is not perfect. The dynamic range of a properly setup R820T2 is about 100 dB. That’s a huge figure actually, but to reach it, you need to learn about gain distribution (again). In the Airspy design, we took care of matching the ADC to the tuner in every possible way. In the end, you just need to find a single number for a composite gain setting - check below.
  • More gain is not necessarily better. By default, airspy_adsb uses the “Linearity” gain mode, which optimizes for the linearity and delegates all the “sensitivity” to the external preamp. Every value corresponds to 3 different gain settings in the R820T2: RF, Mixer and IF. Check this table for the actual values.
  • ADC saturation is not bad. As long as your RF front end is not saturated, you can still recover Mode S frames even if the ADC is saturated. That’s possible because the ADC will just clip the signal and make it look like a square instead of a sine. Since we only care about the presence or the absence of a carrier (OOK modulation) at a certain phase, the ADC clipping doesn’t harm the decoding. If this phenomenon didn’t exist, the little RTL dongles and other specialized receivers (like Beast) that use 8bit ADCs won’t be able to see much. At the end of the day, you will see that other parameters matter: Sampling rare (= timing resolution) and the analog processing chain.
4 Likes

Maybe i should rewrite the first two posts of this thread.
I’m well aware that ADC saturation isn’t necessarily bad, but there is a correlation between the number of ADC saturated messages and actually losing reception of the strongest messages (probably because of RF front end saturation).
Assuming signal strength of the messages at a location are somewhat normally distributed, aiming at for example 5 % of those strong messages would give you a good baseline gain.

Also i would like to mention i wanted to provide a very rough guideline with this thread for people who don’t really know about ADCs and are confused by negative signal strength readings.
Burgdorfers approach to slowly lower gain until you receive even the strongest signals is the best way, but for that you have to know which signals are strongest and if you lose them because of terrain or frontend saturation.

Thanks for the explanation regarding the RF front end, my mental picture of the receiver chain has been improved quite a bit, i should probably read some more about it.

On a related note:
For the airspy decoder, what does this option do?
-r Reduced IF bandwidth

3 Likes

This option limits the bandwidth of the signal visible to the ADC to about 3.5 MHz instead of the default 9 MHz. This can be useful in some situations when you have some broadband noise right over the 1090 MHz band. But mind you, reducing the bandwidth of a signal also smooths the transitions between 0 and 1 levels in the time domain. This makes the detection harder or even impossible in some cases.

3 Likes

Wow, thanks a lot! :hugs: This is really a high quality forum. The more I learn, the less I think I know :wink:

So gain is closely related to Signal/noise ratio (SNR). One could therefore try to reduce noise in order to increase SNR. What comes to my mind is that my CoCo antenna is equally sensitive for negative elevations as for positive ones. But only in positive elevations I can expect aircraft. Is there a way to cut off the signals coming from ground such as mobile phones?

There is this “cantenna” design but I miss a diagram that shows how it behaves for negative elevations. Would this be a solution?

1 Like

A colinear antenna is already very good at rejecting other frequencies and after the cavity filter there will be nothing left of mobile phones so i wouldn’t worry about that.

I’m pretty sure you are already receiving very faint signals through the treeline of some nearby peaks. (If you even have those)
As you have limited range due to the terrain, that’s about the only weak signals you need to worry about, if you have a direct line of sight even a setup that is way worse than yours would receive to 120-160 nm out.

Your system sounds as close to perfect as i can imagine. Your need to reduce the gain for close in aircraft also speaks to the quality of your antenna.
You should dismount your system some day and take it with you onto a high peak, i’m sure you would be delighted by the range you get :slight_smile:

Thanks, I opened another thread about moving my site and connecting it to the internet by radio.

1 Like

For Airspy it would be great is this info about gain being in 3db steps would be posted on the site too.
Same for the “reduced bandwidth”. It was recently a discussion where we kept guessing about what that meant.
Another hidden secret is what enabling DX reception does actually.

:point_up_2: Yes! I’d like to know this also.

-x is unrelated to oversampling. It simply tells the decoder to trust more frames that are likely to be good.

(prog Planes but not feeding - #25 by prog)

Probably named after DXing - Wikipedia

I’ve collected some explanations on the various command line switches here:

Tried the %strong signal query before, but when I send the command I get:
“Percentage of strong messages: 103.368”

a) how can it read higher than 100%?
b) should I be adjusting gain to less than current setting (10 for AGC)?

I am using a new ceramic filter/preamp at the antenna (100ft feedline run). Thought setting the gain to 10, AGC would pick the best gain automatically. Maybe this is not the way it works.
-G.

1 Like

That indeed seems strange. (I’m disregarding error corrected messages in the count, so that’s how it can be over 100%)

What dongle are you using?

Try a gain of 38 to start with and check the number again.

AGC (-10) does not work properly on ADS-B signals.
The dongle can do gain from 0 to 49.6 and also AGC, which you can see at 55 on that scale.

Using the FlightAware pro-stick plus with the built-in filter and preamp (blue stick). The added Uptronics preamp/ceramic filter is up on the tower close to the antenna (flightaware 1090 colinear) at about 50’ haat with about 100ft feedline between the remote preamp and dongle…
Changed the gain to 25 (before I read your message) which seems to give better signal range and a % strong messages to 2.102. Range doesn’t seem to have changed much but getting better counts from seeing more nearby aircraft. Maybe I should wait 24 hours and try setting the gain to 30?

2 Likes

Thanks for this thread, it’s really interesting. I’ve tweaked the receiver in my loft so that my percentage of strong messages is sitting at around 5.3% after it’s been running for 24 hours and that seems reasonable to me. I’ve gone down from 42.1 to 40.2 having previously based it on maximising the number of position reports received.

I’m getting what seems to be a good range of close and distant aircraft and that’s exactly what I want. This is a Pro Stick Plus and my homebrew two element j-pole.

1 Like

I just tried this and I get 27.233.Im going to drop the gain a bit.

1 Like