MEAN_SPIKE_WAVEFORMS - find mean spike waveforms in a voltage recording
[MEAN_WAVES,STD_WAVES,PARAMETERS] = MEAN_SPIKE_WAVEFORMS(S, SPIKING_ELEMENT, EPOCH_ID, ...)
Given an ndi.element of type 'spikes' that is derived from a voltage (SPIKING_ELEMENT),
recording, returns mean and standard deviation waveforms from different places
in the recording. The mean is computed in different intervals in the recording EPOCH_ID
specified by a parameter 'averaging_window', which defaults to 60 s. This means that
mean waveforms are computed in the first averaging_window, the second averaging_window,
etc., until the end of the recording.
WAVES is an MxCxT matrix where M is the number of samples around the spike
that are examined, C is the number of channels, and T is the number of
times that the mean waveform is examined. Any bins with no spikes will be
coded as NaN values.
STD_WAVES is an MxCxT matrix, the same size as WAVES, that has the standard
deviation of the spike waves. Any bins with no spikes will be coded as
NaN values.
PARAMETERS is a structure with the following fields:
interval_center_times - the center time of each averaging_window
number_of_spikes_per_interval - the number of spikes in each interval
sample_times - the relative times of each spike waveform
s0 - number of samples before spike sample that were read
s1 - number of samples after spike sample that were read
sample_rate - the sampling rate of the probe
This function takes name/value parameters that modify its behavior:
---------------------------------------------------------------------------
| Parameter (default) | Description |
|--------------------------|----------------------------------------------|
| spike_window_before_time | How long before each spike time should we |
| (-0.001) | retrieve for our waveforms? (In seconds.) |
| | Usually negative to indicate times before |
| | the spike. |
| spike_window_after_time | How long after each spike time should we |
| ( 0.002) | retrieve for our waveforms? (In seconds.) |
| | Usually positive to indicate times after |
| | the spike. |
| averaging_window (60) | How long should the averaging window be? |
| | (Seconds.) A mean and standard deviation of|
| | the waveform is constructed every interval.|
| averaging_window_step | How long should the step be between averaging|
| (300) | windows? (Seconds.)
| filter_padding (0.100) | Extra time to read before and after each |
| | spike for filtering. |
| cheby_order (4) | Chebyshev Type I filter order |
| cheby_R (0.5) | Chebyshev Type I filter roll off R parameter |
| cheby_cutoff (300) | Chebyshev Type I high pass cut off frequency |
|--------------------------|----------------------------------------------|