From 1f5f922cdf2695004207f6e74d21ff64e173f2d5 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Fri, 12 Apr 2024 21:50:49 +0200 Subject: [PATCH] Adjust squelch level and rampup --- impl/src/layer1/rx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/impl/src/layer1/rx.c b/impl/src/layer1/rx.c index 802251c..442d9bd 100644 --- a/impl/src/layer1/rx.c +++ b/impl/src/layer1/rx.c @@ -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: