File: examples-misc_correlated_inputs2.txt

package info (click to toggle)
brian 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 23,436 kB
  • sloc: python: 68,707; cpp: 29,040; ansic: 5,182; sh: 111; makefile: 61
file content (41 lines) | stat: -rw-r--r-- 923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.. currentmodule:: brian

.. index::
   pair: example usage; run
   pair: example usage; SpikeGeneratorGroup
   pair: example usage; show
   pair: example usage; raster_plot
   pair: example usage; reshape
   pair: example usage; mixture_process
   pair: example usage; SpikeMonitor
   pair: example usage; linspace
   pair: example usage; mean

.. _example-misc_correlated_inputs2:

Example: correlated_inputs2 (misc)
==================================

An example with correlated spike trains
From: Brette, R. (2007). Generation of correlated spike trains.

::

    from brian import *
    
    N = 100
    c = .2
    nu = linspace(1*Hz, 10*Hz, N)
    P = c*dot(nu.reshape((N,1)), nu.reshape((1,N)))/mean(nu**2)
    tauc = 5*ms
    
    spikes = mixture_process(nu, P, tauc, 1*second)
    input = SpikeGeneratorGroup(N, spikes)
    
    S = SpikeMonitor(input)
    run(1000 * ms)
    
    raster_plot(S)
    show()