フィルターのクリア

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
  1 件のコメント
Joao
Joao 2015 年 1 月 21 日
thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by