Main Content

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

相互相関を使用した信号の整列

実測では、複数のセンサーによって非同期に収集されたデータを含む場合が往々にしてあります。信号を積分し、並べて調べるには、信号を同期しなければなりません。この処理には xcorr を使用します。

たとえば、橋を渡る自動車を考えます。自動車の振動は、異なる点に置かれた 3 つの同じセンサーで測定されます。信号の到来時間はさまざまです。

信号を MATLAB® ワークスペースに読み込み、プロットします。

load relatedsig

ax(1) = subplot(3,1,1);
plot(s1)
ylabel('s_1')
axis tight

ax(2) = subplot(3,1,2);
plot(s2)
ylabel('s_2')
axis tight

ax(3) = subplot(3,1,3);
plot(s3)
ylabel('s_3')
axis tight
xlabel('Samples')

linkaxes(ax,'x')

Figure contains 3 axes objects. Axes object 1 with ylabel s_1 contains an object of type line. Axes object 2 with ylabel s_2 contains an object of type line. Axes object 3 with xlabel Samples, ylabel s_3 contains an object of type line.

3 つの信号ペア間の相互相関を計算します。これらの最大値が 1 になるように、それぞれ正規化します。

[C21,lag21] = xcorr(s2,s1);
C21 = C21/max(C21);

[C31,lag31] = xcorr(s3,s1);
C31 = C31/max(C31);

[C32,lag32] = xcorr(s3,s2);
C32 = C32/max(C32);

相互相関の最大値の位置は、時間の進みまたは遅れを示します。

[M21,I21] = max(C21);
t21 = lag21(I21);

[M31,I31] = max(C31);
t31 = lag31(I31);

[M32,I32] = max(C32);
t32 = lag31(I32);

相互相関をプロットします。各プロットの最大値の位置を表示します。

subplot(3,1,1)
plot(lag21,C21,[t21 t21],[-0.5 1],'r:')
text(t21+100,0.5,['Lag: ' int2str(t21)])
ylabel('C_{21}')
axis tight
title('Cross-Correlations')

subplot(3,1,2)
plot(lag31,C31,[t31 t31],[-0.5 1],'r:')
text(t31+100,0.5,['Lag: ' int2str(t31)])
ylabel('C_{31}')
axis tight

subplot(3,1,3)
plot(lag32,C32,[t32 t32],[-0.5 1],'r:')
text(t32+100,0.5,['Lag: ' int2str(t32)])
ylabel('C_{32}')
axis tight
xlabel('Samples')

Figure contains 3 axes objects. Axes object 1 with title Cross-Correlations, ylabel C_{21} contains 3 objects of type line, text. Axes object 2 with ylabel C_{31} contains 3 objects of type line, text. Axes object 3 with xlabel Samples, ylabel C_{32} contains 3 objects of type line, text.

s2s1 より 350 サンプル進んでいます。s3s1 より 150 サンプル遅れています。したがって、s2s3 より 500 サンプル進んでいます。遅れの大きいベクトルをクリッピングして、信号を整列します。

s1 = s1(-t21:end);
s3 = s3(t32:end);

ax(1) = subplot(3,1,1);
plot(s1)
ylabel('s_1')
axis tight

ax(2) = subplot(3,1,2);
plot(s2)
ylabel('s_2')
axis tight

ax(3) = subplot(3,1,3);
plot(s3)
ylabel('s_3')
axis tight
xlabel('Samples')

linkaxes(ax,'x')

Figure contains 3 axes objects. Axes object 1 with ylabel s_1 contains an object of type line. Axes object 2 with ylabel s_2 contains an object of type line. Axes object 3 with xlabel Samples, ylabel s_3 contains an object of type line.

これで信号が同期され、次の処理に進む準備ができました。

参考

| |

関連するトピック