Dear friends,
I like to know, can we determine frequency in firing pattern of the cell with NEURON?
I guess we should use "event". but i confused in my code.
do you have any idea, how we can determine frequency of firing pattern?
in other words, we have a soma, which connected to some dendretic segment, we inject a depolarized current, can we determine frequency of response?
Still i'm learning NEURON! don't laugh if it is simple question!!!!!
frequency and event
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
1. Attach a NetCon with a NULLobject target to the cell's spike trigger zone. Example:
Assuming that soma(0.5) is close to the spike trigger zone,
2. Use the NetCon class's record() method to record spike times to a Vector.
After a simulation run, the elements of tsp will be the times at which the cell spiked
3. Use the Vector class's deriv() method (with dx of 1) to convert this to a Vector of interspike
intervals.
4. Invert the interspike intervals and you have a Vector that contains the "instantaneous firing
frequency" of the cell.
Assuming that soma(0.5) is close to the spike trigger zone,
Code: Select all
objref nc, nil
soma nc = new NetCon(&v(0.5), nil)
Code: Select all
objref tsp
tsp = new Vector()
nc.record(tsp)
3. Use the Vector class's deriv() method (with dx of 1) to convert this to a Vector of interspike
intervals.
Code: Select all
objref isivec
isivec = tsp.c // isivec is a copy of tsp, the spike time Vector
isivec.deriv(1) // isivec contains the interspike intervals
frequency" of the cell.
Code: Select all
objref freq
freq = new Vector(isivec.size())
for i = 0,freq.size()-1 freq.x[i] = 1/isivec.x[i]
Thank you very much Ted,
It seems for me it is more complicated from what i guess!
However, i run the following code
and the result of
oc>freq.printf()
0.0644122 0.0649351 0.0655201 0.0655201 0.0655201
0.0655201 0.0654664
as you said this is "instantaneous firing frequency".
So, what we can say about frequency of response to the injected current?
Is it " freq.mean()" or " freq.size()/stim.dur" or "?"
Thanks again!
It seems for me it is more complicated from what i guess!
However, i run the following code
Code: Select all
load_file("nrngui.hoc")
create soma
access soma
soma nseg = 1
soma diam = 18.8
soma L = 18.8
soma Ra = 123.0
soma insert hh
objectvar stim
soma stim = new IClamp(0.5)
stim.del = 100
stim.dur = 100
stim.amp = 0.1
tstop = 300
objref nc, nil
soma nc = new NetCon(&v(0.5), nil)
objref tsp
tsp = new Vector()
nc.record(tsp)
run()
objref isivec
isivec = tsp.c // isivec is a copy of tsp, the spike time Vector
isivec.deriv(1) // isivec contains the interspike intervals
objref freq
freq = new Vector(isivec.size())
for i = 0,freq.size()-1 freq.x[i] = 1/isivec.x[i]
and the result of
oc>freq.printf()
0.0644122 0.0649351 0.0655201 0.0655201 0.0655201
0.0655201 0.0654664
as you said this is "instantaneous firing frequency".
So, what we can say about frequency of response to the injected current?
Is it " freq.mean()" or " freq.size()/stim.dur" or "?"
Thanks again!
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
First, a comment.
Since time is in ms, instantaneous frequency in Hz is given by
for i = 0,freq.size()-1 freq.x = 1000/isivec.x
It's up to you to decide whether instantaneous frequency or mean frequency is the
appropriate measure.
Frequency is "how often something happens per unit time." Where does stimulus duration
appear in the definition of frequency?
Since time is in ms, instantaneous frequency in Hz is given by
for i = 0,freq.size()-1 freq.x = 1000/isivec.x
So, what we can say about frequency of response to the injected current?
Is it " freq.mean()"
It's up to you to decide whether instantaneous frequency or mean frequency is the
appropriate measure.
or " freq.size()/stim.dur"
Frequency is "how often something happens per unit time." Where does stimulus duration
appear in the definition of frequency?