API Documentation

API reference for the timescales module.

Table of Contents

Model Objects

Objects for computing timescales from PSD or ACF.

PSD

The PSD object fits power spectra and extracts timescales.

PSD([freqs, powers])

Power spectral density class.

ACF

The ACF object fits autocorrelation functions and extracts timescales.

ACF([lags, corrs, fs])

Autocorrelation function class.

Simulations

Spikes

Spike simulations use exponentially decaying probability kernels, convolved with a Poisson.

sim_spikes_synaptic(n_seconds, fs, tau[, ...])

Simulate a spiking autocorrelation as a synaptic kernel.

sim_spikes_prob(n_seconds, fs, kernel[, ...])

Simulate spiking probability.

sim_poisson(n_seconds, fs, kernel[, isi, ...])

Simulate a poisson distribution.

LFPs

Local field potentials are simulated branching and Ornstein-Uhlenbeck processes.

sim_branching(n_seconds, fs, tau, lambda_h)

Simulate a branching Poisson process.

sim_ou(n_seconds, fs, tau[, mean, variance])

Simulate spikes as an Ornstein-Uhlenbeck process.

Autoregression

Spectral

Autoregressive models are availble to compute PSD from.

compute_ar_spectrum(sig, fs, order[, ...])

Compute an autoregressive power spectrum.

Pipelines

Pipes

Pipe objects are used to reproducible simulate, transform, and/or fit timescales.

Pipe(n_seconds, fs[, seeds])

Simulations, PSD/ACF, and fitting pipelines.

Conversions

Conversion functions are usefull for convert PSD to/from ACF, and to convert knee frequencies to taus.

convert_knee(knee_freq)

Convert knee parameter(s) to time-constant value.

convert_tau(tau)

Convert tau(s) to knee frequency.

psd_to_acf(freqs, powers, fs[, normalize])

Convert a PSD to ACF.

acf_to_psd(lags, corrs, fs[, normalize])

Convert ACF to PSD.