This information has been incorporated into the documentation in the Signal Processing Toolbox 6.9 (R2009b). For previous releases, read below for any additional information:
As per the documentation of the spectrogram function,
[S,F,T,P] = spectrogram(x,window,noverlap,F,fs)
returns a matrix P containing the power spectral density (PSD) of each segment and S is the short time Fourier transform of the input signal vector x.
However, there are some scaling factors also involved, namely the scaling by power of the window used and scaling by sampling frequency fs. The exact mathematical relation is as follows:
P = Power of Signal/(fs*Power of the window)
The following code demonstrates this relationship:
T = 0:0.001:2;
X = chirp(T,0,1,150);
F = 0:.1:100;
win = hamming(256);
[S,F,T,P] = spectrogram(X,win,250,F,1E3,'yaxis');
In this example, sampling frequency fs = 1e3, and window is Hamming of size 256.
Power of window = win'*win;
Power of Signal = S.*conj(S)/Power of window;
P = Power of Signal./Fs
Best Answer