MATLAB: Are the values returned by SPECTRUM function different from those returned by SPECTRUM.WELCH function in Signal Processing Toolbox 6.7 (R2007a)

differenceobsoleteSignal Processing Toolboxspectrumspectrum.welch

When I execute the following code:
close all;
Fs = 1000;
t = 0:1/Fs:.3;
x=cos(2*pi*t*200);
Hs=spectrum.welch;
psd(Hs,x,'Fs',Fs)
figure
[p , f]=spectrum(x);
plot(f,10*log10(abs(p).^2) )
I notice approximately a 30 dB difference in the plots resulting from SPECTRUM.WELCH and the SPECTRUM functions.

Best Answer

SPECTRUM function is obsolete starting Signal Processing Toolbox 6.7 (R2007a). The result provided by SPECTRUM function does not have the proper scaling due to, for example, the sampling frequency. That could be the reason for the 30dB difference. Please use SPECTRUM objects instead, which returns the correct result for PSD.
Related Question