We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db3dd16 commit eccc0a3Copy full SHA for eccc0a3
src/PitchDetection/index.js
@@ -79,7 +79,7 @@ class PitchDetection {
79
const productSum = products.dataSync().reduce((a, b) => a + b, 0);
80
const weightSum = weights.dataSync().reduce((a, b) => a + b, 0);
81
const predictedCent = productSum / weightSum;
82
- const predictedHz = 10 * ((predictedCent / 1200.0) ** 2);
+ const predictedHz = 10 * (2 ** (predictedCent / 1200.0));
83
84
const frequency = (confidence > 0.5) ? predictedHz : null;
85
this.frequency = frequency;
0 commit comments