Saxfield Chatmon
Saxfield Chatmon

Reputation: 15

Is there any way to export the Waterfall Sink image to a png file automatically?

I have been looking at the C++ api for the water fall sink, and would like to take the displayed output and have it saved as a png image instead of displayed on the gui. I know that is is possible to right+click in the window and export an image that way, but am curious if it is possible to make a custom sink block that can maintain the waterfall functionality, but periodically export its image data to a PNG.

I have been looking into the QImage class:https://doc.qt.io/qt-5/qimage.html#save.

Upvotes: 1

Views: 437

Answers (1)

Marcus Müller
Marcus Müller

Reputation: 36352

What you want is quite backwards:

The waterfall is a (very very approximate, by the way) display of a spectrogram estimate, drawn onto a surface for display purposes. You now want to take that surface, and save it programmatically.

The sensible way to deal with that is simply write your signal to a file and then calculate the spectrogram on the signal offline; if you like python, scipy and matplotlib do that for you; look for specgram.

You can of course also write a GNU Radio sink to calculate the same thing and write it as rows to an image, but that really doesn't sound all that useful, because you'll probably not want to use that image before it's complete, anyway. (and streaming still images is not really a common thing to do).

Upvotes: 1

Related Questions