View Full Version : 3D spectrogram...

01-19-2007, 03:25 AM

Earlier I questioned in this forum how to compute the graphics for a 2D-spectrogram most efficiently


Now I would like to display the spectrogram in 3D so that the audio input is drawn as a moving landscape (in the frequency domain that is); intially in a grid/wire fashion(guess
thousands of people have done this before). So my question is how to do the best way in terms of computational complexity.

The FFT procesing I already have running - so now I have to take care of the drawing.

Initially I thought that maybe I should draw the whole 3D landscape for every arriving FFT frame, but then I thought
that it could be done similar to the spectrogram problem (which was solved by applying an texture offset to the time direction such that it could imitate a circular buffer)

Is it therefore possible to allow the offset in the time direction to increase in infinite time so that I only have to draw the lines from the last FFT frame. What will happen when
the offset variable wraps around- can I control this somehow?

How I'm making myself clear

Thomas :)

01-19-2007, 06:41 AM
Yes it's possible to do that, just reduce the offset value by 1 each time the offset is larger than 1.
it really doesn't matter since the texture coordinates are clamped between 0 and 1, anything above or below that causes it to repeat the texture if the textures wrap parameter is set up in that way (this is the default behaviour).

01-19-2007, 07:30 AM
Thanks a lot for your reply!