From 922a5ed6072991bdb9cf621e73f98786fdc7923c Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 9 Jan 2020 21:44:36 +0100 Subject: [PATCH] fix gain introduced by filtering --- htdocs/lib/AudioEngine.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/AudioEngine.js b/htdocs/lib/AudioEngine.js index c2c9a65..7e67042 100644 --- a/htdocs/lib/AudioEngine.js +++ b/htdocs/lib/AudioEngine.js @@ -294,6 +294,7 @@ Interpolator.prototype.process = function(data) { }; function Lowpass(interpolation) { + this.interpolation = interpolation; var transitionBandwidth = 0.05; this.numtaps = Math.round(4 / transitionBandwidth); if (this.numtaps % 2 == 0) this.numtaps += 1; @@ -348,7 +349,8 @@ Lowpass.prototype.process = function(input) { acc += this.delay[index] * this.coefficients[i]; if (isNaN(acc)) debugger; } - output[oi] = acc; + // gain by interpolation + output[oi] = this.interpolation * acc; } return output; }; \ No newline at end of file