[fix](trx-ft8): correct FT8 SNR to WSJT-X 2500 Hz convention

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 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-14 12:13:03 +01:00
parent 3c31e16833
commit a3c098b68f
+5 -1
View File
@@ -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++;
}