Robochameleon  v1.0
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
module Class Reference

Superclass: collection/sequence of unit. More...

Inherits unit.

Inherited by CoherentFrontend_v1, CoherentFrontend_v2, DAC_v1, DACPrecompensator_v1, ExtendedAWG_v1, PolMux_v1, SimpleAWG_v1, SimpleCoherentTransmitter_v1, SimpleWDMTransmitter_v1, SymbolGenerator_v1, and WaveformGenerator_v1.

Public Member Functions

function module ()
 Create sink for internal output buffers.
 
function view (in obj)
 Show biograph through module_view-class.
 
function getOutput (in obj)
 Function to access module output for various intentions.
 
function keepOutput (in obj)
 Function tells outputBuffer sink not to delete itself after traverse.
 
function traverse (in obj, in varargin)
 Traverse function for modules. 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.
 

Public Attributes

Property nInputs
 Number of input arguments (required)
 
Property nOutputs
 Number of output arguments (required)
 
- 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.
 

Protected Member Functions

function exportModule (in obj, in varargin)
 Construct module. More...
 
function connectInputs (in obj, in destInternalUnits, in destInternalInputs)
 Connect input signal to internal unit(s) More...
 

Protected Attributes

Property outputBuffer
 Where output signal is stored.
 

Private Member Functions

function createGraphOrdering (in obj)
 Determine order in which to traverse units. More...
 

Private Attributes

Property internalUnits
 Cell array of units in module.
 
Property traversingOrder
 Order in which to traverse units.
 
Property biograph_struct
 Struct for the biograph view function.
 
Property destInternalUnits
 
Property destInternalInputs
 

Detailed Description

Superclass: collection/sequence of unit.

Modules are used to encapsulate multiple units. If you have a sequence of units/operations that is more or less fixed (e.g. the standard DSP chain is IQ imbalance -> CD compensation -> Retiming -> Equalization -> Carrier recovery. It would be reasonable to want a function block that just did all this DSP, and that function block would be a module. A module is a class with one function, the constructor, specified.

For example:

classdef MyDSPModule_v1 < module
properties
nInputs = 1; % Number of input arguments
nOutputs = 1; % Number of output arguments
end
methods
function obj = MyDSPModule_v1(param)
%Construct components
CD = CDCompensation_v1(param.CD);
...
CR = DDPLL_v1(param.crm);
%Connect everything
obj.connectInputs({IQ}, 1); %external connections on input
IQ.connectOutputs(CD, 1); %IQ imbalance -> CD compensation
...
CR.connectOutputs(obj.outputBuffer,1); %external connections at output
%This line is required in constructor
end
end
end

Modules inherit from unit, thus module.traverse, module.connectOutputs, and module.connectOutput are valid function calls. For example:

%Get some data - this is not a real function, imagine received_signal is some
%signal_interface we want to demodulate.
received_signal = LoadTrace(filename);
%construct object with some parameters (assume specified elsewhere)
demodulator = MyDSPModule_v1(DSPparams);
%run code
demodulated_signal = demodulator.traverse(received_signal);
See also
unit
Author
Robert Borkowski
Rasmus Jones
Version
1.1

Definition at line 64 of file module.m.

Member Function Documentation

function module::connectInputs ( in  obj,
in  destInternalUnits,
in  destInternalInputs 
)
protected

Connect input signal to internal unit(s)

For modules with nInputs >= 1, the input signal must be routed to the correct internal unit or units. Both the name of the unit and which of its inputs the signal should be attached to must be specified. Syntax is the same as unit.connectOutputs.

Parameters
destInternalUnitscell array of internal units to connect to
destInternalInputsnumeric array specifying which input on each unit to connect to
See also
unit.connectOutputs
function module::createGraphOrdering ( in  obj)
private

Determine order in which to traverse units.

Create a "linked list like" graph

function module::exportModule ( in  obj,
in  varargin 
)
protected

Construct module.

Important. Must be called during (at end of) constructor.

function module::traverse ( in  obj,
in  varargin 
)
virtual

Traverse function for modules.

Parameters
varargininput signal

Reimplemented from unit.


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