Commit Graph

10 Commits

Author SHA1 Message Date
Oliver Jowett f932baa5fa Adaptive gain: more aggressively re-probe for a higher gain
following a decrease in gain due to an increased noise floor.

This is controlled by --adaptive-range-scan-delay and defaults
to 5 minutes (vs. the default rescan delay of 1 hour)
2021-12-07 17:29:50 +08:00
Oliver Jowett e058929977 stretch compile fixes? round two 2021-07-21 20:51:57 +08:00
Oliver Jowett 5bd1718bb2 try non-static const to make stretch build happy? 2021-07-21 19:41:42 +08:00
Oliver Jowett 4cf8eb254e Report actual duty cycle on startup 2021-07-19 15:50:55 +08:00
Oliver Jowett be3c9930f1 Add --adaptive-duty-cycle option.
This makes the adaptive gain code only process some fraction of all samples,
rather than every sample. This helps a lot with CPU on slower machines.
We default to a 50% duty cycle to save some CPU without really affecting
the behavior much.

We split the one-second adaptive gain blocks into 20* 50ms "subblocks"
Each subblock is either entirely processed or not processed at all,
based on the configured duty cycle. (This means that the duty cycle
can only be specified in approx 5% increments, but that should be
fine)

For adaptive dynamic range, there's no further complications - we
just look at fewer samples to compute the noise floor.

For adaptive burst, we need to scale up the measured burst rate by
1/duty cycle to account for the samples that we didn't process. It's
also more likely to cause functional changes as it's quite possible
for a relatively small number of loud messages being missed to
affect the computed rate substantially. Not many options there other
than increasing the duty cycle when adaptive burst handling is wanted.
2021-07-19 15:50:55 +08:00
Oliver Jowett e0f7a33df4 Fix some case where adaptive_range_gain_limit would not be correctly decreased 2021-07-19 15:50:55 +08:00
Oliver Jowett 2480e5169c Use a starch implementation for the burst-detection sample counting loop. 2021-07-08 18:53:02 +08:00
Oliver Jowett ac97423249 Misc adaptive gain changes:
Update adaptive gain control loop to handle interactions between burst detection and dynamic range control.

Internal doc updates & naming cleanups.

Stats tweaks.
2021-07-07 20:57:34 +08:00
Oliver Jowett fd8f2d77e1 Fix adaptive gain stats not getting set on stats_current -> zeros
appearing in stats output. Now we have a validity flag for the stats
members where we have to pick one value and not simply sum data.
2021-07-07 20:18:54 +08:00
Oliver Jowett 56625449e8
Adaptive gain, first pass (#134)
This PR adds basic adaptive gain support, which adjusts SDR gain on the fly based on the noise & signal levels seen.

There are two control mechanisms:

Dynamic range control is enabled by the --adaptive-range option. This adjusts SDR gain to try to achieve a minimum dynamic range, regardless of the exact hardware in the RF path.

Burst (loud message) control is enabled by the --adaptive-burst option. This decreases SDR gain when undecodable loud messages are heard, allowing for better reception of nearby aircraft at the expense of range.

This is only the basic implementation - see the PR for remaining work to do.
2021-06-29 20:11:13 +08:00