This package has been deprecated

Author message:

I have no qualification to complete that. Please email if you need this nice package name.

digital-filter

1.0.0 • Public • Published

digital-filter experimental Build Status

Collection of digital filters, for audio & dsp applications.

Usage

npm install digital-filter

Produce 1024 samples of grey noise:

const noise = require('colors-of-noise/white')
const filter = require('digital-filter/loudness')

//generate frame of grey noise
let data = filter(noise(new Float32Array(1024)))

Filters

  • [x] leaky integrator
  • [ ] moving average
  • [ ] biquad
  • [ ] loudness
  • [ ] lowpass
  • [ ] hipass
  • [ ] rumble
  • [ ] flutter
  • [ ] noise
  • [ ] bessel
  • [ ] butterworth
  • [ ] matched
  • [ ] elliptical
  • [ ] linkwitz-riley
  • [ ] chebyshev
  • [ ] savitzky-golay
  • [ ] curve (custom f-curve)

leakyIntegrator(samples, {lambda: 0.95, y: 0})

[FIR]

Leaky integrator.

Takes input array samples and params object, modifies samples in-place. Params object should be shared between subsequent calls.

Params:

  • lambda − defines amount of "leak".
  • y − keeps value of last sample, updated after every call.
let leaky = require('digital-filter/leaky-integrator')

let opts = {lambda: .5}

//render 3 frames
for (let i = 0; i < 3; i++) {
	let data = new Float32Array(1024)
	leaky(data, opts)
}

movingAverage(samples, {memory: 8})

[FIR]

Moving average.

Takes input array samples and params object, modifies samples in-place. Params object should be shared between subsequent calls.

Params:

  • memory − array with initial values of memory. If number, this will create an array of that size.
let ma = require('digital-filter/moving-average')

//average of 5 items
let opts = {memory: 5}

for (let i = 0; i < 3; i++) {
	let data = new Float32Array(1024)
	ma(data, opts)
}

loudness(data, {type: ''})

Implemented filter types:

See also

Package Sidebar

Install

npm i digital-filter

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dfcreative