views:

535

answers:

2

Hi

For my current project in C++ / Qt I need a library (LGPL is preferred) which can calculate a spectrogram from a signal ( basically an array of doubles ). I already use Qwt for the GUI part.

Any suggestions? Thanks.

+1  A: 

you could use fftw (fftw.org) to calculate the spectrogram, you would still need to plot the data, but that should not be a problem

ted
+5  A: 

It would be fairly easy to put together your own spectrogram. The steps are:

  1. window function (fairly trivial, e.g. Hanning)
  2. FFT (FFTW would be a good choice but if licensing is an issue then go for Kiss FFT or similar)
  3. calculate log magnitude of frequency domain components (trivial: log(sqrt(re * re + im * im))
Paul R
Since log(sqrt(x)) = (1/2)log(x), you can make it run faster without sqrt()
DarenW
@DarenW -- indeed - since we are typically working with dB then instead of doing 20*log10(sqrt(x)) we can just do 10*log10(x).
Paul R