This actor downsamples an input stream by an integer factor by
removing tokens. The downsample factor is given by the <i>factor</i>
parameter. On each firing, this actor consumes <i>factor</i> tokens from the
input and sends only one of them to the output. The one sent
depends on the <i>phase</i> parameter. If <i>phase</i> is 0, then
the most recent one (the last one consumed) is sent. If <i>phase</i>
is 1, then the next most recent one is sent. The value of <i>phase</i>
can range up to <i>factor</i>-1, in which case the first one consumed
is sent. By default, the <i>factor</i> parameter is 2,
so the input sample rate is twice that of the output.
The default value for <i>phase</i> is 0.
<p>
This actor is data polymorphic. It can accept any token
type on the input.
Steve Neuendorffer, Edward A. Lee
$Id: DownSample.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 1.0
Yellow (neuendor)
Yellow (neuendor)
The number of input tokens to read per output token produced.
This is an integer that defaults to 2 and must be greater than
zero.
The phase of the output with respect to the input.
This is an integer that defaults to 0 and must be between 0
and <i>factor</i>-1. If <i>phase</i> = 0, the most recent
sample is the output, while if <i>phase</i> = <i>factor</i>-1
the oldest sample is the output.