Discrete-time cross-correlogram (Scripts) Publisher's description
from Alex Wiltschko
Computes cross- or auto-correlograms between two discrete time series
Computes cross- or auto-correlograms between two discrete time series, supplied as a list of timestamps.
[tsOffsets, ts1idx, ts2idx] = crosscorrelogram(ts1, ts2, window)
ts1 - a list of timestamps (in seconds) to use as the reference of the cross-correlogram
ts2 - timestamps (in seconds) used to create the cross-correlogram, compared against ts1
window - a length-2 vector specifying the width of the correlogram to compute, in seconds.
tsOffsets - a list of offsets from timestamps in ts2 to their nearest timestamp in ts1.
ts1idx - an index for each offset in tsOffsets into ts1.
ts2idx - an index for each offset in tsOffsets into ts2.
% Create a dummy time series where one leads the other by 0.3 seconds
ts1 = sort(rand(1000,1)*1000);
ts2 = ts1 + 0.3;
% Calculate the cross-correlogram between the two signals with a 0.5 second window, starting at each spike time in ts1
offsets = crosscorrelogram(ts1, ts2, [0 0.5]);
System Requirements:MATLAB 7.7 (R2008b)
Program Release Status: New Release
Program Install Support: Install and Uninstall