Skip to content

Commit

Permalink
Fix band-pass max value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pcprince committed Jul 17, 2024
1 parent 173aa02 commit 17df0d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/butterworth.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@ function applyBandPassFilter (input, inputLength, output, sampleRate, freq1, fre

}

if (freq2 >= sampleRate / 2) {

console.log('Applying high-pass filter as band-pass top value = Nyquist');

applyHighPassFilter(input, inputLength, output, sampleRate, freq1);

return;

}

const filterCoefficients = designFilter(BUTTERWORTH_FILTER_BAND, sampleRate, freq1, freq2);

const filter = {
Expand Down

0 comments on commit 17df0d0

Please sign in to comment.