Giter VIP home page Giter VIP logo

dsp-kit's Introduction

dsp-kit

A digital signal processing library in Javascript

Build Status Code Climate js-standard-style license

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:

  • dsp: a facade module that exposes some modules as a coherent package. Probably you just need to install and use that one (unless you are concerned with code size or some esoteric features)
  • array: array utilities
  • dft: discrete fourier implementation (very slow, but easy to understand)
  • elastica: timestretch for web audio api (it will be extracted it is own repo when ready).
  • fft: the default fast fourier algorithm
  • fft-radix2: fast forward fourier algorithm using a Cooley-Tukey radix-2 algorithm
  • fft-asm: a high performance fft implementation based on asm.js (work in progress)
  • fftshift: rotate arrays to perform zero-phasing windowing
  • ola: overlap and add algorithm for time strething
  • oscillator: work in progress
  • noise: functions to generate noise
  • signal: generate and manipulate signals
  • phase-vocoder: phase vocoder algorithm to perform time strething and other signal transformations
  • rfft: real split radix FFT (work in progress)
  • spectrum: spectrum manipulation utilities
  • waa: web audio api interop utilities (wip)
  • window: windowing functions

Install

-npm install dsp-kit

But currently is not updated to latests version. You can install from this repository:

npm i [email protected]:oramics/dsp-kit.git

Documentation

Read the generated API documentation

Development

Clone the repo and install dependencies: npm install and init lerna: lerna bootstrap

Then you can list all the npm tasks with npm run:

  • run tests: npm test
  • run benchmarks: npm run benchmark
  • generate documentation: npm run docs

Credits

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

dsp-kit's People

Contributors

danigb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.