Robochameleon
v1.0
|
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... | |
![]() | |
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 | |
![]() | |
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. | |
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):
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:
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.
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:
Computation-related parameters:
Example:
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.
param.M | Constellation order |
param.ConstType | Constellation type {'QAM' | 'ASK' | ...} |
param.TxData | Transmitted data (binary sequence) |
param.Coding | Coding gray or binary {'gray' | 'bin'} |
param.CounterMethod | Counting method {'generic'} |
param.BlockLength | How many symbols to consider at once (any integer) |
param.DecisionType | Hard vs. soft decision {'hard' | 'soft'} |
param.EnableMetrics | Enable calculating Q, EVM, etc. {true | false} |
param.EnableCounter | Enable calculating BER, SER, errorgram etc. |
param.PostProcessMethod | How to choose what blocks to count {'none' | 'threshold' | 'probability'} |
param.draw | Turn plotting on/off {true | false} |
obj | Instance of the BERT_v1 class |
|
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.
EVM | error vector magnitude |
M | constellation order (M-QAM) |
BER | estimated BER |
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):
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.
sig | input signal |
refSig | reference PRBS |
res.ber_block | BER per block |
res.ser_block | SER per block |
res.err_bits | total bit errors |
res.err_symb | total symbol errors |
res.totalbits | total bits counted |
res.totalsymb | total symbols counted |
res.Q | Q factor |
res.EVM | Error vector magnitude (for QAM) |
res.Ps | Symbol error probability (for ASK) |
res.Pb | Bit error probability (for ASK) |
res.est_bit_errors | Estimated bit errors from Q, EVM, etc. |
res.c | cluster centers |
res.boundaries | decision boundaries (for ASK) |
res.sig | per-level standard deviations (for ASK) |
ErrorMap | logical array with 1's representing errors |
|
static |
Calculates EVM quality estimates.
Calculates EVM quality estimates
srx | received symbols |
c | centroids |
evm | error vector magnitude |
|
static |
Calculates PAM quality estimates.
Calculates PAM quality estimates
M | Constellation order (M-PAM) |
srx | received symbols |
sdemod | demodulated symbols |
c | centroids |
Q | Q-factor |
boundary | decision boundaries |
sig | per level standard deviations |
function BERT_v1::initPlot | ( | in | obj, |
in | srx | ||
) |
Initialize plot.
Generate plot figure and determine which quantities to plot
srx | received 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
sig | input signal (any) |
prbs | extracted PRBS (logical) |
function BERT_v1::plot | ( | in | obj, |
in | srx, | ||
in | ErrorMap, | ||
in | i | ||
) |
Main plotting function.
Main plotting function
srx | received data |
ErrorMap | logical array showing error locations |
function BERT_v1::plotErrors | ( | in | obj, |
in | ErrorMap, | ||
in | i | ||
) |
Plot errorgram.
Plot error locations
ErrorMap | error locations |
i | Column number |
function BERT_v1::plotHistogram | ( | in | obj, |
in | srx, | ||
in | jj | ||
) |
Histogram plotting function.
Histogram plotting function for PAM/ASK signals
srx | received data |
g | received data |
c | received data |
function BERT_v1::plotResults | ( | in | obj, |
in | pos, | ||
in | res | ||
) |
Result plotting function.
Prints results into table in figure
pos | position |
res | results to print |
|
static |
Quick and dirty phase offset estimate.
Quick and dirty phase offset estimate
srx | input data |
M | constellation order (M-QAM) |
phi | estimated 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).
res | results 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
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.
obj.results.ber | BER for the whole signal |
obj.results.ser | SER for the whole signal |
obj.results.ColN.ber | BER for column N |
obj.results.ColN.ser | SER for column N |
obj.results.ColN.badblocks | map of rejected block locations |
|
static |
K-means based demodulation.
K-means based demodulation
srx | input data |
M | constellation order (M-QAM) |
Coding | coding type {'bin', 'gray'} |
out | received symbols |
c | cluster centroids |
|
static |
Skips symbols at beginning and/or end.
Skips symbols at beginning and/or end of sequence
margin | how much of sequence to skip |
in | input data |
symbols | estimated 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.
sig | input signal |
refSig | reference PRBS |
|
static |
Gets PRBS from signal.
Gets a signal and outputs a clean PRBS for comparison
in | input data |
out | estimated PRBS |