Spike analysis software.
Concatenate spike trains with the same meta data. Trains will be sorted by the metadata.
Compute correlation index from spike_trains as described in [Joris2006].
References
[Joris2006] | Joris, P. X., Louage, D. H., Cardoen, L., & van der Heijden, M. (2006). Correlation index: a new metric to quantify temporal coding. Hearing research, 216, 19-30. |
Calculate entrainment of spike_trains in response to periodic stimulus (freq Hz).
Calculates average firing rate of neurons.
Fold spike_trains by period.
Equivalent of plt.gcf()
Return the common duration of spike_trains.
Calculate inter-spike interval histogram (ISIH).
Returns: | array_like
array_like
|
---|
Create spike trains from various data formats.
Calculate period histogram of spike_trains to the periodic stimulus (ferq Hz).
Returns: | ndarray
ndarray
|
---|
Plot inter-spike interval histogram.
Visualize spike_trains by converting them to bit map and plot using plt.imshow(). Set fs reasonably in order to avoid aliasing effects.
For smaller number of spike trains, it’s usually better to use plot_raster.
Plot period histogram of the given spike trains.
Parameters: | spike_trains : spike_trains
freq : float
nbins : int
shift : float
ax : plt.Ax, optional
style : str, optional
density : bool, optional
drawstyle : {‘default’, ‘steps’, ‘steps-pre’, ‘steps-mid’, ‘steps-post’}
|
---|---|
Returns: | plt.Axis
|
Plots PSTH of spike_trains.
Plot raster plot.
Plot shuffled autocorrelogram (SAC) (Joris 2006)
Plot time signal.
Parameters: | signal : array_like
fs : float, optional
ax : plt.Axis, optional
style : str, optional
|
---|---|
Returns: | plt.Axis
|
Calculate peristimulus time histogram (PSTH).
Returns: | array_like
array_like
|
---|
Select trains from spike_trains where kwargs are equal to the metadata.
Equivalent of plt.show()
Calculate shuffled autocorrelogram (SAC) of spike_trains as described in [Joris2006].
Returns: | ndarray
ndarray
|
---|
References
[Joris2006] | Joris, P. X., Louage, D. H., Cardoen, L., & van der Heijden, M. (2006). Correlation index: a new metric to quantify temporal coding. Hearing research, 216, 19-30. |
Count all spikes in spike_trains.
Convert spike_trains to 2D array (signals) with samlping frequency fs.
Trim the spike trains.
Remove all spikes outside of the (start, stop) range.
Calculate vector strength of spike_trains in response to periodic stimulus (freq Hz).
DSP related functions.
Align two signals, a and b, so that they have the same sampling frequency (resample to lower fs) and length (trim longer signal).
Generate amplitude modulated tone.
Parameters: | fs : float
fm : float
fc : float
m : float
duration : float
pad : float, optional
ramp : float, optional
dbspl : float, optional
|
---|---|
Returns: | array_like
|
Calculate amplitudes for each “phase” of signle electrical pulse in cochlear implant.
The resulting pulses are charged ballanced. The function supports mono-, bi- and tri-phasic pulses.
Parameters: | durations : array_like
polarity : {-1, 1, ‘c’ ‘cathodic’, ‘a’, ‘anodic’}
ratio : float
|
---|---|
Returns: | tuple
|
Generate electrical pulse.
Parameters: | fs : scalar
amplitudes : array_like
durations : array_like
gap : scalar
pad : scalar
charge : None, scalar, optional
|
---|---|
Returns: | array_like
|
Filter signal using a FFT filter.
Parameters: | signal : array_like
fs : float
band : tuple
|
---|---|
Returns: | array_like
|
Plot time signal.
Parameters: | signal : array_like
fs : float, optional
ax : plt.Axis, optional
style : str, optional
|
---|---|
Returns: | plt.Axis
|
Generate ramped tone singal.
Parameters: | fs : float
freq : float
duration : float
pad : float, optional
pre : float, optional
ramp : float, optional
dbspl : float, optional
|
---|---|
Returns: | array_like
|
Resample signal from fs to new_fs.
Calculate root mean squere of a signal.
Scale the level of signal to the given dB_SPL.
Equivalent of plt.show()
Calculate signal-to-noise ratio in dB given signal and noise.
Return time vector for signal with sampling frequency fs (Hz).
Trim the longer vector, so that both have the same length.
Utilities.
Wrap a function and cache its output.
Dump data in order to recall the most up-to-date records later.
Parameters: | data : pd.DataFrame
name : str, optional
workdir : str, optional
kwargs : dict, optional
|
---|
Find a zero crossing of a function using binary search.
Parameters: | func : function
x1, x2 : float
xtol : float, optional
kwargs : dict, optional
|
---|---|
Returns: | float
|
Return a quick and dirty shelve based persisten dict-like store.
Recall dumped data discarding duplicated records.
Parameters: | name : str, optional
workdir : str, optional
timestamp : bool, optional
load_all : bool, optional
|
---|---|
Returns: | pd.DataFrame
|
Apply func to every item of iterable and return a list of the results. This map supports multiple backends, e.g. ‘serial’, ‘multiprocessing’, ‘ipcluster’.
Parameters: | func : function
space : (list of dicts) or (dict of lists)
backend : {‘serial’, ‘ipcluster’, ‘multiprocessing’, ‘serial_isolated’}
cache : bool or {‘yes’, ‘no’, ‘redo’}
workdir : str, optional
dependencies : list, optional
kwargs : dict, optional
|
---|---|
Returns: | pd.DataFrame
|
Contains functions to read and write spike data in different formats.
Read the spike timings as exported from BrainWare.
BrainWare is software by Tucker-Davis Technologies.
Parameters: | filename : str
stimparams : dict
|
---|---|
Returns: | spike_trains
|