Filter löschen
Filter löschen

Doubt about xcorr function

2 Ansichten (letzte 30 Tage)
Joao
Joao am 20 Jan. 2015
Kommentiert: Joao am 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

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 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

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by