calculating auto-correlation function of a matrix

13 ビュー (過去 30 日間)
mosa mm
mosa mm 2016 年 7 月 5 日
コメント済み: Honglei Chen 2016 年 7 月 7 日
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

採用された回答

Honglei Chen
Honglei Chen 2016 年 7 月 6 日
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 件のコメント
mosa mm
mosa mm 2016 年 7 月 7 日
the short version of the above formula:
Honglei Chen
Honglei Chen 2016 年 7 月 7 日
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.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 7 月 7 日
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.
  1 件のコメント
mosa mm
mosa mm 2016 年 7 月 7 日
Thank you very much

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by