calculating auto-correlation function of a matrix
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
mosa mm
el 5 de Jul. de 2016
Comentada: Honglei Chen
el 7 de Jul. de 2016
Hi, How can I calculate autocorrelation of a complex matrix ? (applied on the first dimension) As far as I know xcorr() is only for vectors.
Thanks
0 comentarios
Respuesta aceptada
Honglei Chen
el 6 de Jul. de 2016
Do you mean you want to compute autocorrelation for each column? If so, you can always use a for loop to do that, e.g.,
x = ones(10,2);
r = zeros(2*size(x,1)-1,size(x,2);
for m = 1:size(x,2)
r(:,m) = xcorr(x(:,m));
end
Or if you don't mind dealing with cell arrays, you can always do
x = ones(10,2);
r = arrayfun(@(n)xcorr(x(:,n),1:size(x,2),'UniformOutput',false);
5 comentarios
Honglei Chen
el 7 de Jul. de 2016
Based on that information, if I treat each column as a signal, I can have a 33x300 matrix, not a 1x300 matrix, unless we are talking about a specific time lag.
Más respuestas (1)
Image Analyst
el 7 de Jul. de 2016
There is an xcorr2() and normxcorr2() that can handle 2-D matrices like a 17 x 300 matrix. Not sure about complex numbers though - I've never tried it with those, just with real numbers. For what it's worth, I've attached a demo.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

