diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2014-09-29 12:55:56 +0200 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2014-09-29 12:55:56 +0200 |
commit | e4f1c09672068e4778f7b5f3e27b47ff8986863c (patch) | |
tree | a6550b5f2683d1e9537a5fb250e3513a85719697 /pyspike/distances.py | |
parent | fa6b1e375eb8a4b93582d2935352447849e66203 (diff) |
+mul_scalar, tests restructured and cosmetics
Diffstat (limited to 'pyspike/distances.py')
-rw-r--r-- | pyspike/distances.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pyspike/distances.py b/pyspike/distances.py index 10b1d3c..f4be625 100644 --- a/pyspike/distances.py +++ b/pyspike/distances.py @@ -9,6 +9,10 @@ import numpy as np from pyspike import PieceWiseConstFunc, PieceWiseLinFunc + +############################################################ +# add_auxiliary_spikes +############################################################ def add_auxiliary_spikes( spike_train, T_end , T_start=0.0): """ Adds spikes at the beginning (T_start) and end (T_end) of the observation interval. @@ -29,6 +33,10 @@ def add_auxiliary_spikes( spike_train, T_end , T_start=0.0): spike_train = np.append(spike_train, T_end) return spike_train + +############################################################ +# isi_distance +############################################################ def isi_distance(spikes1, spikes2): """ Computes the instantaneous isi-distance S_isi (t) of the two given spike trains. The spike trains are expected to have auxiliary spikes at the @@ -95,6 +103,9 @@ def isi_distance(spikes1, spikes2): return PieceWiseConstFunc(spike_events[:index+1], isi_values[:index]) +############################################################ +# get_min_dist +############################################################ def get_min_dist(spike_time, spike_train, start_index=0): """ Returns the minimal distance |spike_time - spike_train[i]| with i>=start_index. @@ -111,6 +122,9 @@ def get_min_dist(spike_time, spike_train, start_index=0): return d +############################################################ +# spike_distance +############################################################ def spike_distance(spikes1, spikes2): """ Computes the instantaneous spike-distance S_spike (t) of the two given spike trains. The spike trains are expected to have auxiliary spikes at the |