biquad-filter-kernel-2
v1.0.0
Published
biquad filter kernel that use high accurate coefficients
Downloads
4
Readme
biquad-filter-kernel-2
biquad filter kernel that use high accurate coefficients
Installation
$ npm install --save biquad-filter-kernel-2
API
constructor()
#process(coeffs, input, output, inNumSamples): void
coeffs: number[][]
filter coefficientsassert(coeffs.length === 5)
assert(coeffs.every(values => values.length === inNumSamples))
- coefficients are
[ b0, b1, b2, a1, a2 ]
(a0 = 1)
input: number[]
input signalassert(input.length === inNumSamples)
output: number[]
output signalassert(output.length === inNumSamples)
inNumSamples: number
number of samples
Usage
const BiquadFilterKernel = require("biquad-filter-kernel-2");
const biquadFilter = new BiquadFilterKernel();
const coeffs = [
0.000606, 0.001213, 0.000606, -1.948941, 0.951366
].map(coeff => new Float32Array(1024).fill(coeff));
const input = new Float32Array(1024).map(Math.random);
const output = new Float32Array(1024);
biquadFilter.process(coeffs, input, output, 1024);
See Also
- biquad-filter-kernel / simple coefficients version
License
MIT