Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dump978-fa
skyaware978
faup978
fec_tests
adaptive_tests
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LIBS_SDR=-lSoapySDR

all: dump978-fa skyaware978

dump978-fa: dump978_main.o socket_output.o message_dispatch.o fec.o libs/fec/init_rs_char.o libs/fec/decode_rs_char.o sample_source.o soapy_source.o convert.o demodulator.o uat_message.o stratux_serial.o
dump978-fa: dump978_main.o socket_output.o message_dispatch.o fec.o libs/fec/init_rs_char.o libs/fec/decode_rs_char.o sample_source.o soapy_source.o convert.o demodulator.o uat_message.o stratux_serial.o adaptive.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) $(LIBS_SDR)

faup978: faup978_main.o socket_input.o uat_message.o track.o faup978_reporter.o
Expand All @@ -23,14 +23,18 @@ faup978: faup978_main.o socket_input.o uat_message.o track.o faup978_reporter.o
skyaware978: skyaware978_main.o socket_input.o uat_message.o track.o skyaware_writer.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)

test: fec_tests
test: fec_tests adaptive_tests
./fec_tests
./adaptive_tests

fec_tests: fec_tests.o libs/fec/init_rs_char.o libs/fec/decode_rs_char.o libs/fec/encode_rs_char.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ -lstdc++

adaptive_tests: adaptive_tests.o adaptive.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ -lstdc++ -lm

format:
clang-format -style=file -i *.cc *.h

clean:
rm -f *.o libs/fec/*.o dump978-fa faup978 skyaware978 fec_tests
rm -f *.o libs/fec/*.o dump978-fa faup978 skyaware978 fec_tests adaptive_tests
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,39 @@ The main options are:

Pass `--help` for a full list of options.

## Adaptive gain control

When receiving samples from an SDR (`--sdr` only), dump978-fa can adjust the
SDR gain automatically. This is a port of
[dump1090-fa's adaptive gain feature](https://github.com/flightaware/dump1090/blob/master/README.adaptive-gain.md)
and works the same way. Two independent modes are available; both are off by
default and can be enabled together:

* `--adaptive-range` enables **dynamic range mode**: dump978 measures the
noise floor and searches for the highest gain that still provides a target
dynamic range (by default, 60% of the SDR's gain range in dB -
approximately 30dB for an RTLSDR). This suits most installs.
* `--adaptive-burst` enables **burst mode**: dump978 watches for loud,
message-length bursts of signal that failed to decode - a sign that a
nearby transmitter is overloading the receiver - and reduces gain when
they arrive too often, raising it again once things quieten down.

Useful tuning options:

* `--adaptive-min-gain <dB>` / `--adaptive-max-gain <dB>` restrict the gain
range that adaptive gain control will use. If you know an approximately
correct gain for your installation, setting limits around it speeds up
convergence.
* `--adaptive-duty-cycle <percent>` controls the fraction of received
samples inspected (default: 50). Lower values reduce CPU use on slow
machines at a small cost in measurement accuracy.
* `--adaptive-range-target <dB>` overrides the target dynamic range.

Further tunables mirroring dump1090-fa's options are available; pass `--help`
for the full list. Adaptive gain control requires manual gain control of the
SDR and cannot be combined with `--sdr-auto-gain`. Gain changes and a
once-a-minute status line are logged to stderr.

## Third-party code

Third-party source code included in libs/:
Expand Down
Loading