I have written a code to calculate the spectrogram of a sine & cos signals, applied the Hann Window, calculated FFT, Calculated log magnitude of frequency coefficients.
I tested that it is all working by writing a simple function in openGL to plot a magnitude-frequency spectrum and I got the following results:
As you can see, there are 2 bars which indicates the sine * cos waves.
I have all the information I need to plot a spectrogram (frequencies,magnitude,time) Now my question is how can I draw that? my first thought was to draw dots, so I'll use the time array for the interval time I need to draw the dots on the X axie, frequencies array to where to draw them on the Y axis, and the magnitude would be the color of the dot.
Maybe that's an inefficient idea because I saw that drawing dots is really inefficient in openGL so I don't know what's a better idea, I couldn't find any "simple" examples of openGL spectrogram online.