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? enter image description here

  • $\begingroup$ 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. $\endgroup$ – A_A Nov 28 '16 at 12:11
  • $\begingroup$ 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 . $\endgroup$ – Gensdimi Nov 28 '16 at 12:18

The spectrogram is displayed on the log scale.

| improve this answer | |
  • $\begingroup$ You mean that the 1st figure is diplayed on the log scale? and if indeed it is from where the log came from? as I described above, I didnt use log in my calculations $\endgroup$ – Gensdimi Nov 28 '16 at 13:56
  • 2
    $\begingroup$ The spectrogram is on a log colour scale... For your image try imagesc(log(data)) $\endgroup$ – geometrikal Nov 28 '16 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.