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

Pattern generator class implementation. More...

Inherits unit.

Public Member Functions

function PatternGenerator_v1 (in param)
 Class constructor. More...
 
function traverse (in obj)
 Setting parameters to object.
 
- Public Member Functions inherited from unit
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.
 

Static Public Member Functions

static function gen_prbs_v1 (in order, in seed, in lengthSequence)
 
static function gen_random_pattern_v1 (in probability, in lines, in lengthSequence)
 

Public Attributes

Property nInputs
 Number of inputs.
 
Property nOutputs
 Number of outputs.
 
Property PRBSOrder
 PRBS order.
 
Property M
 Modulation Order.
 
Property N
 Number of Modes (or polarizations)
 
Property lengthSequence
 Output sequence length.
 
Property seed
 seeds for PRBS
 
Property typePattern
 Type of pattern.
 
Property probZero
 Probability of zeros ('0')
 
Constant Property allowedPRBSOrders = [7 15 23 31]
 
- 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

Pattern generator class implementation.

Outputs a random bit sequence with length "lengthSequence", using pseudorandom bit sequences "PRBS" or Bernoulli distributed sequences "Random".

Observations

  1. If you define the Pattern type as PRBS, the sequence will be generated according to the following polynomials:
  1. If you define the Pattern type as Random, the sequence will be generated randomly using randi() function.

Example

% Here we put a FULLY WORKING example using the MINIMUM set of required parameters
param.pg.M = 2;
pg = PatternGenerator_v1(param.pg);
sigOut = pg.traverse();

Advanced Example

% Here we put a FULLY WORKING example using the MAXIMUM set of required parameters
param.pg.M = 4;
param.pg.typePattern = 'PRBS';
param.pg.PRBSOrder = 31;
param.pg.seed = [100 200]
pg = PatternGenerator_v1(param.pg);
sigOut = pg.traverse();

OR

%>

% Here ANOTHER FULLY WORKING example using the MAXIMUM set of required parameters
param.pg.M = 4;
param.pg.typePattern = 'Random';
param.pg.probZero = 0.4;
pg = PatternGenerator_v1(param.pg);
sigOut = pg.traverse();
Author
jcesardiniz
Version
2

Definition at line 56 of file PatternGenerator_v1.m.

Constructor & Destructor Documentation

function PatternGenerator_v1::PatternGenerator_v1 ( in  param)

Class constructor.

Constructs an object of type pattern generator

Parameters
param.lengthSequenceLengthSequence - Output sequence lenghts [symbols].
param.RsRs - Symbol rate
param.typePatternTypePattern - Type of Pattern. Can be "PRBS" or "Random".
param.PRBSOrderPRBSOrder - Polynomial order if typePattern set to "PRBS" (7, 15, 23, 31).
param.seedSeed - Seeds for "PRBS" signal. Should be a vector. Cannot be zero.
param.probZeroProbZero - Probability of zeros if typePattern set to "Random".
Return values
objAn instance of the class PatternGenerator_v1

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