Spectrogram C++ library

2019-01-16 19:27发布

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.

4条回答
一夜七次
2楼-- · 2019-01-16 20:10

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))
查看更多
时光不老,我们不散
3楼-- · 2019-01-16 20:23

"How do I create a frequency vs time plot?" lists several libraries, each of which can calculate a spectrogram from a signal.

Copied and pasted from my own answer:

Some source code to generate spectrograms / waterfall plots from audio data:

Image to Spectrogram goes in the reverse direction from the above utilities.

查看更多
叛逆
4楼-- · 2019-01-16 20:27

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

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-01-16 20:29

You can use FFT code from here. It uses C++ template metaprogramming for efficiency. The full source is provided by the author here.

It was suggested to include this code into Eigen for its use of templated (type friendly) code.

查看更多
登录 后发表回答