Equations

Monday, 11 April 2011

Finding Spike Rate Using Convolution

In the previous post, we found spike rate using non overlapping window. In this post,
I will show how to obtain spike rate using convolution with rectangular and Gaussian window.
I will also use the same variables.
%size of the window 100ms
windowSize = 100;

%the area must be 1
kernel = ones(1, windowSize ) ./ windowSize ;

output = conv(spikeTrain, kernel);


you should get something like this:

now if we want the kernel to be Gaussian window:
%width 600ms and variance 2
windowSize = 600;
windowVar = 2;

kernel = gausswin(windowSize, windowVar);

output = conv(spikeTrain, kernel);


you should get something like this:

No comments:

Post a Comment