Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
petersenpeter committed Feb 13, 2024
2 parents 3d2c4af + fa277ed commit 6fe0298
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions calc_CellMetrics/convolute_spikes.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
spikes_convolved = zeros(numel(time_bins),spikes.numcells);

for i = 1:spikes.numcells
idx = round(spikes.times{i}/stepsize);
spikes_convolved(idx,i) = 1;
spikes_convolved(1:end-1,i) = histcounts(spikes.times{i},time_bins);

% Convoluting the spike times with a n points gaussian convolution
spikes_convolved(:,i) = nanconv(spikes_convolved(:,i),gausswin(convolution_points)/sum(gausswin(convolution_points)),'edge');
if convolution_points > 1
spikes_convolved(:,i) = nanconv(spikes_convolved(:,i),gausswin(convolution_points)/sum(gausswin(convolution_points)),'edge');
end
end

0 comments on commit 6fe0298

Please sign in to comment.