Borrar filtros
Borrar filtros

Tripple correlation in MATLAB

4 visualizaciones (últimos 30 días)
Georgiy
Georgiy el 18 de Oct. de 2015
Respondida: Georgiy el 25 de Oct. de 2015
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!

Respuestas (2)

Walter Roberson
Walter Roberson el 18 de Oct. de 2015
No, xcorr(xcorr(A,B),C) is going to correlate the correlation matrix with C.
Maybe
corrcoef([A(:),B(:),C(:)])
  1 comentario
Georgiy
Georgiy el 24 de Oct. de 2015
Editada: Georgiy el 24 de Oct. de 2015
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!

Iniciar sesión para comentar.


Georgiy
Georgiy el 25 de Oct. de 2015
Someone please?

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by