views:

164

answers:

2

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.

+2  A: 

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.)

brone
A: 

For details of how to generate a power spectrum and how to determine frequency resolution of same, please see my answer to this question: http://stackoverflow.com/questions/2881583/how-to-extract-semi-precise-frequencies-from-a-wav-file-using-fourier-transforms/2885833#2885833

Paul R
Yes yo, that's a great answer!
bobobobo