I am new to signal processing, but successfully made a spectrogram with Matlab. It is nice and working, showing the expected output on the graph, but I just cannot understand what the numbers mean on the color axis. The unit of my discrete signal is in pixels.

Now I do not understand the "Power/frequency [dB/Hz]" label of the color bar that Matlab automatically adds. With long googling, I only figured out that the color of a point on this heatmap should be the amplitude=power=loudness (?) (of the given frequency at a given time point).

1, Somewhere I saw in a post that the unit is the same as the unit of the signal. So that means the correct label for my colorbar should be "Pixels"?

2, But then why does the colorbar range from about -150 to 30? How can amplitude values be negative?

3, And the numbers that are represented by the colors for each time and frequency - where do they come from? Are they the numbers that exactly come out of the DFT algorithm (from the 0th element to the N/2th "Nyquist" element)? Or are they somehow mathematically manipulated, or normalized before being plotted to the spectrogram? If the case is the latter, what is the method of this normalization?

4, What is the output dimension or unit, of the bandpower() function for my "pixels" signal in this case?

I appreciate any helping opinion. Thanks in advance!

Anyway, the spectrogram was produced using this code:

signal = ... %%too long to put here
srate = 1250;

signal = signal-mean(signal); %to get rid of the "DC component"
winsize = ceil(length(signal)/10);
shift = ceil(length(signal)/150);
spectrogram(signal, rectwin(winsize), winsize-shift, winsize, srate, 'yaxis');
ylim([0 2]);

This is the input signal, y axis is in unit of pixels: Input signal with dimension in pixels

This is the spectrogram output: Spectrogram output


Your Answer

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

Browse other questions tagged or ask your own question.