You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • analogRead is limited more by the speed of execution than anything else. You might be looking at 2000 samples/sec?

    There is however the Waveform class which will do what you want (it even contains an example of making a sound meter) - but I wouldn't push that much beyond 20kHz.

    Having said that, if you try doing a spectrum analyser in Espruino you may find that you hit issues with Espruino's processing speed pretty quickly. It's not going to be great at doing realtime FFTs in JavaScript :)

    I've implemented things like E.variance(...) to work around this a little, and I guess I could look at implementing E.convolve(a,b,offset) which would allow you to quickly work out how much of a certain frequency was in a sound sample.

About

Avatar for Gordon @Gordon started