fix gain introduced by filtering
This commit is contained in:
parent
98e227c102
commit
922a5ed607
@ -294,6 +294,7 @@ Interpolator.prototype.process = function(data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function Lowpass(interpolation) {
|
function Lowpass(interpolation) {
|
||||||
|
this.interpolation = interpolation;
|
||||||
var transitionBandwidth = 0.05;
|
var transitionBandwidth = 0.05;
|
||||||
this.numtaps = Math.round(4 / transitionBandwidth);
|
this.numtaps = Math.round(4 / transitionBandwidth);
|
||||||
if (this.numtaps % 2 == 0) this.numtaps += 1;
|
if (this.numtaps % 2 == 0) this.numtaps += 1;
|
||||||
@ -348,7 +349,8 @@ Lowpass.prototype.process = function(input) {
|
|||||||
acc += this.delay[index] * this.coefficients[i];
|
acc += this.delay[index] * this.coefficients[i];
|
||||||
if (isNaN(acc)) debugger;
|
if (isNaN(acc)) debugger;
|
||||||
}
|
}
|
||||||
output[oi] = acc;
|
// gain by interpolation
|
||||||
|
output[oi] = this.interpolation * acc;
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user