var w = new Waveform(1024,{doubleBuffer:true,bits:16});
var a = new Uint16Array(1024);
w.on("buffer", function(buf) {
a.set(buf);
E.FFT(a);
var m=0,n=-1;
for (var i=100;i<500;i++)if(a[i]>n)n=a[m=i];
console.log(m.toFixed(0)+"Hz @ "+n);
});
w.startInput(D2,1024,{repeat:true});
but have :
***Uncaught Error: Insufficient stack for computing FFT
at line 8 col 12
E.FFT(a);***
Is it possible to measure 500Hz frequency or we are restricted by the Puck's memory ?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi @Gordon,
I am running with firmware 1v99.50 and trying run your example at https://www.espruino.com/Waveform
but have :
***Uncaught Error: Insufficient stack for computing FFT
at line 8 col 12
Is it possible to measure 500Hz frequency or we are restricted by the Puck's memory ?