Added ~13dB to account for discrepancy between S-meter and FFT data.

This commit is contained in:
Marat Fayzullin 2023-05-12 22:51:56 -04:00
parent de0560b95a
commit 6e717ac656
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}