%% Periodogram at a Given Set of Cyclical Frequencies
% Create a signal consisting of two sine waves with frequencies of 100 and 200 Hz in N(0,1) white additive noise. The sampling frequency is 1 kHz. Obtain the two-sided periodogram at 100 and 200 Hz.

fs = 1000;
t = 0:0.001:1-0.001;
x = cos(2*pi*100*t)+sin(2*pi*200*t)+randn(size(t));

freq = [100 200];
pxx = periodogram(x,[],freq,fs)

% Copyright 2015 The MathWorks, Inc.