Series (Constructor)

<series> output = new Series()

<series> output = new Series(<number> Number of Points)

<series> output = new Series(<number> Number of Points, <number> Sampling Frequency)

Use the series constructor to instantiate a new data series in a script.  The constructor can be called with no arguments, with one argument specifying the length of the series, or with two arguments specifying the length of the series and the sampling frequency.  With either of the latter two calls, the data points are all initialized to be equal to zero.  EMGscript automatically manages memory by caching data to disk so that numerous large data series can be manipulated within a script.

Examples:

// create a new data series

var mySeries = new Series();

// create a new data series that can hold 100 samples

var mySeries2 = new Series(100);

// create a new data series that can hold 100 samples at a frequency of 1000 Hz

var mySeries3 = new Series(100, 1000);