I have already obtain a 2D array of amplitudes for each time and frequency. However, to plot a spectrogram, the pixel intensity should be according to the level of amplitude (ex. Red highest green lowest).
(I got the amplitude from FFT and sqrt(real^2+img^2))
First I convert it to logarithmic scale by 10*log10(amplitude^2) (*i'm not sure how to manage when amp is 0, no error comes up)
Then, i simply find Mix_amp and scale all the elements to value between 0-1.
The problem is. When generating a spectrogram from noise free sound like a computer generated sweeping sound from 20-20kHz i got a nicely upward straightline. However, with actual song, the characteristic of spectrogram seems to be not distinct enough so its going to be difficult when i want to apply peak finding for the later phase.
Did i do something not right for the processes?