Skip to content

eventcorr

  EVENTCORR workhorse function for calculating spike correlations

  Example
  [pbin tb]=EVENTCORR(trigger, spiketimes, binwidth, duration, pretime)

  Inputs: trigger         the trigger times
          spiketimes      the spike times
          binwidth        binwidth for the histogram
          nsweeps         the number of triggers per histogram, zero for a
                          single histogram using all triggers
          duration        sweep duration
          pretime         the pretime period

  Outputs:
          pbin            the histogram counts as number of spikes
          tb              the timebase for the correlation

  EVENTCORR uses all triggers and spikes. The calling function should deal
  with end-effects where incomplete sweeps may be available.

  To calculate a post- or peri - stimulus time histogram, debounce the
  triggers before calling eventcorr. For spike-train cross-correlation,
  do not debounce.

  See also debounce
  -------------------------------------------------------------------------
  Author: Malcolm Lidierth 03/08
  Copyright © The Author & King's College London 2008-
  -------------------------------------------------------------------------

  -------------------------------------------------------------------------
  Note that this file may be shadowed by a mex-file and, in that case, will
  not execute. If no mex-file is present, a message will be be issued at
  the command line (once per MATLAB session), and this m-file will be
  executed. Note that the mex-file will run ~5000x faster.
  To produce a mex-file for the current platform, compile eventcorr.c using
  mex or sigTOOL('compile').
  -------------------------------------------------------------------------