Skip to content

Commit

Permalink
Increase Unmatched Reset Threshold in ToneDetector
Browse files Browse the repository at this point in the history
Increases the reset threshold to improve reliability in detecting high pitched tones on analog systems.
  • Loading branch information
kdolan authored Oct 7, 2022
1 parent 5b4cfd7 commit 729ecb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions obj/ToneDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ToneDetector{
else{
if(this.state === MATCH_STATES.MATCH_IN_PROGRESS) {
this._unmatchedCount++;
if(this._unmatchedCount >= this.matchThreshold * 2)
if(this._unmatchedCount >= this.matchThreshold * 3)
this.resetMatch();
}
return {match: false, warn: false};
Expand Down Expand Up @@ -95,4 +95,4 @@ class ToneDetector{
}
}

module.exports = {ToneDetector, MATCH_STATES};
module.exports = {ToneDetector, MATCH_STATES};

0 comments on commit 729ecb3

Please sign in to comment.