biquad-filter-kernel-2

1.0.0 • Public • Published

biquad-filter-kernel-2

Build Status NPM Version License

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 coefficients
      • assert(coeffs.length === 5)
      • assert(coeffs.every(values => values.length === inNumSamples))
      • coefficients are [ b0, b1, b2, a1, a2 ] (a0 = 1)
    • input: number[] input signal
      • assert(input.length === inNumSamples)
    • output: number[] output signal
      • assert(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

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i biquad-filter-kernel-2

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mohayonao