Giter Club home page Giter Club logo

pulsefft's Introduction

Pulse FFT


A WebAssembly implementation of kissFFT, the 'keep-it-simple-stupid' Fast Fourier Transform library written in C. This project allows forward and inverse FFTs to be computed with low-level processes in the browser with the performant WebAssembly format.

Sample app

Watch Pulse convert real-time microphone input from the time/space domain to the frequency domain.

Frequency Spectrum

Get Started

Download Emscripten

$ git clone https://github.com/juj/emsdk.git
$ cd emsdk
$ ./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit
$ ./emsdk activate --build=Release sdk-incoming-64bit binaryen-master-64bit

Usage

This library is a WebAssembly implementation of kissFFT; consult the kissFFT README if you want more info on the internal FFT details.

Instantiate Pulse

let pulse = {};
loadPulse()
    .then(module => {
        pulse = module;
    })

Real Input

// Create the WebAssembly instance.
const fft = new pulse.fftReal(size);
fft.forward(input)

Complex Input

// Create the WebAssembly instance.
const fft = new pulse.fftComplex(size);
fft.forward(input)

Performance tests

For the benchmark test, 4000 iterations were performed on sample data of several different sizes (4, 8, 512, 2048, and 4096) on both .asm and .wasm formats. Both single-precision real and complex to complex FFT forwards were performed. The times for the first and second half of each test are shown separately to elucidate any differences caused by the Javascript engine warming up. The last column shows the rate at which each algorithm performed the 4000 iterations. For the larger buffer sizes, the Web Assembly compiled functions are consistently faster than their assembly compiled counterparts.

Development

Make sure to clone the repo recursively, in order to get KissFFT.

git clone --recursive https://github.com/AWSM-WASM/PulseFFT.git

When finished, run npm start. This wil run the emsdk environment, compile the source code, and start the server at //localhost.8000.

Demo page coming soon!

Setup

KissFFT is not bundled in the source of this repository.

Collaborators

Jo Zhou
Augusto Alvarez
Chris Kim

Contributing

Please submit issues/pull requests if you have feedback or message the PulseFFT team to be added as a contributor: [email protected]

Roadmap

Here's our top development priorities

  • Caching .wasm client-side
  • Enabling >ES6 module loading
  • Refactoring to use async/await
  • Adding robust Mocha/Chai/Sinon testing
  • Logging / Debugging mode for development, feedback, and error reporting
  • Performance and stability updates
  • Improved documentation
  • Bundle and create npm package

License

PulseFFT is licensed under the MIT License.
KissFFT is licensed under the Revised BSD License.

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.