From a3c098b68f843a7cdc60cab7ce8b85d664124cb3 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sat, 14 Mar 2026 12:13:03 +0100 Subject: [PATCH] [fix](trx-ft8): correct FT8 SNR to WSJT-X 2500 Hz convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The score from ft8_lib is an averaged uint8 difference between Costas sync tones and their neighbours (each unit = 0.5 dB). The previous score * 0.5 gave the signal-above-adjacent-noise in dB relative to a single 3.125 Hz waterfall bin, yielding values of +5 to +50 dB — all wrong. Subtract 10*log10(2500/3.125) ≈ 29 dB to normalise to the 2500 Hz reference bandwidth used by WSJT-X and expected by PSKReporter: snr = score * 0.5 - 29.0 This maps score 10 (minimum decodable) → -24 dB and score 60 → +1 dB, matching typical WSJT-X SNR report ranges. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Stan Grams --- src/decoders/trx-ft8/src/ft8_wrapper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/decoders/trx-ft8/src/ft8_wrapper.c b/src/decoders/trx-ft8/src/ft8_wrapper.c index 44587bb..c16f6da 100644 --- a/src/decoders/trx-ft8/src/ft8_wrapper.c +++ b/src/decoders/trx-ft8/src/ft8_wrapper.c @@ -234,7 +234,11 @@ int ft8_decoder_decode(ft8_decoder_t* dec, ft8_decode_result_t* out, int max_res dst->text[sizeof(dst->text) - 1] = '\0'; dst->dt_s = time_sec; dst->freq_hz = freq_hz; - dst->snr_db = cand->score * 0.5f; + /* Convert sync score to SNR in dB (WSJT-X 2500 Hz reference bandwidth). + * score is an average uint8 difference between Costas tones and their + * neighbours; each unit = 0.5 dB. Subtract 10*log10(2500/3.125) ≈ 29 dB + * to normalise from a 3.125 Hz bin (6.25 Hz / freq_osr=2) to 2500 Hz. */ + dst->snr_db = cand->score * 0.5f - 29.0f; num_decoded++; }