Robochameleon
v1.0
|
Superclass: basic building block to hold functions. More...
Inherits handle.
Inherited by AdaptiveEqualizer_MMA_RDE_v1, BalancedPair_v1, BaseBandFilter_v1, BC_Nx1_v1, BERT_v1, BranchSignal_v1, BS_1xN_v1, CDCompensation_v1, ChannelCombiner_v1, ClassTemplate_v1, Combiner_v1, Crop_v1, DCblock_v1, DDPLL_v1, Decimate_v1, Delay_v1, DigitalPreFilter_v1, DSO_v1, EDFA_v1, ElectricalFilter_v1, Gain_v1, IntensityModulator_v1, IQModulator_v1, Laser_v1, LinChBulk_v1, Mapper_v1, module, Negator_v1, NonlinearChannel_v1, OpticalHybrid_v1, OrthogonalCodeGenerator_v1, OSNR_v1, PatternGenerator_v1, PBC_Nx1_v1, PBS_1xN_v1, PD_v1, Polarizer_v1, PPG_v1, PulseShaper_v1, PulseTrainGenerator_v1, QuadratureImbalanceCompensation_v1, Quantizer_v1, Resample_v1, ResampleSkewJitter_v1, sink, SNR_v1, Splitter_v1, TestCh2x2_v1, TestSink_v1, and TestSource_v1.
Public Member Functions | |
virtual | traverse (in obj, in varargin) |
Main function call. | |
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. | |
Public Attributes | |
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. | |
Private Attributes | |
Property | ID |
Superclass: basic building block to hold functions.
Everything that operates on a signal_interface object should be defined as a class that inherits certain properties from unit. For example:
All units must have the following properties:
function unit::connectOutput | ( | in | obj, |
in | uobj, | ||
in | unitOutput, | ||
in | nextUnitInput | ||
) |
Specify where signal should go next.
Connects one output of one unit to the inputs of the next For use in modules
Complicated example:
This will have the following connection diagram
uobj | which unit to connect to |
unitOutput | which unit output to connect |
nextUnitInput | which input to connect to |
function unit::connectOutputs | ( | in | obj, |
in | units, | ||
in | destInputs | ||
) |
Specify where signal should go next.
Connects all the outputs of one unit to the inputs of the next. For use in modules
Connects all the outputs of one unit to the inputs of the next set of units.
Complicated example:
This will have the following connection diagram
Note the implied order of unit outputs is 1,2,3,...
Notes on syntax:
The destination inputs can be omitted if:
(a) There is one destination unit and all source outputs connect sequentially to all destination outputs OR
(b) There is exactly one destination unit for each source output.
units | object, or cell array of objects, to connect to |
destInputs | which input to connect to |
function unit::setparams | ( | in | obj, |
in | params, | ||
in | REQUIRED_PARAMS, | ||
in | QUIET_PARAMS | ||
) |
set parameters
Compare user-specified parameters to class properties. Assign as many as possible, warn the user when default is being used and when they have specified properties the class does not have.
For example, using Delay_v1, if the constructor is
Then the following code:
returns no warnings, errors, etc. This code,
will warn the user that ther is no puppies property in the delay class. If instead the constructor had been written
then
would warn the user that nInputs, nOutputs, results, and label are set to the default values. A better constructor would be
because it will return an error if the user tries to build a delay without actually specifying the delay. It will also warn the user if any other class-specific properties (mode, in this case) are set to default.
params | parameter structure to evaluate |
REQUIRED_PARAMS | cell array of required parameter names (default empty) |
QUIET_PARAMS | cell array of parameter names not to warn user about (default nInputs, nOutputs, results, label, draw) |
function unit::traverseNode | ( | in | obj | ) |
Set unique ID when creating a unit.
Apply function contained in unit to signal
Displays name of node and executes function contained in each unit on input signal(s).