メインコンテンツ

マルチチャネル入力における相互相関

0.4n0.7n、および 0.999n (n0) で得られる 11 サンプルの指数シーケンスを 3 つ作成します。stem3 を使用してシーケンスを並べてプロットします。

N = 11;
n = (0:N-1)';

a = 0.4;
b = 0.7;
c = 0.999;

xabc = [a.^n b.^n c.^n];

stem3(n,1:3,xabc','filled')
ax = gca;
ax.YTick = 1:3;
view(37.5,30)

Figure contains an axes object. The axes object contains an object of type stem.

シーケンスの自己相関と相互相関を計算します。継続して追跡する必要がないようにラグを出力します。ゼロ ラグで自己相関が単位値をもつように結果を正規化します。

[cr,lgs] = xcorr(xabc,'coeff');

for row = 1:3
    for col = 1:3
        nm = 3*(row-1)+col;
        subplot(3,3,nm)
        stem(lgs,cr(:,nm),'.')
        title(sprintf('c_{%d%d}',row,col))
        ylim([0 1])
    end
end

Figure contains 9 axes objects. Axes object 1 with title c indexOf 11 baseline contains an object of type stem. Axes object 2 with title c indexOf 12 baseline contains an object of type stem. Axes object 3 with title c indexOf 13 baseline contains an object of type stem. Axes object 4 with title c indexOf 21 baseline contains an object of type stem. Axes object 5 with title c indexOf 22 baseline contains an object of type stem. Axes object 6 with title c indexOf 23 baseline contains an object of type stem. Axes object 7 with title c indexOf 31 baseline contains an object of type stem. Axes object 8 with title c indexOf 32 baseline contains an object of type stem. Axes object 9 with title c indexOf 33 baseline contains an object of type stem.

ラグの計算範囲を -55 に制限します。

[cr,lgs] = xcorr(xabc,5,'coeff');

for row = 1:3
    for col = 1:3
        nm = 3*(row-1)+col;
        subplot(3,3,nm)
        stem(lgs,cr(:,nm),'.')
        title(sprintf('c_{%d%d}',row,col))
        ylim([0 1])
    end
end

Figure contains 9 axes objects. Axes object 1 with title c indexOf 11 baseline contains an object of type stem. Axes object 2 with title c indexOf 12 baseline contains an object of type stem. Axes object 3 with title c indexOf 13 baseline contains an object of type stem. Axes object 4 with title c indexOf 21 baseline contains an object of type stem. Axes object 5 with title c indexOf 22 baseline contains an object of type stem. Axes object 6 with title c indexOf 23 baseline contains an object of type stem. Axes object 7 with title c indexOf 31 baseline contains an object of type stem. Axes object 8 with title c indexOf 32 baseline contains an object of type stem. Axes object 9 with title c indexOf 33 baseline contains an object of type stem.

自己相関と相互相関の不偏推定を計算します。既定では、ラグは -(N-1)N-1 の間で実行されます。

cu = xcorr(xabc,'unbiased');

for row = 1:3
    for col = 1:3
        nm = 3*(row-1)+col;
        subplot(3,3,nm)
        stem(-(N-1):(N-1),cu(:,nm),'.')
        title(sprintf('c_{%d%d}',row,col))
    end
end

Figure contains 9 axes objects. Axes object 1 with title c indexOf 11 baseline contains an object of type stem. Axes object 2 with title c indexOf 12 baseline contains an object of type stem. Axes object 3 with title c indexOf 13 baseline contains an object of type stem. Axes object 4 with title c indexOf 21 baseline contains an object of type stem. Axes object 5 with title c indexOf 22 baseline contains an object of type stem. Axes object 6 with title c indexOf 23 baseline contains an object of type stem. Axes object 7 with title c indexOf 31 baseline contains an object of type stem. Axes object 8 with title c indexOf 32 baseline contains an object of type stem. Axes object 9 with title c indexOf 33 baseline contains an object of type stem.

参考

関数