Documentation

comm.BinarySymmetricChannel System object

Introduce binary errors

Description

TheBinarySymmetricChannelobject 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. SeeConstruction.

  2. Callstepto introduces binary errors into the signal transmitted through this channel according to the properties ofcomm.ACPR. The behavior ofstepis specific to each object in the toolbox.

Note

Starting in R2016b, instead of using thestep执行操作系统定义的方法tem object™, you can call the object with arguments, as if it were a function. For example,y = step(obj,x)andy = obj(x)perform equivalent operations.

Construction

H = comm.BinarySymmetricChannelcreates 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).

Properties

ErrorProbability

Probability of binary error

Specify the probability of a binary error as a scalar with a value between0and1. The default is0.05.

ErrorVectorOutputPort

Enable error vector output

When you set this property totrue,stepmethod outputs an error signal,ERR. This error signal, in vector form, indicates where errors were introduced in the input signal,X. A value of1at thei-th element ofERRindicates that an error was introduced at thei-th element ofX. Set the property tofalseif you do not want theERRvector at the output of thestepmethod. The default istrue.

OutputDataType

Data type of output

Specify output data type as one ofdouble|logical. The default isdouble.

Methods

step Introduce binary errors
Common to All System Objects
release

Allow System object property value changes

Examples

expand all

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

binSymChan = comm.BinarySymmetricChannel(“ErrorProbability',0.2); data = randi([0 1],1000,1); [~,err] = binSymChan(data);

Confirm that the number errors is approximately equal to the 0.2 multiplied by the number of symbols.

[sum(err) 0.2*length(data)]
ans =1×2188 200

Algorithms

This object implements the algorithm, inputs, and outputs described on theBinary Symmetric Channelblock 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最初的种子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.

reset(RandStream.getGlobalStream)
For more information, see help forRandStream.

Extended Capabilities

See Also

Introduced in R2012a

Was this topic helpful?