Search code examples
c++spectrumanalyzerfftsignal-processing

Real-time spectrum analyzer with API


I'm looking for a C or C++ API that will give me real-time spectrum analysis of a waveform on Windows.

I'm not entirely sure how large a sample window it should need to determine frequency content, but the smaller the better. For example, if it can work with a 0.5 second long sample and determine frequency content to the Hz, that would be wicked-awesome.


Solution

  • I used FFTW a few years ago. It is supposedly fast (though I didn't use it for anything real-time myself) and was certainly pretty easy to use, even on Windows.

    Regarding the window size, see the Nyquist-Shannon sampling theorem.

    (I imagine there are other issues involved when using a window on the data, particularly for low frequencies, but I'm no expert and I couldn't find any useful-looking info about this, so maybe I'm wrong.)