Accumulator Class Reference
[Composites]

Accumulate result of multiple ticks. More...

#include <Accumulator.h>

Inherits Marsyas::MarSystem.


Detailed Description

Accumulate result of multiple ticks.

Accumulate result of multiple tick process calls to child (i.e internal) MarSystem. Spit output only once when all the results are accumulated (either using a predefined number of processing ticks or when explicitly "flushed"). Used to change the rate of process requests.

For example, if mode is "countTicks" and nTimes is 5, then each time the Accumulator receives a tick(), it sends 5 tick()s to the MarSystems that are inside it.

Controls:

..........X.

So, having the graphic above in mind, supose we have an Accumulator in "explicitFlush", with a child onset detector MarSystem that at each tick, looks at its previous output and compares it to the current one, deciding if an onset existed one output ago (so, it need to look one output into the future - which is the current one! - to be able to decide). In case it determines an onset occured one output ago (marked as X in the picture above), it sets an "onset deteted" control (which should be linked to the flush control in the parent Accumulator), making the Accumulator to stop accumulating and output the accumulated data till the detected onset. However, if the timesToKeep value is set to zero, the Accumulator will output the entire accumulated data, and usually in such an onset detection scenario, it would be more interesting to have it just output the data till the detected onset, keeping the remaining data for further accumulation. The way to achieve that is to specifiy a non-zero value to the timesToKeep control, which in the current example could be set to 2 (i.e. both the previous and current data outputs will be kept internally, and all the previous accumulated data output - we could call it the pre-onset data).

Definition at line 61 of file Accumulator.h.


The documentation for this class was generated from the following files:

Generated on Wed May 23 00:02:23 2012 for Marsyas by  doxygen 1.5.6