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

Contains the implementation of a BER counter. More...

Inherits unit.

Public Member Functions

function BERT_v1 (in param)
 Class constructor. More...
 
function traverse (in obj, in sig, in refSig)
 Main function. More...
 
function bert (in obj, in srx)
 Error counter. More...
 
function obtainPRBS (in obj, in sig)
 Locates and returns the repeating sequence. More...
 
function ProcessBER (in obj)
 Error post-processor. More...
 
function plot (in obj, in srx, in ErrorMap, in i)
 Main plotting function. More...
 
function initPlot (in obj, in srx)
 Initialize plot. More...
 
function plotErrors (in obj, in ErrorMap, in i)
 Plot errorgram. More...
 
function plotHistogram (in obj, in srx, in jj)
 Histogram plotting function. More...
 
function plotResults (in obj, in pos, in res)
 Result plotting function. More...
 
function printResults (in obj)
 Result printing function. More...
 
- 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 getQ (in M, in srx, in sdemod, in c)
 Calculates PAM quality estimates. More...
 
static function getEVM (in srx, in c)
 Calculates EVM quality estimates. More...
 
static function BERfromQAMEVM (in EVM, in M)
 Calculates BER from EVM. More...
 
static function preEstimatePhase (in srx, in M)
 Quick and dirty phase offset estimate. More...
 
static function trimPRBS (in in)
 Gets PRBS from signal. More...
 
static function rx (in srx, in M, in Coding)
 K-means based demodulation. More...
 
static function skipMargin (in margin, in in)
 Skips symbols at beginning and/or end. More...
 

Public Attributes

Property nInputs
 
Property nOutputs
 
Property M
 Constellation order.
 
Property ConstType
 Constellation type {'QAM' | 'ASK' | ... }.
 
Property Constellation
 Full Constellation.
 
Property TxData
 Transmitted data.
 
Property Coding
 Coding gray or binary {'gray' | 'bin'}.
 
Property BlockLength
 Block length for error counting.
 
Property CounterMethod
 Which counter to use {'generic'}.
 
Property DecisionType
 Decision type {'hard' | 'soft'}.
 
Property EnableMetrics
 Calculate EVM, Q, etc. {true | false}.
 
Property EnableCounter
 Calculate BER, SER, errorgram etc.
 
Property PostProcessMethod
 How to identify bad blocks {'none' | 'threshold' | 'probability'}.
 
Property FastMode
 Disables Counter and plots only 10000 symbols.
 
Property Only
 Only calculate the signal columuns specified in this vector.
 
Property Cols
 (internal) Vector containing what columns to demodulate
 
- 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

Contains the implementation of a BER counter.

Bit error rate tester. It outputs estimated and computed quality of your signal in terms of Q factor, EVM, Pb, Ps, estimated number of bit errors and symbol errors, as well as the computer BER and SER. If PRBS pattern isn't passed as a parameter, the unit self-sets the number of inputs to 2, so that the 2nd input is the PRBS coming out the pattern generator.

Program Structure

The BERT executes the following functions in the followint order (from BERT_v1::traverse):

  1. Count errors and map their locations, using BERT_v1::bert
  2. Calculate constellation quality metrics, from BERT_v1::bert, either BERT_v1::getQ or BERT_v1::getEVM is called (depending on constellation type), and the expected BER is calculated either in BERT_v1::bert (for ASK) or BERT_v1::BERfromQAMEVM (for QAM)
  3. Choose which blocks to include/exclude in total BER, using BERT_v1::ProcessBER
  4. Plot all results

If speed is a concern, the second and fourth steps can be disabled using object proprties EnableMetrics and draw, respectively. Also, FastMode operation allows for only caluclate metrics and plots up to 10000 symbols in the constellation.

Output Structure

The class results structure contains all calculated results. It has two levels of hierarchy:

  1. obj.results.<property> describes a property of the entire signal
  2. obj.results.Col<N>.<property> describes a property the signal in column N

obj.results will always contain fields 'ber', 'ser', 'totalbits', and 'totalsymbs' (bit error rate, symbol error rate, total bits counted, and total symbols counted). obj.results.Col<N> is a more flexible structure type, whose fields may vary depending on the counting method, post-processing method, modulation format, etc.

If plotting (draw) is enabled, these will be both drawn in a figure and entered into the log. Otherwise, the user is responsible for extracting the information of interest.

See also
error_counter_v7c.m
constref.m
Author
Miguel Iglesias Olmedo
6.2015 Molly Piels

Definition at line 58 of file BERT_v1.m.

Constructor & Destructor Documentation

function BERT_v1::BERT_v1 ( in  param)

Class constructor.

Class constructor. Required parameters are the constellation order (param.M) and type (param.ConstType, default QAM). See the utils folder for correct syntax for constellation specification.

