Your value for $f_s$ is missing. Assuming you work above Nyquist sampling rate (i.e. $f_s > 2*f_{sig}$), I obtain the following results:
fs = 20000;
len = 16384;
fsig = 1000;
Sig = 1.5 * sin( (1:len) * 2 * pi * fsig / fs);
fsig = 700;
Sig = Sig + 0.9 * sin( (1:len) * 2 * pi * fsig / fs);
[matWelchD1, matWelchF1] = pwelch(Sig, length(Sig), 0, [], fs);
[matWelchD2, matWelchF2] = pwelch(Sig, ceil(length(Sig)/2), 0, [], fs);
subplot(2,1,1);
plot(matWelchF1, (matWelchD1), '-o'); grid;
subplot(2,1,2);
plot(matWelchF2, (matWelchD2), '-o'); grid;
df1 = matWelchF1(2) - matWelchF1(1);
df2 = matWelchF2(2) - matWelchF2(1);
df1
df2
Output:
df1 =
1.2207
df2 =
2.4414

As you can see, both frequencies are nicely represented in the figures.
One more comments on the window length (i.e. second parameter to pwelch): It determines how big the sections are, into which the signal is divided. Each section is multiplied with a Hamming window and then the FFT is taken. Afterwards, the values of all FFTs are summed together, yielding the PSD estimate.
I.e. putting the signal length as the window length, would result in a single section. For your stationary signal this is fine, but in reality you would want to have a smaller value, or leave the parameter out (or use the empty vector []
), such that the PSD can be more accurately estimated.
As you can see, different window length create a different amount of frequency samples: The longer the window, the more frequency samples. NOte that pwelch calculates the Power Spectral Density, i.e. the power per Hertz. In order to get the energy of a frequency you need to multiply with the bandwidth of each bin:
>> sum(matWelchD1) * (matWelchF1(2)-matWelchF1(1))
ans =
1.5300
>> sum(matWelchD2) * (matWelchF2(2)-matWelchF2(1))
ans =
1.5300
Both PSDs contain the same overall energy. Since the frequency samples in the first PSD are closer to each other, the PSD has higher peaks for each frequency (to deliver the same overall power).
welch
and those familes. I would recommend you to drop it, and to use the standard FFT. The welch methods are not properly configured, and it is equivalent to use a frequency filtered FFT instead the welch inconsistencies...... $\endgroup$ – Brethlosze Nov 18 '16 at 2:01