version (3.6 KB) by R P
Generate spike vector time series (SPKVEC) from the TIMESTAMPS of the spikes.


Updated 30 Mar 2016

View License

Generate SPKVEC time series from TIMESTAMPS.


Each spike is represented by a gaussian centered on each of the TIMESTAMPS
SRATE is the sampling rate of the generated time series
MIN_TIMEVEC and MAX_TIMEVEC are the limits the generated time series
SIGMA is the standard deviation
PEAK is the value of the peak of the gaussian (use peak=0 for gaussian
integral = 1; thus sum(spkvec) is equal to the number of spikes)


timestamps=[-1.22 0.33 0.34 0.35 0.40 3.70 7.30]; % sec
srate=1000; % Hz
min_timevec=-4; % sec
max_timevec=8; % sec
sigma=0.1; % sec


hold on
plot([min_timevec max_timevec],[1 1]*updatedpeak,'-r')
hold off

Cite As

R P (2022). spikegauss (https://www.mathworks.com/matlabcentral/fileexchange/41248-spikegauss), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!