Additional signal description parameters:

  • param.TxData
    Transmitted data. This should be a single cycle of the full transmitted binary PRBS sequence. It can be either logical or double with 1's and 0's.
  • param.Coding
    Describes how the binary data is mapped to symbols. The options are with gray coding and binary (delay and add) coding.

Computation-related parameters:

  • param.CounterMethod
    Specify the counter to use. This block is meant to hold a number of counters. See BERT_v1::bert for instructions on how to format a counter to incorporate into the block.
  • param.BlockLength
    Most counters segment the data into blocks of this length. The post-processing algorithms require segmented data, so it is important to specify this even if the counter used does not require it.
  • param.DecisionType
    Many (but not all!) counters allow the user to choose between hard and soft decision. For hard decision, the locations of constellation points are set to be the ideal locations for that constellation. For soft decision, they are chosen by clustering the data using kmeans.
  • param.EnableMetrics
    Enable calculating Q, EVM, and associated theoretical number of symbol and bit errors. Should be enabled generally, but runtime improves if it is disabled, which can be useful for parameter scans.
  • param.PostProcessMethod
    After counting all errors in the entire sequence, only some are considered when calculting the final BER and SER. This option allows the user to select this criteria. The options are 'probability', 'threshold', and default. The default option is to count all bits received. If 'probability' is selected, the BER is calculated for the whole sequence, and then blocks of symbols are included/excluded based on whether or not the probability of that particular number of errors given this average BER is above a certain threshold. This probability is calculated assuming a binomial distribution. If 'threshold' is selected, all blocks with BER above a certain threshold are rejected. All the associated thresholds are passed to the constructor in the param.PostProcessMethod field, separated by the name of the method by a space. For example:
    param.PostProcessMethod = 'threshold 0.1'
    will result in all blocks with BER>0.1 being rejected.
  • param.FastMode
    - param.draw
    Enable or disable plotting (true results in the plot being generated).

Example:

param.M=4;
param.ConstType='ASK'
param.TxData=gen_prbs(15);
param.Coding = 'bin';
param.DecisionType = 'hard';
param.PostProcessMethod = 'probability 0.999';
bert = BERT_v1(param);

This will create a counter for 4PAM using hard-decision and assuming a delay-and-add mapping of bits to symbols. Only blocks with block-wise BERs with a probability of 0.999 or higher will be considered when the BER for the whole sequence is calculated. The block length will be 2048 symbols, because this is the default. Metrics will be calculated, and a plot will be generated, because this is also default behavior.

Parameters
param.MConstellation order
param.ConstTypeConstellation type {'QAM' | 'ASK' | ...}
param.TxDataTransmitted data (binary sequence)
param.CodingCoding gray or binary {'gray' | 'bin'}
param.CounterMethodCounting method {'generic'}
param.BlockLengthHow many symbols to consider at once (any integer)
param.DecisionTypeHard vs. soft decision {'hard' | 'soft'}
param.EnableMetricsEnable calculating Q, EVM, etc. {true | false}
param.EnableCounterEnable calculating BER, SER, errorgram etc.
param.PostProcessMethodHow to choose what blocks to count {'none' | 'threshold' | 'probability'}
param.drawTurn plotting on/off {true | false}
Return values
objInstance of the BERT_v1 class

Member Function Documentation

static function BERT_v1::BERfromQAMEVM ( in  EVM,
in  M 
)
static

Calculates BER from EVM.

Calculates BER from EVM, using the formula from [1]

Warning

There is a misprint in [1] Eq. 4. A √2 factor must be removed, as pointed out by [2].

References

[1] Schmogrow et al., "Error Vector Magnitude as a Performance Measure for Advanced Modulation Formats," Photononics Technology Letters, Vol. 24 No. 1, January 2012.

[2] Schmogrow et al., "512 QAM Nyquist sinc-pulse transmission at 54 Gbit/s in an optical bandwidth of 3 GHz." Optics Express Vol. 20, No. 6, 12 March 2012.

Parameters
EVMerror vector magnitude
Mconstellation order (M-QAM)
Return values
BERestimated BER
Author
Gerson Rodriguez de los Santos López
Date
20/11/2012
Author
Miguel Iglesias Olmedo, where EVM is normalized with resect to the average power, instead of the peak power, removing the need of the k factor.
Date
29/11/2014
function BERT_v1::bert ( in  obj,
in  srx 
)

Error counter.

Error counter. This part contains the main counting routines and calculates EVM, Q, etc.

In order to be compatible with the rest of this unit, a counter must output the following parameters (some of these are redundant and could be calculated within the switch case):

  1. BER per block (array)
  2. SER per block (array)
  3. Number of bit errors
  4. Number of symbol errors
  5. Number of bits counted
  6. Number of symbols counted
  7. Symbol error locations, or both mapped and received symbol sequences

This last one is optional, but obj.EnableCalcMetrics should be disabled if error locations are not returned by the counter. The remaining requirements are each mapped to a field of the output results structure (res). The results structure is quite flexible, and it is OK for a counter to return other values in it as well, but these will not be used elsewhere. Results from this function are stored in obj.results.ColN, where N is an integer corresponding to the signal column.

