Communications Blockset | ![]() ![]() |
Random Data Sources
Blocks in the Data Sources sublibrary of the Comm Sources library generate random data to simulate signal sources. You can use blocks in the Data Sources sublibrary to generate
In addition, you can use built-in Simulink blocks such as the Random Number block as a data source.
You can open the Data Sources sublibrary by double-clicking its icon in the main Communications Blockset library (commlib
), or by typing
Random Bits
The Bernoulli Binary Generator and Binary Error Pattern Generator blocks both generate random bits, but differ in the way that you specify the distribution of 1s. As a result, the Bernoulli Binary Generator block is suitable for representing sources, while the Binary Error Pattern Generator block is more appropriate for modeling channel errors.
The Bernoulli Binary Generator block considers each element of the signal to be an independent Bernoulli random variable. Also, different elements need not be identically distributed.
The Binary Error Pattern Generator block constructs a random binary signal using a two-stage process. First, using information that you provide in the block mask, it determines how many 1s will appear. Then it determines where to place the required number of 1s, so that each possible arrangement has equal probability.
For example, if you set the Binary vector length parameter to 4
, set the Probabilities parameter to 1
, and clear the Frame-based outputs check box, then the block generates binary vectors of length 4, each of which contains exactly one 1. You might use these parameters to perturb a binary code that consists of 4-bit codewords. Adding the random vector to your code vector (modulo 2) would introduce exactly one error into each codeword. Alternatively, to perturb each codeword by introducing one error with probability 0.4 and two errors with probability 0.6, set the Probabilities parameter to [0.4, 0.6]
instead of 1
.
Note that the Probabilities parameter of t
he Binary Error Pattern Generator block affects only the number of 1s in each vector, not their placement.
Random Integers
The Random Integer Generator and Poisson Integer Generator blocks both generate vectors containing random nonnegative integers. The Random Integer Generator block uses a uniform distribution on a bounded range that you specify in the block mask. The Poisson Integer Generator block uses a Poisson distribution to determine its output. In particular, the output can include any nonnegative integer.
![]() | Controlled Sources | Random Noise Generators | ![]() |