Autocorrelations and Correlogram
조회 수: 32 (최근 30일)
이전 댓글 표시
Hi MATLAB Central,
I am having trouble finding a function which computes and displays a correlogram for the autocorrelation of my spike-train data. From the functions I have found and applied, I feel like my understanding of the Autocorrelation may have some holes in it.
Suppose I have a vector, v, which displays the tonic firing of a neurone. An example of such a trace can be seen here (top trace):
Now I would expect the autocorrelation and correlogram for my vector to give obvious peaks of correlation; a peak at 0 lag, and peaks at every integer multiple of the (constant) inter-spike-interval.
The trouble is, the MATLAB functions do not give this relationship; they give a pyramid shape function. Moreover, the y-axis doesn't occur on a scale between -1 and 1, which I would expect if it was displaying the correlation. Rather it has a max value of 15e08!!
Which autocorrelation function would give me the expected relationship/how am I miss-using these autocorrelation functions?
Thanks,
Linford
댓글 수: 0
채택된 답변
Wayne King
2012년 3월 16일
Hi Linford, If you use xcorr() with the 'coeff' option you get the normalized autocorrelation sequence which does not exceed 1 in absolute value.
The triangle shape that you speak about is expected. The sample autocorrelation sequence by necessity uses fewer and fewer samples at larger lags (the summation cannot exceed the length of the input vector), so you do expect the sample ACF to decay.
Here is an example with a sinusoid. I'll use a 100 Hz sine wave sample at 1 kHz.
t = 0:0.001:1-0.001;
x = cos(2*pi*100*t);
[xc,lags] = xcorr(x,'coeff');
stem(lags,xc)
Now let's zoom in a bit.
stem(lags(length(x):length(x)+50),xc(length(x):length(x)+50));
xlabel('Lags'); ylabel('ACF');
Now you see that the ACF is oscillating with a period of 10 lags, which is exactly what you expect since the sampling interval is 1 msec and the period is 10 msec.
댓글 수: 3
Wayne King
2012년 3월 16일
Hi Linford, I'm not sure I understand why a 0.025 time interval is a problem. That just means that your lags are in intervals of 0.025 seconds.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!