本Matlab程序自动从峰值的时间开始,连续生产若干峰值时间序列。
continuous firing rate time series from discrete spike times
Each spike is represented by a gaussian with maximum value 1 on the timestamp. ALPHA is inversely proportional to standard deviation.
If srate=1000, 95% of the gaussian is included in timestamp+-200ms when alpha=5, 100ms when alpha=10, 50ms when alpha=20, 25ms when alpha=40.
[spkvec,timevec]=spikegauss(timestamps,srate,min_timevec,max_timevec,alpha)
Example :
timestamps=[-1.22 0.33 0.34 0.35 0.40 3.70 7.30]; %sec
srate=1000;
min_timevec=-4;
max_timevec=8;
alpha=20;
[spkvec,timevec]=spikegauss(timestamps,srate,min_timevec,max_timevec,alpha);
plot(timevec,spkvec,'k')
hold on
plot([min_timevec max_timevec],[1 1],'-r')
plot(timestamps,randn(size(timestamps))/10+1,'ob')
hold off