Effacer les filtres
Effacer les filtres

Doubt about xcorr function

2 vues (au cours des 30 derniers jours)
Joao
Joao le 20 Jan 2015
Commenté : Joao le 21 Jan 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

Réponse acceptée

Honglei Chen
Honglei Chen le 21 Jan 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
  1 commentaire
Joao
Joao le 21 Jan 2015
thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by