%% Spectral Content of Sinusoid
% Define a cosine of 200 Hz embedded in white noise.

Fs = 1000;
t = 0:1/Fs:.3;
x = cos(2*pi*t*200)+randn(size(t));

%
% View the spectral content of the signal using the Welch algorithm.

Hs = spectrum.welch;
psd(Hs,x,'Fs',Fs)

% Copyright 2012 The MathWorks, Inc.