SystemML Class
Resampler for spikes data


Resampler for spikes data. The process is not parametrized, and simply moves all input spikes forward in time, if necessary, until the next possible output sample time. Thus, if two spikes occur on the same input stream in one output sample, only one output spike is produced.


One resampling process can resample as many streams as you plug into it, but they must have different names or an error will be generated. You can achieve this with code of the sort below.

M Source Code (against 995)
% if the output names you plug in are different sys ='a>a', 'resamp'); sys ='b>b', 'resamp'); % if the output names you plug in are the same sys ='a>out', 'resamp<a'); sys ='b>out', 'resamp<b');


  • N inputs, the source data streams.
  • N outputs, the resampled data streams.


This Process takes no parameters.



M Source Code (against 995)
fS = 1000; fS2 = 20; 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); sys = sys.addprocess('resamp', 'std/2009/resample/spikes', fS2, []); sys ='src>out', 'resamp'); exe = brahms_execution; exe.all = true; exe.stop = 1; out = brahms(sys, exe); clf hold on plot(double(out.src.out.ts(1,:)) / fS, out.src.out.ts(2,:), 'k.') plot(double(out.resamp.out.ts(1,:)) / fS2, out.resamp.out.ts(2,:), 'r.') xlabel('time (samples)') ylabel('stream')

Expected Output