- SystemML Class
std/2009/random/spikes
- Summary
- Source of pseudo-random spikes data
- Status
- Stable
Overview
A source of pseudo-random spikes data. The data output is generated at run-time by an internal random number generator, and is repeatable by seeding with an explicit Seed.
Notes
This process uses std/util/rng internally.
Connectivity
- No inputs.
- One output, the data generated.
State
This Process stores its State in DataML.
- streams (
UINT32 scalar) - The number of output streams to produce.
- dist (STRING)
- Distribution; must be "exponential", currently.
- pars (
DOUBLE 1xP) - Specific to distribution. For exponential distribution, it should be
[min sd] (minimum ISI, and standard deviation).
- 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 ;
sys = sml_system;
state = [];
state .streams = 100 ;
state .dist = 'exponential';
state .pars = [10 20 ] / 1000 ;
sys = sys .addprocess('src', 'std/2009/random/spikes', fS , state );
exe = brahms_execution;
exe .all = true ;
exe .stop = 1 ;
exe .seed = 1 ;
out = brahms(sys , exe );
subplot (2 ,1 ,1 )
plot (out .src .out .ts (:,1 ), out .src .out .ts (:,2 ), 'k.')
xlabel ('time (samples)')
ylabel ('stream')
subplot (2 ,1 ,2 )
isi = [];
for s = 0 :state .streams
i = find (out .src .out .ts (:,2 ) == s );
t = out .src .out .ts (i ,1 );
isi = [isi ; diff (t )];
end
isi = double (isi );
hist (isi , 0 .5 :1 :100 )
axis ([0 100 0 200 ])
xlabel ('ISI (milliseconds)')
ylabel ('frequency')
[min (isi ) std (isi )]
Expected Output
Matlab Console
ans =
10 18.756
|