Communications Blockset    
Binary Vector Noise Generator

Generate a binary vector while controlling the number of 1s

Library

Comm Sources

Description


The Binary Vector Noise Generator outputs a random binary vector whose length is the Binary vector length parameter. The Probabilities parameter helps determine how many 1s appear in each output vector. Once the number of 1s is determined, their placement is determined according to a uniform distribution.

If p1, p2,...pm are the entries in the Probabilities parameter, then p1 is the probability that the output vector will have a single 1, p2 is the probability that the output vector will have exactly two 1s, and so on. Note that Probabilities must have sum less than or equal to one, and length less than or equal to the Binary vector length. Also, the probability of a zero vector is one minus the sum of Probabilities.

This block is useful in testing error-control coding algorithms.

Attributes of Output Signal

The output signal can be a frame-based matrix, a sample-based row or column vector, or a sample-based one-dimensional array. These attributes are controlled by the Frame-based outputs, Samples per frame, and Interpret vector parameters as 1-D parameters. See Signal Attribute Parameters for Random Sources for more details.

The Binary vector length parameter becomes the number of columns in a frame-based output or the number of elements in a sample-based vector output. Also, the shape (row or column) of the Probabilities parameter becomes the shape of a sample-based two-dimensional output signal.

Dialog Box

Binary vector length
The output vector length.
Probabilities
A vector whose kth entry indicates the probability that the output vector has exactly k 1s.
Initial seed
The initial seed value for the random number generator. This must be a
Sample time
The period of each sample-based vector or each row of a frame-based matrix.
Frame-based outputs
Determines whether the output is frame-based or sample-based. This box is active only if Interpret vector parameters as 1-D is unchecked.
Samples per frame
The number of samples in each column of a frame-based output signal. This field is active only if Frame-based outputs is checked.
Interpret vector parameters as 1-D
If this box is checked, then the output is a one-dimensional signal. Otherwise, the output is a two-dimensional signal. This box is active only if Frame-based outputs is unchecked.

See Also

Bernoulli Random Binary Generator; randerr (Communications Toolbox)


 Binary Symmetric Channel Bit to Integer Converter