How to make an autocorrelogram using spike trains

11 views (last 30 days)
I am trying to make an autocorrelogram of my spike-train data, and all of the posts that I have found related to this matter thus far are outdated (or so I think). The responses I have found mention using xcorr(), however, that function no longer appears to exist on MATLAB 2015, since MATLAB always suggests corr() when I try to run it. Anyways, does anyone have any tips for how to do this? Furthermore, if any of you are savvy in the signal processing domain, I wouldn't mind picking your brain for some autocorrelogram tips. For instance, I am wondering what is an appropriate bin size to use, as well as how many lags to use. Thanks in advance.
  4 Comments
Star Strider
Star Strider on 16 Oct 2015
My pleasure!
I don’t use autocorrelation often enough to consider myself good at it, or I’d give a go at Answering your Question. Like most topics in data analysis, bin size, lags, and other parameters are dictated by the data, so are inherently heuristic. You just have to see what works best.
qualiaMachine
qualiaMachine on 19 Oct 2015
Edited: qualiaMachine on 19 Oct 2015
Unfortunately, I am still struggling with this autocorrelogram. When I input the timestamps for my spikes into xcorr like so... xcorr(timestamps), I find that there's a peak towards the length of the timestamps vector. This doesn't make sense. The peak should be at lag zero (where the vector is 100% correlated with itself). What am I doing wrong here? Or is my understanding of an autocorrelogram incorrect? Also, I'm not totally sure how to adjust bin width. If anyone has some pointers, I'd appreciate it. Finally, the fact that I can't center the plot that's created from xcorr() at zero is driving me crazy. How can I fix this?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!