Borrar filtros
Borrar filtros

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

11 visualizaciones (últimos 30 días)
cgo
cgo el 12 de Dic. de 2016
Comentada: Adam el 24 de Sept. de 2019
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.

Respuesta aceptada

Adam
Adam el 12 de Dic. de 2016
Editada: Adam el 12 de Dic. de 2016
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 comentarios
Rafael Miranda
Rafael Miranda el 24 de Sept. de 2019
thanks for your contribution!
Could you explain what this 'coeff' means?
Adam
Adam el 24 de Sept. de 2019
doc xcorr
explains it.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by