Spike Toolbox |
![]() ![]() |
STPSTimeHist
Construct an Peri-Stimulus Time Histogram for a spike train
Syntax
<[vPSTHist, tBinCentres, vStdErr]> = ...
STPSTimeHist(stTrain, vtStimOnset <, vtWindow, nNumBins>)
Description
STPSTimeHist will calculate a peri-stimulus time histogram for the spike train stTrain
. A PSTH is formed from one or more spike trains recorded from multiple runs of an experiment, for example multiple presentations of a particular stimulus. The stimulus onset times (or other synchronising signal) are supplied in a vector of timestamps vtStimOnset
. These time stamps must be supplied in seconds.
The optional argument vtWindow
should be a two element vector of the format [tRelStart tRelEnd]
, specifying the start and end times (in seconds) of a window over which to analyse each stimulus presentation, relative to the stimulus onset time. If vtWindow
is not supplied, the shortest inter-stimulus interval will be used.
The optional argument nNumBins
specifies the number of bins to use within the analysis time window. If not supplied, 50
bins will be used.
vPSTHist
and vStdErr
will be vectors containing the binned spike counts (and standard error) over the analysis time window. The centre points of each time bin in the histogram are given in the vector tBinCentres
, in seconds.
If no output arguments are specified, a plot of the PSTH will be created.
![]() |
STShift
![]() |