Bernoulli Binary Generator
Generate Bernoulli-distributed random binary numbers
Libraries:
Communications Toolbox /
Comm Sources /
Random Data Sources
Description
The Bernoulli Binary Generator block generates random binary numbers using a Bernoulli distribution. Use this block to generate random data bits to simulate digital communication systems and obtain performance metrics such as bit error rate. The Bernoulli distribution with parameter p produces zero with probability p and one with probability 1-p. The Bernoulli distribution has mean value 1-p and variance p(1-p). The Probability of zero parameter specifies p and can be any real number in range [0, 1].
The output signal can be a column or row vector, two-dimensional matrix, or scalar. The number of rows in the output signal corresponds to the number of samples in one frame and is set by the Samples per frame parameter. The number of columns in the output signal corresponds to the number of channels and is set by the number of elements in the Probability of zero parameter. For more details, see Sources and Sinks.
Examples
Limitations
To use this block in a For Each Subsystem (Simulink) you must set
Source of initial seed
toAuto
and the model toNormal
orAccelerator
simulation mode. This ensures that each run will generate independent noise samples.
Ports
Output
Parameters
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
More About
Tips
Set Source of initial
seed to Parameter
and make sure that all blocks have
different Initial seed
values when running simulations in parallel using the parsim
(Simulink) function, such as for Monte Carlo simulation runs.
Otherwise, the different workers may generate the same random numbers (leading to misleading results) for these model configurations:
If the model is in rapid accelerator mode.
If this block has Simulate using set to
Code generation
and Source of initial seed set toAuto
.
For more information, see Choosing a Simulation Mode (Simulink).