randn('state',0);

Fs = 1024;   
t = 0:1/Fs:1-1/Fs;

A1signal = 3;
F1 = 64;

A2signal = 6;
F2 = 96;

Anoise = 0.0;

x = (A1signal*cos(2*pi*t*F1)) + (A2signal*cos(2*pi*t*F2)) + (Anoise * randn(size(t)));   

Fxx = 2* abs(fft(x));

%[Pxx, f] = pwelch(x,rectwin(1024),0,length(x),Fs);
welchPxx = pwelch(x,rectwin(1024),0,length(x),Fs);
welchPxx(65)
welchPxx(97)

Hs = spectrum.welch('Rectangular', 1024, 0);
psdPxx = psd(Hs, x, 'Fs', Fs);
psdPxx.Data(65)
psdPxx.Data(97)
