Main Content


System object: comm.ErrorRate
Package: comm

Compute bit or symbol error rate of input data


Y = step(H,TX,RX)
Y = step(H,TX,RX,SEL)
Y = step(H,TX,RX,RST)



Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Y = step(H,TX,RX) counts the number of differences between the transmitted data vector, TX, and received data vector, RX. The step method outputs a three-element vector consisting of the error rate, followed by the number of errors detected and the total number of samples compared. TX and RX inputs can be either scalars or column vectors of the same data type. Valid data types are single, double, integer or logical. If TX is a scalar and RX is a vector, or vice-versa, then the block compares the scalar with each element of the vector.

Y = step(H,TX,RX,SEL) calculates the errors based on selected samples from the input frame specified by the SEL input. SEL must be a real, double-precision integer-valued scalar or a column vector. The vector lists the indices of the elements of the RX input vector that the object should consider when making comparisons. This syntax applies when you set the Samples property to 'Input Port'.

Y = step(H,TX,RX,RST) resets the error count whenever the input RST is non-zero. RST must be a real, double, or logical scalar. When you set the RST input to a nonzero value, the object clears its error statistics and then recomputes them based on the current TX and RX inputs. This syntax applies when you set the ResetInputPort property to true. You can combine optional input arguments when their enabling properties are set. Optional inputs must be listed in the same order as the order of the enabling properties.


obj specifies the System object on which to run this step method.

The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications. For more information on changing property values, see System Design in MATLAB Using System Objects.