我试图在MATLAB中估计信号的不连续片段的平均相干性。对于韦尔奇的频谱估计,以下工作:
w = blackmanharris(50); % window
n = numel(w); % fft length
o = 0; % overlap
x = rand(200,1); x1 = x(1:100); x2 = x(101:200);
s = pwelch(x, w, o, n);
s1 = pwelch(x1, w, o, n);
s2 = pwelch(x2, w, o, n);
sa = (s1+s2)/2;
max(abs(s-sa)) % almost zero
然而,当使用Welch的方法估计相干性时,算术平均值会产生错误的结果:
y = rand(200,1); y1 = y(1:100); y2 = y(101:200);
c = mscohere(x, y, w, o, n);
c1 = mscohere(x1, y1, w, o, n);
c2 = mscohere(x2, y2, w, o, n);
ca = (c1+c2)/2;
max(abs(c-ca)) % very different from zero
如何正确平均两个相干估计?