A compatible counter also must operate on an input signal that has been normalized to unity mean power and has to include a decision mechanism. The object's built-in receiver (BERT_v1::rx) can be used to provide decisions.

Parameters
siginput signal
refSigreference PRBS
Return values
res.ber_blockBER per block
res.ser_blockSER per block
res.err_bitstotal bit errors
res.err_symbtotal symbol errors
res.totalbitstotal bits counted
res.totalsymbtotal symbols counted
res.QQ factor
res.EVMError vector magnitude (for QAM)
res.PsSymbol error probability (for ASK)
res.PbBit error probability (for ASK)
res.est_bit_errorsEstimated bit errors from Q, EVM, etc.
res.ccluster centers
res.boundariesdecision boundaries (for ASK)
res.sigper-level standard deviations (for ASK)
ErrorMaplogical array with 1's representing errors
static function BERT_v1::getEVM ( in  srx,
in  c 
)
static

Calculates EVM quality estimates.

Calculates EVM quality estimates

Parameters
srxreceived symbols
ccentroids
Return values
evmerror vector magnitude
static function BERT_v1::getQ ( in  M,
in  srx,
in  sdemod,
in  c 
)
static

Calculates PAM quality estimates.

Calculates PAM quality estimates

Parameters
MConstellation order (M-PAM)
srxreceived symbols
sdemoddemodulated symbols
ccentroids
Return values
QQ-factor
boundarydecision boundaries
sigper level standard deviations
function BERT_v1::initPlot ( in  obj,
in  srx 
)

Initialize plot.

Generate plot figure and determine which quantities to plot

Parameters
srxreceived data
function BERT_v1::obtainPRBS ( in  obj,
in  sig 
)

Locates and returns the repeating sequence.

This can be used to find the PRBS in a sequence

Parameters
siginput signal (any)
Return values
prbsextracted PRBS (logical)
function BERT_v1::plot ( in  obj,
in  srx,
in  ErrorMap,
in  i 
)

Main plotting function.

Main plotting function

Parameters
srxreceived data
ErrorMaplogical array showing error locations
function BERT_v1::plotErrors ( in  obj,
in  ErrorMap,
in  i 
)

Plot errorgram.

Plot error locations

Parameters
ErrorMaperror locations
iColumn number
function BERT_v1::plotHistogram ( in  obj,
in  srx,
in  jj 
)

Histogram plotting function.

Histogram plotting function for PAM/ASK signals

Parameters
srxreceived data
greceived data
creceived data
function BERT_v1::plotResults ( in  obj,
in  pos,
in  res 
)

Result plotting function.

Prints results into table in figure

Parameters
posposition
resresults to print
static function BERT_v1::preEstimatePhase ( in  srx,
in  M 
)
static

Quick and dirty phase offset estimate.

Quick and dirty phase offset estimate

Parameters
srxinput data
Mconstellation order (M-QAM)
Return values
phiestimated phase offset
function BERT_v1::printResults ( in  obj)

Result printing function.

Prints results into log (using robolog - this could end up either in the command window or a text file).

See also
robolog.m
Parameters
resresults to print
function BERT_v1::ProcessBER ( in  obj)

Error post-processor.

This assesses which blocks or bits to consider when calculating the BER for the whole signal. BER and SER are calculated for the whole signal and for each column individually. Bit errors per block and block size are left unchanged.

For the processing methods that include thresholds, the correct constructor syntax is

param.PostProcessMethod = '<type> <value>'

For 'threshold' type, blocks with BER > value are rejected. For 'probability' type, blocks with probability < value are rejected. The probability is calculated using the average BER for the whole sequence, or 100 errors for the whole sequence, whichever is greater.

Return values
obj.results.berBER for the whole signal
obj.results.serSER for the whole signal
obj.results.ColN.berBER for column N
obj.results.ColN.serSER for column N
obj.results.ColN.badblocksmap of rejected block locations
static function BERT_v1::rx ( in  srx,
in  M,
in  Coding 
)
static

K-means based demodulation.

K-means based demodulation

Parameters
srxinput data
Mconstellation order (M-QAM)
Codingcoding type {'bin', 'gray'}
Return values
outreceived symbols
ccluster centroids
static function BERT_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
ininput data
Return values
symbolsestimated symbol sequence
function BERT_v1::traverse ( in  obj,
in  sig,
in  refSig 
)

Main function.

Main function. Performs basic signal conditioning, calls counter, post-processes, plots, then prints. The BER, SER, and any other requested methods are saved in the object's results property.

Parameters
siginput signal
refSigreference PRBS
static function BERT_v1::trimPRBS ( in  in)
static

Gets PRBS from signal.

Gets a signal and outputs a clean PRBS for comparison

Parameters
ininput data
Return values
outestimated PRBS

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