TX search algorithm tweak

Use dBW rather than kW in TX search algorithm to try to prevent over-weighting of more powerful transmitters
This commit is contained in:
Adam Wisher
2024-02-20 12:07:33 +00:00
committed by GitHub
parent 5c4e669efd
commit 74ce27cc46
+1 -1
View File
@@ -50,7 +50,7 @@ function processData(data, piCode, rdsPs) {
for (const station of city.stations) {
if (station.pi === piCode && !station.extra && station.ps && station.ps.toLowerCase().includes(rdsPs.replace(/ /g, '_').replace(/^_*(.*?)_*$/, '$1').toLowerCase())) {
const distance = haversine(serverConfig.identification.lat, serverConfig.identification.lon, city.lat, city.lon);
const score = station.erp / distance.distanceKm; // Calculate score
const score = (10*Math.log10(station.erp*1000)) / distance.distanceKm; // Calculate score
if (score > maxScore) {
maxScore = score;
txAzimuth = distance.azimuth;