Main Content

다중채널 입력값을 사용한 상호상관

0.4n, 0.7n, 0.999n(n0)으로 지정된 11개 샘플로 구성된 세 개의 지수 시퀀스를 생성합니다. 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.

시퀀스의 자기상관 및 서로 간의 상호상관을 계산합니다. 지연값(lags)을 추적하지 않아도 되도록 값을 출력합니다. 자기상관이 지연값 0에서 단위 값을 가지도록 결과를 정규화합니다.

[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.

참고 항목

함수