Esempio n. 1
0
def fake_neuron(stepsize=0.001, offset=.8):
    stimulus = np.random.randn(102000) * 2.5
    b, a = signal.butter(2, 7.5, fs=1. / stepsize, btype="low")
    stimulus = signal.filtfilt(b, a, stimulus)
    stimulus = stimulus[1000:-1000]

    lif_model = lif.LIF(stepsize=stepsize, offset=offset)
    time, v, spike_times = lif_model.run_stimulus(stimulus)
    return time, v, stimulus, spike_times
Esempio n. 2
0
def fake_neuron(stepsize=0.001, offset=.8):
    stimulus = np.random.randn(80000) * 2.5

    b, a = signal.butter(8, 0.125)
    stimulus = signal.filtfilt(b, a, stimulus[:])

    s = np.hstack((np.zeros(10000), stimulus, np.zeros(10000)))
    lif_model = lif.LIF(stepsize=stepsize, offset=offset)
    time, v, spike_times = lif_model.run_stimulus(s)

    stimulus_onset = 10000 * stepsize
    stimulus_duration = len(stimulus) * stepsize

    return time, v, stimulus, stimulus_onset, stimulus_duration
Esempio n. 3
0
def fake_neuron(stepsize=0.001, offset=.8, sta_offset=100):
    stimulus = np.random.randn(100000) * 2.5
    b, a = signal.butter(8, 0.25)
    stimulus = signal.filtfilt(b, a, stimulus)
    lif_model = lif.LIF(stepsize=stepsize, offset=offset)
    time, v, spike_times = lif_model.run_stimulus(stimulus)
    snippets = np.zeros((len(spike_times), 2 * sta_offset))

    for i, t in enumerate(spike_times):
        index = int(round(t / stepsize))
        if index < sta_offset:
            snip = stimulus[0:index + sta_offset]
            snippets[i, -len(snip):] = snip
        elif (index + sta_offset) > len(stimulus):
            snip = stimulus[index - sta_offset:]
            snippets[i, 0:len(snip)] = snip
        else:
            snippets[i, :] = stimulus[index - sta_offset:index + sta_offset]
    return time, v, spike_times, snippets
Esempio n. 4
0
def fake_neuron():
    lif_model = lif.LIF(offset=1.0)
    t, v, spike_times = lif_model.run_const_stim(5000, 0.00025)
    return t, v, spike_times
Esempio n. 5
0
def fake_neuron():
    lif_model = lif.LIF()
    t, v, spike_times = lif_model.run_const_stim(10000, 0.005)
    return t, v, spike_times