A digital signal processing library in Javascript
A digital signal processing library in Javascript
This is my journey to study dsp. This library is not intended to be used.. There are excellent dsp js libraries out there, for example:
Since I usually learn by coding, this is my code learning result. I'm building while trying to understand the main concepts of dsp targeting audio applications.
Work in progress. Experimental (API). Not sure if it will be published, currently is just a playground to understand DSP concepts.
const dsp = require('dsp-kit')
const signal = dsp.fill(1024, (x) => Math.sin(x))
const { magnitudes, phases } = dsp.spectrum(dsp.fft(1024, signal))
// generate a signal adding two sines
const oscillator = dsp.fill(1024, dsp.add(dsp.sine(440), dsp.sine(880)))
This is a multimodule repository, each functionallity wrapped in its own package:
But currently is not updated to latests version. You can install from this repository:
npm i [email protected]:oramics/dsp-kit.git
Read the generated API documentation
Clone the repo and install dependencies: npm install
and init lerna: lerna bootstrap
Then you can list all the npm tasks with npm run
:
npm test
npm run benchmark
npm run docs
Large part of the code is based on the now unmantained dsp.js library by @corbanbrook, that in turn was based on code samples by Almer Thie.
Also, this library takes (steal) inspiration from:
## References