How can I calculate the mean-squared spectrogram instead of PSD spectrogram?

Illustration
Timothy - 2021-03-19T14:58:25+00:00
Question: How can I calculate the mean-squared spectrogram instead of PSD spectrogram?

I use the SPECTROGRAM function on a signal as shown below:     T = 0:0.001:2; X = chirp(T,100,1,200,'q'); spectrogram(X,128,120,128,1E3); However, I would like to plot the mean-squared or MS spectrum instead of Power Spectral Density (PSD).

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

This feature is not available in the Signal Processing Toolbox in MATLAB 7.3 (R2006b).
 
To work around this issue, spectrum objects are available that allow you to calculate the mean-squared spectrum.
 
For example, you can perform the following in the MATLAB command prompt to view the MS spectrum:
Fs=1000;

t=0:1/Fs:.3;

x=cos(2*pi*t*200)+randn(size(t));

Hs=spectrum.periodogram;

msspectrum(Hs,x,'Fs',Fs)


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!