nengolib.signal.EvalPoints

class nengolib.signal.EvalPoints(sys, process, n_steps=10000, dt=None, **run_steps_kwargs)[source]

Samples the output of a LinearSystem given some input process.

This can be used to sample the evaluation points according to some filtered process. Used by RollingWindow.

Parameters:
sys : linear_system_like

Linear system representation.

process : nengo.Process

Nengo process to simulate.

n_steps : integer, optional

Number of steps to simulate the process. Defaults to 10000.

dt : float, optional

Process and system simulation time-step. Defaults to process.default_dt.

**run_steps_kwargs : dictionary, optional

Additional keyword arguments for process.run_steps.

Notes

For ideal sampling, the given process should be aperiodic across the interval of time specified by n_steps and dt, and moreover the sampled num (number of evaluation points) should not exceed n_steps.

Examples

>>> from nengolib.signal import EvalPoints

Sampling from the state-space of an alpha synapse given band-limited white noise:

>>> from nengolib import Alpha
>>> from nengo.processes import WhiteSignal
>>> eval_points = EvalPoints(Alpha(.5).X, WhiteSignal(10, high=20))
>>> import matplotlib.pyplot as plt
>>> from seaborn import jointplot
>>> jointplot(*eval_points.sample(1000, 2).T, kind='kde')
>>> plt.show()

(Source code)

_images/nengolib-signal-EvalPoints-1.png

Methods

sample(num[, d, rng]) Samples n points in d dimensions.