simple optimization to filter
just basic algebra, but I should have noticed this sooner!
This commit is contained in:
parent
ea423577f0
commit
f6113fc6c4
1 changed files with 2 additions and 2 deletions
4
xm.js
4
xm.js
|
|
@ -90,8 +90,8 @@ function filterCoeffs(f_c) {
|
|||
var e = Math.exp(-wct);
|
||||
var c = e * Math.cos(wct);
|
||||
var s = e * Math.sin(wct);
|
||||
var gain = (1 - 2*c + c*c + s*s) / 2;
|
||||
return [gain, 2*c, -c*c - s*s];
|
||||
var gain = (1 - 2*c + e*e) / 2;
|
||||
return [gain, 2*c, -e*e];
|
||||
}
|
||||
|
||||
function updateChannelPeriod(ch, period) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue