フィルターのクリア

Calculating autocorrelation function using xcorr / analytically

1 回表示 (過去 30 日間)
Torben Schmidt
Torben Schmidt 2018 年 5 月 3 日
I calculated the autocorrelation function of a normalized Gaussian
f(x) = 1/sqrt(2*pi*sig^2) * exp(-x^2/(2*sig^2))
to be
R(k) = 1/sqrt(4*pi*sig^2) * exp(-k^2/(4*sig^2)).
Then, I sampled the original Gaussian with sig = 1 on 1024 points between -10,10 and tried to compute the autocorrelation function using
R = 1/length(f) * xcorr(f) % f being the sampled representation
Unfortunately, when I plot both the numerically and analytically computed autocorrelation functions, they differ by a factor of 20 * 1024/1023, 20 being the span of the x values, and 1024 the length of f.
Does somebody know where my error is or why there is a difference between the two computations?
Many thanks in advance for your help.

回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by