SystemML Class
std/2009/source/spikes
Summary
Source of explicitly-specified spikes data
Status
Stable

Overview

A source of explicitly-specified spikes data. The data to be output is specified as part of the parametrisation of the process. The data provided represents a window of spikes - a recording of the spikes that occurred on certain streams over a certain time period. The output of the process is one spikes output with the same number of streams as supplied. The output at the first sample has spikes for each spike on at the first sample of the supplied window, and so on. If N time samples are supplied, then an error will be raised if the process is required to produce the N+1th sample. If "repeat" is set, the process will produce exactly the same output in the N+1th sample as in the 1st sample, and so on (that is, the same spikes window will be produced multiple times).

Notes

  • Spikes must be provided in "ts" in chronological order.
  • Neither window "t" nor "s" need begin at zero (that is, both windows can be "offset"). However, these offsets are lost during operation since they cannot be communicated at the output, so the output of the process looks the same as if such offsets were removed.
  • Any spikes that do not fall within the specified window, whether it is offset or not, are ignored (not delivered).

Connectivity

  • No inputs.
  • One output, the data provided.

State

This Process stores its State in DataML. It uses the same representation of a block of spikes as is output by std/data/spikes.

fS (DOUBLE scalar)
Sample rate of the provided spikes. This must currently match the sample rate of the process (but it may not be left out).
t (UINT32 1x2)
Time window covered by spikes structure, [t1 t2], with t1 the first represented sample period and t2 the next unrepresented sample period.
s (UINT32 1x2)
Stream window covered by spikes structure, [s1 s2], with s1 the first represented stream and s2 the next unrepresented stream.
ts (UINT32 2xN)
N spikes, represented as an [2xN] array. Each column is [t; s], with t the sample number and s the stream number on which a spike occurred.
repeat (BOOL scalar) OPTIONAL
If supplied and true, the supplied window of spikes is supplied as many times as necessary until the execution ends.
outputName (STRING) OPTIONAL
If supplied, the name of the single output (if not, "out" is used).

Example

Script

M Source Code (against 995)
fS = 1000; nstreams = 100; nspikes = 100; sys = sml_system; t = floor(rand(nspikes, 1)*fS); s = floor(rand(nspikes, 1)*nstreams); t = sort(t); state = []; state.fS = fS; state.t = [0 fS]; state.s = [0 nstreams]; state.ts = [t s]'; sys = sys.addprocess('src', 'std/2009/source/spikes', fS, state); exe = brahms_execution; exe.all = true; exe.stop = 1; out = brahms(sys, exe); plot(out.src.out.ts(1,:), out.src.out.ts(2,:), 'k.')

Expected Output