why are values returned by xcorr not within [-1,1]?

조회 수: 5 (최근 30일)
cgo
cgo 2016년 12월 12일
댓글: Adam 2019년 9월 24일
I am using [r, lags] = xcorr(y1,y2) where y1 and y2 are two time series data.
I would like to know the meaning of the values returned by r and why they are the correlation values I know that should be in [-1,1].
Your insights would be great.

채택된 답변

Adam
Adam 2016년 12월 12일
편집: Adam 2016년 12월 12일
Use the 'scaleopt' option as documented in the help if you want normalised results. Otherwise the results will depend on the magnitude of your data.
e.g.
a = 1:10;
b = 1:10;
xcorr( a, b )
will return values ranging from 10 to 385.
xcorr( a, b, 'coeff' )
will return values between 0 and 1;
  댓글 수: 2
Rafael Miranda
Rafael Miranda 2019년 9월 24일
thanks for your contribution!
Could you explain what this 'coeff' means?
Adam
Adam 2019년 9월 24일
doc xcorr
explains it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by