Changeset 455 for trunk/src/analysis.py
- Timestamp:
- 08/24/10 18:28:25 (21 months ago)
- Files:
-
- 1 modified
-
trunk/src/analysis.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/analysis.py
r453 r455 16 16 17 17 ccf - fast cross correlation function based on fft 18 crosscorrelate - cross-correlation between two series of discrete 19 events (e.g. spikes) 18 20 simple_frequency_spectrum - Simple frequencxy spectrum 19 21 arrays_almost_equal - comparison of two arrays 22 make_kernel - creates kernel functions for convolution 20 23 """ 21 24 22 25 import os, numpy 23 from NeuroTools import check_dependency 26 from NeuroTools import check_dependency, signals 24 27 25 28 def arrays_almost_equal(a, b, threshold): … … 96 99 97 100 Inputs: 98 sua1 - array of event times. Can be either a column/row vector. 99 sua2 - array of event times. Can be either a column/row vector. 101 sua1 - array of event times. Can be either a column/row vector or a 102 member of the SpikeTrain class. 103 sua2 - array of event times. Can be either a column/row vector or a 104 member of the SpikeTrain class. 100 105 If sua2 == sua1 the result is the 101 106 autocorrelogram. … … 134 139 Examples: 135 140 >> crosscorrelate(numpy_array1, numpy_array2) 136 >> crosscorrelate(spike_train1.spike_times, spike_train2.spike_times) 137 >> crosscorrelate(spike_train1.spike_times, spike_train2.spike_times, 138 lag = 150.0) 139 >> crosscorrelate(spike_train1.spike_times, spike_train2.spike_times, 140 display=True, kwargs={'bins':100}) 141 >> crosscorrelate(spike_train1, spike_train2) 142 >> crosscorrelate(spike_train1, spike_train2, lag = 150.0) 143 >> crosscorrelate(spike_train1, spike_train2, display=True, 144 kwargs={'bins':100}) 141 145 142 146 See also: … … 149 153 sua = [] 150 154 for x in (sua1, sua2): 151 if x.ndim == 1: 155 if isinstance(x, signals.SpikeTrain): 156 sua.append(x.spike_times) 157 elif x.ndim == 1: 152 158 sua.append(x) 153 159 elif x.ndim == 2 and (x.shape[0] == 1 or x.shape[1] == 1):
