bsc

Model a binary symmetric channel

Syntax

ndata = bsc(data,p)
ndata = bsc(data,p,state)
[ndata,err] = bsc(...)

Description

ndata = bsc(data,p) passes the binary input signal data through a binary symmetric channel with error probability p. The channel introduces a bit error with probability p, processing each element of data independently. data must be an array of binary numbers or a Galois array in GF(2). p must be a scalar between 0 and 1.

ndata = bsc(data,p,state) resets the state of the uniform random number generator rand to the integer state.

[ndata,err] = bsc(...) returns an array, err, containing the channel errors.

Examples

To introduce bit errors in the bits in a random matrix with probability 0.15, use the bsc function as below.

z = randint(100,100); % Random matrix
nz = bsc(z,.15); % Binary symmetric channel
[numerrs, pcterrs] = biterr(z,nz) % Number and percentage of errors

The output below is typical. Note that the percentage of bit errors is not exactly 15% in most trials, but it is close to 15% if the size of the matrix z is large.

numerrs =

        1509


pcterrs =

    0.1509

Another example using this function is in Binary Symmetric Channel.

See Also

rand, awgn, Binary Symmetric Channel


© 1994-2005 The MathWorks, Inc.