Adjust squelch level and rampup

This commit is contained in:
Thomas Kolb 2024-04-12 21:50:49 +02:00
parent 91db4e1f75
commit 1f5f922cdf
1 changed files with 5 additions and 4 deletions

View File

@ -163,14 +163,14 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i
if(level < rx->noise_floor_level) {
rx->noise_floor_level = level;
} else {
level += 1e-3; // slowly increase the measured noise floor level to compensate for drift
level += 1e-4f; // slowly increase the measured noise floor level to compensate for drift
}
agc_crcf_squelch_set_threshold(rx->agc, rx->noise_floor_level + 3.0f); // in dB
agc_crcf_squelch_set_threshold(rx->agc, rx->noise_floor_level + 10.0f); // in dB
}
switch(agc_crcf_squelch_get_status(rx->agc)) {
case LIQUID_AGC_SQUELCH_RISE:
DEBUG_LOG("Squelch disabled at RSSI = %.3f dB\n", level);
DEBUG_LOG("Squelch disabled at #%u RSSI = %.3f dB [thr: %.3f dB]\n", sample_idx, level, agc_crcf_squelch_get_threshold(rx->agc));
result = SQUELCH_JUST_OPENED;
break;
@ -179,7 +179,8 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i
break;
case LIQUID_AGC_SQUELCH_FALL:
DEBUG_LOG("Squelch enabled at RSSI = %.3f dB\n", level);
DEBUG_LOG("Squelch enabled at #%u RSSI = %.3f dB [thr: %.3f dB]\n", sample_idx, level, agc_crcf_squelch_get_threshold(rx->agc));
// fall through
case LIQUID_AGC_SQUELCH_SIGNALLO:
case LIQUID_AGC_SQUELCH_ENABLED:
case LIQUID_AGC_SQUELCH_TIMEOUT: