corrcoef & xcorr
이전 댓글 표시
Hello i've two complex functions ( size 1x1x2501) and i need to do a correlation between these (cross-correlation).
i've tried to use this command:
r=corrcoef(Hmimo_tb(1,:)',Hmimo_tb1(1,:)','coeff');
where Hmimo_tb and Hmimo_tb1 are my two signals in which the only difference is the fact that they have been measured in different positions. The difference betweeen these two signals is max equal to 1.5e-13, so they are only affected by noise.
i obtain as result:
ans =
1.0000 1.0000 + 0.0000i 1.0000 - 0.0000i 1.0000
the function that i'm going to correlate are complex but the 0.0000i leave me some doubts.... Another doubt is the fact that the the signals are not equal in fact as i've told before there is a difference of 1.5e-13 that is not reported on the secondary diagonal why?
what are the difference between corrcoef and xcorr?
채택된 답변
추가 답변 (2개)
Walter Roberson
2011년 11월 10일
1 개 추천
0.0000i implies that there is a non-zero complex component which is too small to be represented using your current display format (which is probably "format short f")
댓글 수: 6
Salvatore Turino
2011년 11월 10일
Walter Roberson
2011년 11월 10일
format long g
Salvatore Turino
2011년 11월 10일
Salvatore Turino
2011년 11월 10일
Walter Roberson
2011년 11월 10일
With values that small, it could indicate round-off error.
Salvatore Turino
2011년 11월 10일
Salvatore Turino
2011년 11월 11일
댓글 수: 1
Wayne King
2011년 11월 11일
Salvatore, you keep making this mistake. c(3) is not at lag three. You are forgetting about the negative lags. If you enter lags(3) for the example you have above, you see that c(3) is the value of the cross correlation sequence at lag -98. c(104) is the cross correlation sequece at lag 3. That value is very close to 1.
카테고리
도움말 센터 및 File Exchange에서 Correlation and Convolution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!