Robochameleon
v1.0
|
Crops a signal with many samples to fewer samples. More...
Inherits unit.
Public Member Functions | |
function | Crop_v1 (in param) |
Class constructor. More... | |
function | traverse (in obj, in varargin) |
Main function. More... | |
![]() | |
function | traverseNode (in obj) |
Set unique ID when creating a unit. More... | |
function | connectOutput (in obj, in uobj, in unitOutput, in nextUnitInput) |
Specify where signal should go next. More... | |
function | connectOutputs (in obj, in units, in destInputs) |
Specify where signal should go next. More... | |
function | writeInputBuffer (in obj, in sig, in inputId) |
write input buffer | |
function | horzcat (in varargin) |
horizontal concatenation | |
function | vertcat (in varargin) |
vertical concatenation | |
function | setparams (in obj, in params, in REQUIRED_PARAMS, in QUIET_PARAMS) |
set parameters More... | |
function | view (in obj) |
Show interactive GUI through unit_view-class. | |
Static Public Member Functions | |
static function | skipMargin (in margin, in in) |
Skips symbols at beginning and/or end. More... | |
static function | InvSkipMargin (in margin, in in) |
Skips symbols at beginning and/or end. More... | |
Public Attributes | |
Property | nInputs |
Property | nOutputs |
Property | Margin |
Property | InverseMargin |
![]() | |
Property | inputBuffer |
Buffer for storing inputs as we traverse the graph. | |
Property | nextNodes |
Children nodes. | |
Property | destInputs |
Destination inputs in children. | |
Property | results |
For storing results. | |
Property | label |
Property | draw |
enable/disable plotting | |
Property | nInputs |
Number of signals traverse expects. | |
Property | nOutputs |
Number of outputs traverse expects. | |
Crops a signal with many samples to fewer samples.
Example:
This will cut 10% of the signal from both ends.
function Crop_v1::Crop_v1 | ( | in | param | ) |
Class constructor.
Either Margin or InverseMargin must be specified. By default, one input/output is assumed, though this can also be changed by setting nInputs or nOutputs.
param.Margin | maps to obj.margin |
param.InverseMargin | maps to obj.InverseMargin |
|
static |
Skips symbols at beginning and/or end.
Skips symbols at beginning and/or end of sequence. Unlike Crop_v1::skipMargin, the user specifies which samples to keep, not which to throw out.
margin | how much of sequence to keep (fraction between 0 and 1 or number of samples) |
in | input data |
|
static |
Skips symbols at beginning and/or end.
Skips symbols at beginning and/or end of sequence
margin | how much of sequence to skip (fraction between 0 and 1 or number of samples) |
in | input data |
|
virtual |
Main function.
Crops the signal
varargin | input signal(s) |
Reimplemented from unit.
Property Crop_v1::InverseMargin |
Amount of signal to keep. Either specified as a percentage (0 to 1) or sample index.
If the margin is a 1x2 vector, it is the distance to keep, counting from the beginning (i.e. [0.1, 0.1] will chop return a 0-length vector, [0.1, 0.9] will do the same thing as param.Margin=[0.1 0.1];
If the margin is a scalar, that fraction or number of samples is taken from the center of the signal.
Property Crop_v1::Margin |
Amount of signal to crop. Either specified as a percentage (0 to 1) or sample index.
If the margin is a 1x2 vector, it is the distance to remove from the ends (i.e. [0.1, 0.1] will chop 10% from both ends).
If the margin is a scalar, that fraction or number of samples is taken from the center of the signal.