Communications Toolbox    
symerr

Compute number of symbol errors and symbol error rate

Syntax

Description

For All Syntaxes

The symerr function compares binary representations of elements in x with those in y. The schematics below illustrate how the shapes of x and y determine which elements symerr compares.

The output number is a scalar or vector that indicates the number of elements that differ. The size of number is determined by the optional input flg and by the dimensions of x and y. The output ratio equals number divided by the total number of elements in the smaller input.

For Specific Syntaxes

[number,ratio] = symerr(x,y) compares the elements in x and y. The sizes of x and y determine which elements are compared:

[number,ratio] = symerr(x,y,flg) is similar to the previous syntax, except that flg can override the defaults that govern which elements symerr compares and how symerr computes the outputs. The values of flg are 'overall', 'column-wise', and 'row-wise'. The table below describes the differences that result from various combinations of inputs. In all cases, ratio is number divided by the total number of elements in y.

Comparing a Two-Dimensional Matrix x with Another Input y 
Shape of y
flg
Type of Comparison
number
Two-
dimensional matrix
'overall' (default)
Element-by-element
Total number of symbol errors
'column-wise'
mth column of x vs. mth column of y
Row vector whose entries count symbol errors in each column
'row-wise'
mth row of x vs. mth row of y
Column vector whose entries count symbol errors in each row
Column vector
'overall'
y vs. each column of x
Total number of symbol errors
'column-wise' (default)
y vs. each column of x
Row vector whose entries count symbol errors in each column of x
Row vector
'overall'
y vs. each row of x
Total number of symbol errors
'row-wise' (default)
y vs. each row of x
Column vector whose entries count symbol errors in each row of x

[number,ratio,loc] = symerr(...) returns a binary matrix loc that indicates which elements of x and y differ. An element of loc is zero if the corresponding comparison yields no discrepancy, and one otherwise.

Examples

On the reference page for biterr, the last example uses symerr.

The command below illustrates how symerr works when one argument is a vector and the other is a matrix. It compares the vector [1,2,3]' to the columns

of the matrix.

As another example, the command below illustrates the use of flg to override the default row-by-row comparison. Notice that number and ratio are scalars.

See Also
biterr


  shift2mask syndtable