Page **1** of **1**

### Real-time process on LFP

Posted: **Sat Sep 29, 2018 12:18 am**

by **breakwave922**

Hi,

I have a big-scale network model developed via NEURON, and with LFP calculated.

What I want to do with LFP is, at each time step, I want to first band-pass filter LFP signal, and detect whether the filtered LFP signal is at trough.

If it is, neurons with optogentic channel, like Chronos, will be activated. Not sure, this idea can be implemented in NEURON.

Like,I'm not sure how can I let a real-time LFP signal pass to a filter, and particularly this should be done at each time step. I'm thinking maybe a buffer is needed to store a snippet of LFP till current time step, and process it with filter?

Thanks in advance.

### Re: Real-time process on LFP

Posted: **Sun Sep 30, 2018 1:07 pm**

by **ted**

What I want to do with LFP is, at each time step, I want to first band-pass filter LFP signal, and detect whether the filtered LFP signal is at trough.

If it is, neurons with optogentic channel, like Chronos, will be activated. Not sure, this idea can be implemented in NEURON.

It can't be implemented in this universe, let alone with NEURON. Given some variable foo, how are you going to know when foo has reached its minimum unless you allow time to go past the point at which foo reached its minimum? And then it's too late.

### Re: Real-time process on LFP

Posted: **Sun Sep 30, 2018 5:15 pm**

by **breakwave922**

Hi, Ted,

Thanks for the reply.

Is it possible that we can buffer a snippet of LFP data to the current time step, then band-pass filter these LFP data, and calculate the derivative of filtered LFP based on time step, if the derivative is negatively close to 0 (it stands for trough), we can activate Chronos channel. We probably don't need the time point to be at exactly trough of the filtered LFP signal.

### Re: Real-time process on LFP

Posted: **Mon Oct 01, 2018 12:17 pm**

by **ted**

No need to do off-line calculations. Use the Linear Circuit Builder to implement your filter, and you can filter any variable you like during a simulation.

calculate the derivative of filtered LFP based on time step, if the derivative is negatively close to 0 (it stands for trough), we can activate Chronos channel. We probably don't need the time point to be at exactly trough of the filtered LFP signal.

You will have to come up with a robust operational definition of "minimum." Real and simulated LFPs are quite noisy.

### Re: Real-time process on LFP

Posted: **Mon Oct 01, 2018 10:10 pm**

by **breakwave922**

ted wrote: ↑Mon Oct 01, 2018 12:17 pm
No need to do off-line calculations. Use the Linear Circuit Builder to implement your filter, and you can filter any variable you like during a simulation.

Linear Circuit Builder is definitely a good idea. Is it possible that we can use like "moving time window" to store some variables during a simulation?

For example, if a variable at the current time step is X(n*dt), I also want to have X((n-1)*dt),X((n-2)*dt)...X((n-m)*dt) to form a vector, where m can be chosen by us?