필터 지우기
필터 지우기

Tripple correlation in MATLAB

조회 수: 6 (최근 30일)
Georgiy
Georgiy 2015년 10월 18일
답변: Georgiy 2015년 10월 25일
Hello, Till now I performed a cross correlation between 2 vectors A and B by using a xcorr(A,B) function. Now I have 3 vectors: A, B and C. How do I perform a triple correlation between them? Is it right to first correlate between two, and correlate the result with third one, like xcorr(xcorr(A,B),C)? Or there is a special function for triple correlation in MATLAB? Thanks!

답변 (2개)

Walter Roberson
Walter Roberson 2015년 10월 18일
No, xcorr(xcorr(A,B),C) is going to correlate the correlation matrix with C.
Maybe
corrcoef([A(:),B(:),C(:)])
  댓글 수: 1
Georgiy
Georgiy 2015년 10월 24일
편집: Georgiy 2015년 10월 24일
Hi, Thanks for the answer. I tried it out, but I get a 2x2 matrix, while my signals are of 2,000,000 samples each. I wrote a code that does it by "multiplication and sum" method, but it takes a lot of time (weeks/months, I guess). Just checked what xcorr function does, and realized that maybe by "fft" method it will be faster. So the question is: xcorr takes 2 signals, performs fft on them and multiples first by conjugate of the second one and then fft back. Like:
a = first_signal;
b = second_signal;
corrLength=length(a)+length(b)-1;
c=fftshift(ifft(fft(a,corrLength).*conj(fft(b,corrLength))));
I tried to do it "manually" by the above algorithm for three signals. What I did is FFT each of the 3 signals, multiplicate A.B, which gives a row vector. Then I convert C row vector to C column vector by C' and multiplicate each column of A.B by C. Then iFFT2 back. Unfortunatelly I get a wrong result. The reason I convert C to a column vector is to get a matrix, since triple correlation is calculated according to 2 time delays, and obviously the result should be a matrix rather than a vector as in correlation of the 2 signals, where only a one time delay is present. Thanks in advance!

댓글을 달려면 로그인하십시오.


Georgiy
Georgiy 2015년 10월 25일
Someone please?

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by