You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I don't know exactly, no. You'd have to do some research - it's all standard FFT stuff.

    I'm not convinced by your averaging at all, but hey, if it works for you...

    If you really want a better result, average the entire array after the FFT, and do your calculations on that. If you know you have one single frequency then you can even get a more accurate idea of the frequency by looking at the relative size of the FFT peaks, eg:

    // exactly that frequency
    0,0,0,0,0,255,0,0,0,0,0
    // halfway between two frequencies
    0,0,0,0,0,128,128,0,0,0,0,0
    // nearer the first frequency than the next one
    0,0,0,0,0,192,64,0,0,0,0
    
About

Avatar for Gordon @Gordon started