Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
convolution spike train

Subject: convolution spike train

From: Jose

Date: 27 Jan, 2009 00:13:01

Message: 1 of 7

Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
with a gaussian vector?
Please i think it cannot be difficult with the fucntion conv, but
someone can write down a little code to do it.
Thanks in advance,
Jose.

Subject: convolution spike train

From: Paul

Date: 27 Jan, 2009 02:02:02

Message: 2 of 7

"Jose " <jose.l.vega@gmail.com> wrote in message <glljid$7mc$1@fred.mathworks.com>...
> Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
> with a gaussian vector?
> Please i think it cannot be difficult with the fucntion conv, but
> someone can write down a little code to do it.
> Thanks in advance,
> Jose.

To solve your HW problem:
1) look up the formula for a gaussian (google)
2) write the formula using matlab
3) help conv (in matlab)

Subject: convolution spike train

From: Jose

Date: 27 Jan, 2009 10:59:02

Message: 3 of 7

"Paul" <par@ceri.memphis.edu> wrote in message <gllpuq$611$1@fred.mathworks.com>...
> "Jose " <jose.l.vega@gmail.com> wrote in message <glljid$7mc$1@fred.mathworks.com>...
> > Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
> > with a gaussian vector?
> > Please i think it cannot be difficult with the fucntion conv, but
> > someone can write down a little code to do it.
> > Thanks in advance,
> > Jose.
>
> To solve your HW problem:
> 1) look up the formula for a gaussian (google)
> 2) write the formula using matlab
> 3) help conv (in matlab)

Dear Paul, what do you think about it, is it ok?

clear all
clc
figure(1);clf
y=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]; % spike train
plot(y)
hold on
sigma=1;
x=[-100:sigma:100];
k = exp(-(x/sigma).^2/2)/(sigma*sqrt(2*pi)); % Gaussian kernel.
z=conv(y,k);
z=z(floor(length(k)/2):end-ceil(length(k)/2)); % Aligned size with the spike train
plot(z,'r')

Subject: convolution spike train

From: Jose

Date: 27 Jan, 2009 12:11:02

Message: 4 of 7

"Jose " <jose.l.vega@gmail.com> wrote in message <glmpdm$glp$1@fred.mathworks.com>...
> "Paul" <par@ceri.memphis.edu> wrote in message <gllpuq$611$1@fred.mathworks.com>...
> > "Jose " <jose.l.vega@gmail.com> wrote in message <glljid$7mc$1@fred.mathworks.com>...
> > > Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
> > > with a gaussian vector?
> > > Please i think it cannot be difficult with the fucntion conv, but
> > > someone can write down a little code to do it.
> > > Thanks in advance,
> > > Jose.
> >
> > To solve your HW problem:
> > 1) look up the formula for a gaussian (google)
> > 2) write the formula using matlab
> > 3) help conv (in matlab)
>
> Dear Paul, what do you think about it, is it ok?
>
> clear all
> clc
> figure(1);clf
> y=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]; % spike train
> plot(y)
> hold on
> sigma=1;
> x=[-100:sigma:100];
> k = exp(-(x/sigma).^2/2)/(sigma*sqrt(2*pi)); % Gaussian kernel.
> z=conv(y,k);
> z=z(floor(length(k)/2):end-ceil(length(k)/2)); % Aligned size with the spike train
> plot(z,'r')
>
Now is ok, is completelly aligned the maximum of the gaussian with the maximum of the spike:
z=z(ceil(length(k)/2):end-floor(length(k)/2))

Jose.

Subject: convolution spike train

From: Pierre-Pascal

Date: 5 Jun, 2009 01:38:01

Message: 5 of 7

"Jose " <jose.l.vega@gmail.com> wrote in message <glljid$7mc$1@fred.mathworks.com>...
> Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
> with a gaussian vector?
> Please i think it cannot be difficult with the fucntion conv, but
> someone can write down a little code to do it.
> Thanks in advance,
> Jose.

same as above but, I am wondering a couple of things:
1) if the spike train is binned, say with 10 ms bins. what should be the best gaussian kernel to use? I mean: what is the best standard deviation to use?
then:
2) how do we figure out the units? (in spikes per seconds).

Subject: convolution spike train

From: ImageAnalyst

Date: 5 Jun, 2009 01:44:02

Message: 6 of 7

On Jun 4, 9:38 pm, "Pierre-Pascal" <le...@dartmouth.edu> wrote:
> "Jose " <jose.l.v...@gmail.com> wrote in message <glljid$7m...@fred.mathworks.com>...
> > Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
> > with a gaussian vector?
> > Please i think it cannot be difficult with the fucntion conv, but
> > someone can write down a little code to do it.
> > Thanks in advance,
> > Jose.
>
> same as above but, I am wondering a couple of things:
> 1) if the spike train is binned, say with 10 ms bins. what should be the best gaussian kernel to use? I mean: what is the best standard deviation to use?
> then:
> 2) how do we figure out the units? (in spikes per seconds).
------------------------------------

1) 42
2) I think only Walter knows for sure, but I suspect he'll say 42 for
this also.

Subject: convolution spike train

From: Pierre-Pascal

Date: 5 Jun, 2009 02:04:02

Message: 7 of 7

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <78c84984-a7cf-4e3a-88c0-69992e00595e@l28g2000vba.googlegroups.com>...
> On Jun 4, 9:38?pm, "Pierre-Pascal" <le...@dartmouth.edu> wrote:
> > "Jose " <jose.l.v...@gmail.com> wrote in message <glljid$7m...@fred.mathworks.com>...
> > > Anyone can say to me how I can convolve a spike train v=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]
> > > with a gaussian vector?
> > > Please i think it cannot be difficult with the fucntion conv, but
> > > someone can write down a little code to do it.
> > > Thanks in advance,
> > > Jose.
> >
> > same as above but, I am wondering a couple of things:
> > 1) if the spike train is binned, say with 10 ms bins. what should be the best gaussian kernel to use? I mean: what is the best standard deviation to use?
> > then:
> > 2) how do we figure out the units? (in spikes per seconds).
> ------------------------------------
>
> 1) 42
> 2) I think only Walter knows for sure, but I suspect he'll say 42 for
> this also.

really? Walter hum..
I meant the kernel should have a size and a standard deviation. I just need to know what is the best approach to get a good estimate of the spike train firing rate (0 and ones are no spike, one spike...).
then, what are the units in the resulting vector?
Jose should know

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us