From 83d256e984f2fa916933a204a9929c92a4a6dc6b Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Tue, 23 Sep 2014 14:05:25 +0100 Subject: [PATCH] Fix a thinko in computing the log10 table. (This shouldn't actually affect the resulting SNR since it's just a constant offset, and the errors in signal and noise will cancel out) --- dump1090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dump1090.c b/dump1090.c index 3db8ee5..873faac 100644 --- a/dump1090.c +++ b/dump1090.c @@ -189,7 +189,7 @@ void modesInit(void) { // Prepare the log10 lookup table. // This maps from a magnitude value x (scaled as above) to 100log10(x) for (i = 0; i <= 65535; i++) { - int l10 = (int) round(100 * log10( (i + 365.4798) * 258.433254) ); + int l10 = (int) round(100 * log10( (i + 365.4798) / 258.433254) ); Modes.log10lut[i] = (uint16_t) ((l10 < 65535 ? l10 : 65535)); }