Adjust squelch level and rampup

This commit is contained in:
Thomas Kolb 2024-04-12 21:50:49 +02:00
parent 91db4e1f75
commit 1f5f922cdf

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) { if(level < rx->noise_floor_level) {
rx->noise_floor_level = level; rx->noise_floor_level = level;
} else { } 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)) { switch(agc_crcf_squelch_get_status(rx->agc)) {
case LIQUID_AGC_SQUELCH_RISE: 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; result = SQUELCH_JUST_OPENED;
break; break;
@ -179,7 +179,8 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i
break; break;
case LIQUID_AGC_SQUELCH_FALL: 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_SIGNALLO:
case LIQUID_AGC_SQUELCH_ENABLED: case LIQUID_AGC_SQUELCH_ENABLED:
case LIQUID_AGC_SQUELCH_TIMEOUT: case LIQUID_AGC_SQUELCH_TIMEOUT: