Spectrogram in C++

S

sergief

Hi,
I am working in a project of computer vision, but I have problem...

I need an application written in C++ that converts an audio file (i.e.
wav..) in a spectrogram (png, jpeg or something).
I have found an application called "spectromatic" written in C that
works in Linux, but i have tried to port it in Windows (I am working
with Visual C++) and it doesn't work, I dont know why. I suppose that
the problem lies in the GSL library for Win32, but I'm not completely
sure.


Could you give me some ideas? I don't know where to search that.

I know, I can use Matlab for doing it, but I need to do that in C++
language.

Thanks,
 
S

Steve Pope

I need an application written in C++ that converts an audio file (i.e.
wav..) in a spectrogram (png, jpeg or something).
I have found an application called "spectromatic" written in C that
works in Linux, but i have tried to port it in Windows (I am working
with Visual C++) and it doesn't work, I dont know why. I suppose that
the problem lies in the GSL library for Win32, but I'm not completely
sure.
Could you give me some ideas? I don't know where to search that.
I know, I can use Matlab for doing it, but I need to do that in C++
language.

You should separate the problem into two parts: first, windowing
the data and computing its power spectral density (PSD); then, creating
the output graphic.

Since you say you know how to do it in Matlab, perhaps a
first step would be to code the PSD part of it in Matlab
(using basic arithmetic and math operations, not complicated
library functions), and then translate this manually into C++.
In C++, use any of the math functions in <cmath> since these
are standard. By comparing the two versions, and doing a quick
Matlab plot of the output, you will be able to determing if
the algorithmic part of your C++ program is correct.

Then, it remains to translate your PSD data into a graphic. Since
C++ does not have built-in graphic primitives, the question is
beyond the scope of this newsgroup but perhaps others will have
graphics library suggestions. (Personally, I use either Matlab
or Excel for plotting, but if you want something integral to
your C++ program, you'll need to use a library.)

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top