From 6e717ac6568a76881941bbcc9de6a43c1ff6fab0 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Fri, 12 May 2023 22:51:56 -0400 Subject: [PATCH] Added ~13dB to account for discrepancy between S-meter and FFT data. --- htdocs/lib/Scanner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/Scanner.js b/htdocs/lib/Scanner.js index 23b6257e..14170c03 100644 --- a/htdocs/lib/Scanner.js +++ b/htdocs/lib/Scanner.js @@ -30,7 +30,7 @@ Scanner.prototype.update = function(data) { var b = this.bookmarks[j]; if (b.frequency > 0) { var l = data[(b.pos * data.length) | 0]; - b.level += (l - b.level) / 5.0; + b.level += (l - b.level) / 3.0; } } } @@ -56,7 +56,8 @@ Scanner.prototype.scan = function() { //console.log("SCAN: " + b.name + " at " + b.frequency + ": " + b.level); // If level exceeds threshold, tune to the bookmark - if (b.level>this.threshold && this.tuneBookmark(b)) { + // (why do we need to add ~13dB here to match the S-meter?) + if (b.level + 13.0 > this.threshold && this.tuneBookmark(b)) { this.current = j; return; }