From 95711c3749e2f202f70a2e5c5952c7c62489a1ce Mon Sep 17 00:00:00 2001 From: Adam Wisher <37659188+mrwish7@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:39:36 +0000 Subject: [PATCH] Adjust tx_search weighting Add adjustment to fix slight overweighting of short-range low power transmitters --- server/tx_search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/tx_search.js b/server/tx_search.js index ca3c580..7aad1e4 100644 --- a/server/tx_search.js +++ b/server/tx_search.js @@ -108,7 +108,8 @@ async function processData(data, piCode, rdsPs) { weightDistance = Math.abs(distance.distanceKm - 1500); } let erp = station.erp && station.erp > 0 ? station.erp : 1; - const score = (10 * Math.log10(erp * 1000)) / weightDistance; + let extraWeight = erp >= 5 && distance.distanceKm <= 2500 ? 0.5 : 0; + const score = ((10 * Math.log10(erp * 1000)) / weightDistance) + extraWeight; if (score > maxScore) { maxScore = score; txAzimuth = distance.azimuth;