biquad-filter-kernel
v1.0.0
Published
biquad filter kernel that use simple coefficients
Downloads
10
Readme
biquad-filter-kernel
biquad filter kernel that use simple coefficients
Installation
$ npm install --save biquad-filter-kernel
API
constructor()
#process(coeffs, input, output, inNumSamples): void
coeffs: number[]
filter coefficientsassert(coeffs.length === 5)
- 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");
const biquadFilter = new BiquadFilterKernel();
const coeffs = [ 0.000606, 0.001213, 0.000606, -1.948941, 0.951366 ];
const input = new Float32Array(1024).map(Math.random);
const output = new Float32Array(1024);
biquadFilter.process(coeffs, input, output, 1024);
See Also
- biquad-filter-kernel-2 / high accurate coefficients version
License
MIT