calculating auto-correlation function of a matrix
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
mosa mm
am 5 Jul. 2016
Kommentiert: Honglei Chen
am 7 Jul. 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 Kommentare
Akzeptierte Antwort
Honglei Chen
am 6 Jul. 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 Kommentare
Honglei Chen
am 7 Jul. 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.
Weitere Antworten (1)
Image Analyst
am 7 Jul. 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.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

