필터 지우기
필터 지우기

Doubt about xcorr function

조회 수: 2 (최근 30일)
Joao
Joao 2015년 1월 20일
댓글: Joao 2015년 1월 21일
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

채택된 답변

Honglei Chen
Honglei Chen 2015년 1월 21일
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

추가 답변 (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