### Adding white nose to current injection

Posted:

**Mon Sep 27, 2010 6:21 pm**Dear all,

I am trying to model an external current input with white Gaussian noise, i.e., I = f(t) + D*n(t), where f(t) is a given deterministic function and n(t) represents white Gaussian noise with standard deviation D. I did a search in the forum and found the function normrand(). Here is my code:

It seems the code can produce the noisy input. However, the neuron voltage became unstable with this input (goes to very large negative value) and the following warning message appears in the hoc screen: exp(826.416) out of range, returning exp(700). To see whether the white noise causes instability, I set the parameter std to 0 (no noise is produced by NMODL) and generated noise in the hoc file like this:

And the neuron now responds normally to the noisy input. So I reasoned the way I modeled the white noise with normrand() was not correct in the NMODL. I looked over some similar postings in the forum, but haven't found a good and direct answer to my problem, though I guess it should be pretty simple. Please advise and thank you very much in advance!

Sincerely,

Guoshi Li

I am trying to model an external current input with white Gaussian noise, i.e., I = f(t) + D*n(t), where f(t) is a given deterministic function and n(t) represents white Gaussian noise with standard deviation D. I did a search in the forum and found the function normrand(). Here is my code:

Code: Select all

```
NEURON {
POINT_PROCESS IClampNoise
RANGE i,del,dur,f0,f1,r,torn,std,bias
ELECTRODE_CURRENT i
}
UNITS {
(nA) = (nanoamp)
}
PARAMETER {
del=50 (ms)
dur=200 (ms)
torn=500 (ms)
std=0.2 (nA)
f0=0.2 (nA)
f1=0.8 (nA)
r =60
bias = 0 (nA)
}
ASSIGNED {
i (nA)
amp (nA)
noise (nA)
}
BREAKPOINT {
at_time(del)
at_time(del + dur)
if (t < del) {
i=0
} else{
if (t < del+dur) {
noise = normrand(0,std)
amp = f0 + 0.5*(f1-f0)*(tanh((t-torn)/(r/3)-3)+1)
i = amp + noise + bias
}else{
i = 0
}
}
}
```

It seems the code can produce the noisy input. However, the neuron voltage became unstable with this input (goes to very large negative value) and the following warning message appears in the hoc screen: exp(826.416) out of range, returning exp(700). To see whether the white noise causes instability, I set the parameter std to 0 (no noise is produced by NMODL) and generated noise in the hoc file like this:

Code: Select all

```
objref r
r = new Random()
r.normal(0,d^2)
proc advance() {
fadvance()
var = r.repick()
Stim2.bias = var
}
```

Sincerely,

Guoshi Li