Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stratux output: include current receiver gain #144

Merged
merged 1 commit into from
Aug 3, 2021

Conversation

b3nn0
Copy link

@b3nn0 b3nn0 commented Jul 30, 2021

Hi,
With the next Stratux release, we would like to move to the new adaptive gain control stuff, since we absolutely do care about nearby traffic not getting lost. We'll do flight tests soon to see how well the adaptive gain deals with the fact that there is a transponder very close - as in only like a meter away.
However, since we also try to estimate the distance of Mode-S only targets based on signal strength, we do also need to factor in the variable gain in the future.

This PR adds the current Gain value to the Stratux output, so we can include it in the Mode-S distance calculation. Hope that's the correct way to get the gain value and that there are no corner cases where that doesn't work. Not too familiar with the dump1090 code base.

EDIT: would be happy if you could give some insight what you think about enabling this adaptive gain in an on-board situation - or if there is a good reason to not do it.

EDIT2: FYI, I did a flight test today with --adaptive-burst --adaptive-range.
During the ~45 minutes of flight, there were 29 gain changes. Amount of packets received on each distinct gain level. My own transponder was received most of the time. When gain went down to <40, there were no other targets with strong signals. Just my transponder. If you are interested in more detailed data, let me know.

Gain|Pkts
37.2|5121
38.6|2255
40.2|1284
42.1|2252
43.4|2228
43.9|2897
44.5|6300
48.0|4296
49.6|142344
58.6|508

@mutability
Copy link

I don't have a lot of experience with the adaptive gain behaviour in the real world yet - it's limited to a handful of test sites.

Stratux installs with your own transponder are an edge case I haven't thought about. I'd be surprised if it wasn't completely overloading the rtlsdr frontend when transmitting, unless you have some protection in place to attenuate that. A transponder that's 1m away is going to be (all things being equal) 60dB louder than the same transponder 1km away. The entire dynamic range of a rtlsdr is only ~35dB! My gut feeling is that the adaptive-burst stuff is not going to be useful there, because your own transponder is going to be far and away the loudest thing out there; you're probably better off finding an appropriate manual gain setting and sticking with that.

All that said, this PR looks fine, I'll merge it. NB: don't trust the exact gain numbers too much, they're mostly just what librtlsdr claims and it is not particularly accurate.

@mutability mutability merged commit 26924e4 into flightaware:dev Aug 3, 2021
@b3nn0
Copy link
Author

b3nn0 commented Aug 3, 2021

Alright, thanks for your intuition.
While it seems to have worked somewhat fine for me (Mode-S only transponder, don't know what transmit power since it's a rented plane), it didn't work out at all for a buddy of mine (with 250W ADS-B out). It basically tuned gain to 1.4dB.
So yes, I guess we will stick with a fixed gain value. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants