Fix SNR AM

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-09-21 22:04:33 +02:00
parent 6a48b40acb
commit ef42f24f41
+1 -1
View File
@@ -234,7 +234,7 @@ bool devTEF_Radio_Get_Quality_Status_AM (int16_t *level, uint16_t *noise, uint16
*mod = Convert8bto16b(buf + 12) / 10; *mod = Convert8bto16b(buf + 12) / 10;
if (*level < -200) *level = -200; if (*level < -200) *level = -200;
if (*level > 1200) *level = 1200; if (*level > 1200) *level = 1200;
if (-((int8_t)(*noise / 10)) > *level) *snr = 0; else *snr = -((int8_t)(*noise / 10)) / 10; *snr = int(0.46222375 * (float)(*level) / 10 - 0.082495118 * (float)(*noise/50) / 10) + 10;
return r; return r;
} }