Difference between spectrogram and a figure in an audio signal

i wrote a function in MATLAB which will divide a audio waveform (a speech) into smaller windows with overlap .The output will be a matrix X, each column of which contains the windows which i export. Then i calculate the FFT of each column, i remove half of fft bins and i visualize the measure of each FFT frame as an image, using the "imagesc" command.Then i made a spectrogram of my signal and it gives me this figure. Im wondering if this two figures are the same or not. Ok it seems that maybe they are the same but why the colors for example are different? Or is there any other difference between this two figures?

• Can you please clarify why do you have to replicate the functionality of the spectrogram function? Also, please note that the colours are simply representing numbers. The best thing to do would be to examine the numbers at the output of your function and MATLAB's spectrogram if you had to do the comparison. – A_A Nov 28 '16 at 12:11
• the question is what i observe from this two figures....because they look the same im wondering if there is a difference between them....i made a spectrogram function with my own way? or there is a difference? Also i used s = spectrogram(x,window,noverlap) to see the spectrogram of my signal . – Gensdimi Nov 28 '16 at 12:18

• The spectrogram is on a log colour scale... For your image try imagesc(log(data)) – geometrikal Nov 28 '16 at 15:49