comm.BinarySymmetricChannel System object

Package: comm

Introduce binary errors


The BinarySymmetricChannel object introduces binary errors to the signal transmitted through this channel.

To introduce binary errors into the transmitted signal:

  1. Define and set up your binary symmetric channel object. See Construction.

  2. Call step to introduces binary errors into the signal transmitted through this channel according to the properties of comm.ACPR. The behavior of step is specific to each object in the toolbox.


H = comm.BinarySymmetricChannel creates a binary symmetric channel System object™, H, that introduces binary errors to the input signal with a prescribed probability.

H = comm.BinarySymmetricChannel(Name,Value) creates a binary symmetric channel object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).



Probability of binary error

Specify the probability of a binary error as a scalar with a value between 0 and 1. The default is 0.05.


Enable error vector output

When you set this property to true, the step method outputs an error signal, ERR. This error signal, in vector form, indicates where errors were introduced in the input signal, X. A value of 1 at the i-th element of ERR indicates that an error was introduced at the i-th element of X. Set the property to false if you do not want the ERR vector at the output of the step method. The default is true.


Data type of output

Specify output data type as one of double | logical. The default is double.


cloneCreate binary symmetric channel object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepIntroduce binary errors


expand all

Add binary errors to a binary input signal

Add binary errors with a probability of 0.2 to a binary input signal

    H = comm.BinarySymmetricChannel('ErrorProbability',0.2);
    data = randi([0 1], 10, 1);
    [noisyData, err] = step(H, data);
    [data noisyData err]
ans =

     1     0     1
     1     1     0
     0     0     0
     1     1     0
     1     1     0
     0     1     1
     0     0     0
     1     1     0
     1     1     0
     1     1     0


This object implements the algorithm, inputs, and outputs described on the Binary Symmetric Channel block reference page. The object properties correspond to the block parameters, except:This object uses the MATLAB® default random stream to generate random numbers. The block uses a random number generator based on the V5 RANDN (Ziggurat) algorithm. An initial seed, set with the Initial seed parameter initializes the random number generator. For every system run that contains the block, the block generates the same sequence of random numbers. To generate reproducible numbers using this object, you can reset the MATLAB default random stream using the following code.

For more information, see help for RandStream.

Introduced in R2012a

Was this topic helpful?