필터 지우기
필터 지우기

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 CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by