Robochameleon  v1.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Crop_v1 Class Reference

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...
 
- Public Member Functions inherited from unit
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
 
- Public Attributes inherited from unit
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.
 

Detailed Description

Crops a signal with many samples to fewer samples.

Example:

Crop_v1 = Crop_v1(struct('Margin', [0.1 0.1]));

This will cut 10% of the signal from both ends.

Author
Molly Piels
Version
1

Definition at line 17 of file Crop_v1.m.

Constructor & Destructor Documentation

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.

Parameters
param.Marginmaps to obj.margin
param.InverseMarginmaps to obj.InverseMargin
Returns
instance of the Crop_v1 class

Member Function Documentation

static function Crop_v1::InvSkipMargin ( in  margin,
in  in 
)
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.

Parameters
marginhow much of sequence to keep (fraction between 0 and 1 or number of samples)
ininput data
static function Crop_v1::skipMargin ( in  margin,
in  in 
)
static

Skips symbols at beginning and/or end.

Skips symbols at beginning and/or end of sequence

Parameters
marginhow much of sequence to skip (fraction between 0 and 1 or number of samples)
ininput data
function Crop_v1::traverse ( in  obj,
in  varargin 
)
virtual

Main function.

Crops the signal

Parameters
varargininput signal(s)
Returns
varargout cropped signal(s)

Reimplemented from unit.

Member Data Documentation

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.

Definition at line 42 of file Crop_v1.m.

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.

Definition at line 33 of file Crop_v1.m.


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