Borrar filtros
Borrar filtros

Doubt about xcorr function

2 visualizaciones (últimos 30 días)
Joao
Joao el 20 de En. de 2015
Comentada: Joao el 21 de En. de 2015
Hello!
I have question about the xcorr function.
I have a vector with random bits 0s and 1s.
I do the autocorrelation of this vector and the output is the following:
However, shouldn't the autocorrelation for a random vector trace be like this:
sorry for my paint skills..
What is that space below the plot??? Is there any way to take it out?
Many thanks, João

Respuesta aceptada

Honglei Chen
Honglei Chen el 21 de En. de 2015
You may want to use the 'unbiased' option in xcorr so the normalization is on the number of points used to compute the correlation. In addition, you may want to specify a maxlag because at the edge, there simply are not enough samples to get an accurate estimate. Here is a small example:
[c,l] = xcorr(rand91,1024)>0.5,500,'unbiased')
plot(l,c)
HTH

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