Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

指数シーケンスの自己相関関数

n0 について、28 サンプルの指数シーケンス x=0.95n の自己相関関数を計算します。

a = 0.95;

N = 28;
n = 0:N-1;
lags = -(N-1):(N-1);

x = a.^n;
c = xcorr(x);

c を分析的に判断して結果が正しいかを確認します。より高いサンプル レートを使用して連続状況をシミュレートします。n0 において |a|<1 の場合、シーケンス x(n)=an の自己相関関数は次になります。

c(n)=1-a2(N-|n|)1-a2×a|n|.

fs = 10;
nn = -(N-1):1/fs:(N-1);

dd = (1-a.^(2*(N-abs(nn))))/(1-a^2).*a.^abs(nn);

シーケンスを同じ Figure にプロットします。

stem(lags,c);
hold on
plot(nn,dd)
xlabel('Lag')
legend('xcorr','Analytic')
hold off

Figure contains an axes object. The axes object with xlabel Lag contains 2 objects of type stem, line. These objects represent xcorr, Analytic.

計算を繰り返しますが、今度は自己相関の "不偏推定" を求めます。不偏推定が cu(n)=c(n)/(N-|n|) で求められることを検証します。

cu = xcorr(x,'unbiased');

du = dd./(N-abs(nn));

stem(lags,cu);
hold on
plot(nn,du)
xlabel('Lag')
legend('xcorr','Analytic')
hold off

Figure contains an axes object. The axes object with xlabel Lag contains 2 objects of type stem, line. These objects represent xcorr, Analytic.

計算を繰り返しますが、今度は自己相関の "バイアス推定" を求めます。バイアス推定が cb(n)=c(n)/N で求められることを検証します。

cb = xcorr(x,'biased');

db = dd/N;

stem(lags,cb);
hold on
plot(nn,db)
xlabel('Lag')
legend('xcorr','Analytic')
hold off

Figure contains an axes object. The axes object with xlabel Lag contains 2 objects of type stem, line. These objects represent xcorr, Analytic.

ゼロ ラグの値が 1 である自己相関の推定を求めます。

cz = xcorr(x,'coeff');

dz = dd/max(dd);

stem(lags,cz);
hold on
plot(nn,dz)
xlabel('Lag')
legend('xcorr','Analytic')
hold off

Figure contains an axes object. The axes object with xlabel Lag contains 2 objects of type stem, line. These objects represent xcorr, Analytic.

参考

関数