engine.neuron.analog.oscillator

Oscillators are waveform generators.

Oscillators, inheriting from AnalogNeuron, generate a wave consisting of pure sines. Components can be phase-shifted relative to each other or have their amplitude coupled to a certain frequency.

Potential uses include the imposition of modulation or forced oscillations. Like other Neuron instances, oscillators maintain their numeric state in the tensor voltage.

Warning

Oscillators should only emit to non-spiking-dependent synapses (e.g, Synapse). If paired with synapses whose behavior requires reading out a spiked attribute (e.g., STDPSynapse), the simulation will raise an exception.

See also

utils.signals.Wave

Iterator class used to generate complex waveforms without memory overhead.

class engine.neuron.analog.oscillator.OscillatorNeuron(amplitudes: Tensor | list[float] = None, frequencies: Tensor | list[float] = None, phases: Tensor | list[float] = None, amp_freq: Tensor | list[float] = None, baseline_shift: Tensor | list[float] = None, **kwargs)

Oscillator neuron implementation.

Waveform is determined by amplitude, frequency, phase, and coupling configuration parameters in a format acceptable to the utility class Wave constructor.

Parameters:
  • amplitudes (Tensor or list of float) – Component amplitudes in arbitrary units.

  • frequencies (Tensor or list of float) – Component frequencies in Hz.

  • phases (Tensor or list of float) – Component starting phases between 0 and 2, to be multiplied by pi.

  • amp_freq (Tensor or list of float) – Frequencies for amplitude modulation of Nth item, e.g. if frequencies[0] = 40.0 and amp_freq[0] = 5.0, the amplitude of the 40 Hz component will oscillate at 5 Hz.

  • baseline_shift (Tensor or list of float, optional) – Value by which to shift the entire signal (on the y-axis).

  • **kwargs – Accepts and applies any keyword argument by invoking the parent class Neuron constructor.

_config_props_: tuple[str] = ('amplitudes', 'frequencies', 'phases', 'amp_freq', 'baseline_shift')

A list of configurable property names of the class that is set/read by the configuration API.

Each sub/super-class can define this and the properties are accumulated across all the sub/super-classes.

forward(data: Tensor) dict

Oscillator forward method.

Advances the wave by one time unit and adds the data tensor.

Parameters:

data (Tensor) – External input current to be added to the waveform.

Returns:

Dictionary containing the numeric state tensor voltage.

Return type:

dict

register_waveforms() None

Creates Wave iterators for each oscillator element.