You are reading a single comment by @user73560 and its replies. Click here to read the full conversation.
  • Hi @Gordon,

    Adding the two results for one seconds works better for me with 200Hz test.

    var p=0, sBuff=new Uint8Array(2), sN=new Uint8Array(2);
    function soundTest() {
      var w = new Waveform(512,{doubleBuffer:true,bits:16}­);
      var a = new Uint16Array(512);
      w.on("buffer", function(buf) {
        a.set(buf);
        E.FFT(a);
        var m=0,n=-1;
        for (var i=50;i<250;i++)if(a[i]>n)n=a[m=i];
        sBuff[p]=m;
        sN[p]=n;
        if(p==1){
          var avgF=E.sum(sBuff);
          var nAvg=E.sum(sN);
          console.log(avgF+"Hz @ "+nAvg);
          p=0;
        } else {
          p=1;
        }
      });
      w.startInput(D2,1024,{repeat:true});
    }
    

    Do you know what is the accuracy loss on doubling the input sound compared to the buffer we have for processing ?

About

Avatar for user73560 @user73560 started