Fs = 4096;
freq1 = 64;
amp1 = 1;
freq2 = 256;
amp2 = 2;

time = 0:1/Fs:1-1/Fs;
sig1 = amp1 * sin(2 * pi * freq1 * time);
sig2 = amp2 * sin(2 * pi * freq2 * time);
sig1and2 = sig1 + sig2;

plot(time, sig1, time, sig2, time, sig1and2);

%

window = ones(1,length(time));
pwelch(sig1,window,0,Fs, 'power');
pwelch(sig2,window,0,Fs, 'power');
pwelch(sig1and2,window,0,Fs, 'power');

%

HammingWindow = hamming(1024);
pwelch(sig1and2,HammingWindow,0, 'power');