asustant
Newbie level 2
Hi all. I'm doing some spectrum estimation. Here are codes, I used Welch method (without using pwelch func.) with no overlap. Now I want to do it with %50 overlap to see the difference, which parts should I change for this purpose?
Code:
Fs = 8000;
x = y1; %80x1 matrix
Nx = length(x);
w = hann(Nx);
xw = x.*w;
nfft = Nx;
X = fft(xw,nfft);
mx = abs(X).^2;
mx = mx/(w'*w);
NumUniquePts = nfft/2+1;
mx = mx(1:NumUniquePts);
mx(2:end-1) = mx(2:end-1)*2;
Pxx1 = mx/Fs;