Coder Social home page Coder Social logo

webaudiofftperf's Introduction

webaudiofftperf

WebAudio FFT Performance Test

Aim

To have a simple repeatable test for looking at performance of JS FFT implementations run realtime within WebAudio using ScriptProcessorNode now, and AudioWorker node (when that's added) to compare and contrast against native implementation.

This fell out of the WebAudio Spec discussion

How?

Runs simple FFT passes over random data using either dsp.js, jsfft or fft-asm.js. (Please fork and add more)

The FFT size is settable, and so is the length of time the data is collected. The chunkSize for the ScriptProcessorNode is set to the same as FFT size.

The data collected is DOMHighResolutionTimeStamp at the following moments :

  • immediately at the beginning callback of the ScriptProcessorNode : onAudioProcessStart
  • before FFT calculation : onFFTStart
  • after FFT calculation : onFFTEnd
  • at the end of callback of the ScriptProcessorNode: onAudioProcessEnd

Using this data, the current graph plots :

  • the time difference between successive ScriptProcessorNode callbacks : (onAudioProcessStart[index]-onAudioProcessEnd[index-1]) - labelled as Callback (msec)
  • the time taken for the FFT : perf.onFFTEnd[index]-perf.onFFTStart[index] - labelled as FFTTime (msec)

License

MIT

webaudiofftperf's People

Contributors

notthetup avatar chrisguttandin avatar

Stargazers

 avatar Jonas Nyström avatar Hugh Rawlinson avatar  avatar Michael Anthony avatar Christopher Konopka avatar Leonardo avatar Mike Hochanadel avatar

Watchers

 avatar  avatar Hugh Rawlinson avatar James Cloos avatar Michael Anthony 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.