rx: fix squelch level tracking
Thanks to rudi_s for reporting this.
This commit is contained in:
parent
d3b0ac1e0a
commit
e22b9ed4c5
|
@ -163,7 +163,9 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i
|
||||||
if(level < rx->noise_floor_level) {
|
if(level < rx->noise_floor_level) {
|
||||||
rx->noise_floor_level = level;
|
rx->noise_floor_level = level;
|
||||||
} else {
|
} else {
|
||||||
level += 1e-4f; // slowly increase the measured noise floor level to compensate for drift
|
// Slowly increase the measured noise floor level to compensate for drift.
|
||||||
|
// Adjustment value is in dB.
|
||||||
|
rx->noise_floor_level += 1e-4f;
|
||||||
}
|
}
|
||||||
agc_crcf_squelch_set_threshold(rx->agc, rx->noise_floor_level + 10.0f); // in dB
|
agc_crcf_squelch_set_threshold(rx->agc, rx->noise_floor_level + 10.0f); // in dB
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue