Generate integers randomly distributed in range [0, M-1]
Random Data Sources sublibrary of Comm Sources
The Random Integer Generator block generates uniformly distributed random integers in the range [0, M-1], where M is the Set size defined in the dialog box.
The Set size can be either a scalar or a row vector. If it is a scalar, then all output random variables are independent and identically distributed (i.i.d.). If the Set size is a vector, then the length of the vector determines the number of output channels. The channels can have differing output ranges.
If the Initial seed parameter is a constant, then the resulting noise is repeatable.
The output signal can be a column or row vector, a two-dimensional matrix, or a scalar. The number of rows in the output signal corresponds to the number of samples in one frame and is determined by the Samples per frame parameter. The number of columns in the output signal corresponds to the number of channels and is determined by the number of elements in the Set size parameter. See Sources and Sinks in Communications System Toolbox™ User's Guide for more details.
The set size determines the range of output values. The block generates integers ranging from 0 to Set size – 1. Specify the set size as a scalar or row vector of positive integers. The number of elements in Set size correspond to the number of independent channels output from the block.
The source of the initial seed for the random number generator.
Specify the source as either
When set to
Auto, the block uses the global
random number stream.
When Source of initial seed is
The initial seed value for the random number generator. Specify
the seed as a nonnegative integer scalar. Initial seed is
available when the Source of initial seed parameter
is set to
The time between each sample of a column of the output signal.
The number of samples per frame in one channel of the output signal. Specify Samples per frame as a positive integer scalar.
Note: The time between output updates is equal to the product of Samples per frame and Sample time. For example, if Sample time and Samples per frame equal one, the block outputs an integer every second. If Samples per frame is increased to 10, then a 10-by-1 vector is output every 10 seconds. This ensures that the equivalent output rate is not dependent on the Samples per frame parameter.
The output type of the block can be specified as a
double. The default is
Single outputs may lead to different results when compared with double
outputs for the same set of parameters. For Boolean typed outputs,
the Set size must be
Select the simulation mode.
On the first model run, simulate and generate code. If the structure of the block does not change, subsequent model runs do not regenerate the code.
If the simulation mode is
System objects corresponding to the blocks accept a maximum of nine
Simulate model without generating code. This option results in faster start times but can slow subsequent simulation performance.
Open the QPSK model. The model generates QPSK data, applies white noise, and displays the resulting constellation diagram.
Run the model.
Change the Eb/No of the AWGN Channel block from 15 dB to 10 dB.
The noise level increases as shown by the greater distance between the samples.