bionet.ted.iaf.iaf_encode¶
- bionet.ted.iaf.iaf_encode(u, dt, b, d, R=inf, C=1.0, dte=0, y=0.0, interval=0.0, quad_method='trapz', full_output=False)¶
IAF time encoding machine.
Encode a finite length signal with an Integrate-and-Fire neuron.
Parameters: u : array_like of floats
Signal to encode.
dt : float
Sampling resolution of input signal; the sampling frequency is 1/dt Hz.
b : float
Encoder bias.
d : float
Encoder threshold.
R : float
Neuron resistance.
C : float
Neuron capacitance.
dte : float
Sampling resolution assumed by the encoder (s). This may not exceed dt.
y : float
Initial value of integrator.
interval : float
Time since last spike (in s).
quad_method : {‘rect’, ‘trapz’}
Quadrature method to use (rectangular or trapezoidal) when the neuron is ideal; exponential Euler integration is used when the neuron is leaky.
full_output : bool
If set, the function returns the encoded data block followed by the given parameters (with updated values for y and interval). This is useful when the function is called repeatedly to encode a long signal.
Returns: s : ndarray of floats
If full_output == False, returns the signal encoded as an array of time intervals between spikes.
[s, dt, b, d, R, C, dte, y, interval, quad_method, full_output] : list
If full_output == True, returns the encoded signal followed by updated encoder parameters.
Notes
When trapezoidal integration is used, the value of the integral will not be computed for the very last entry in u.