tags:

views:

42

answers:

1

I need to locate some generic C++ library that takes the inverse fft output (fftw_complex format, i.e. two doubles) and converts this data to an image file such as png. I can waterfall the dffts to obtain the 2d data (and use 10log10(re*re+im*im) to obtain magnitudes for each frequency component) but I don't know which image library will work.

I did use an older program called zimage at one time, but it seems no longer available. I do not have MATLAB on my Ubuntu 9.10 system (but I do have Octave)

Can Octave generate the waterfall images? I also need to convert the spectrogram into a wav sound file too.

Any ideas??

A: 

The easiest image format to create is PNM. You can print it as a text file, and then convert it using most graphics programs. Here is an example from the Wikipedia page:

P2 24 7 15
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  3  3  3  3  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15 15 15 15  0
0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0 15  0
0  3  3  3  0  0  0  7  7  7  0  0  0 11 11 11  0  0  0 15 15 15 15  0
0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0  0  0
0  3  0  0  0  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0

Save that text in a file named "feep.pgm", and you'll see what I mean.

http://en.wikipedia.org/wiki/Netpbm_format

You'll have to scale your 10log10 information to pixel values.

xscott