Engee documentation

Random Integer Generator

Generates integers randomly distributed in the specified range.

blockType: RandomIntegerGenerator

Path in the library:

/Communication Systems/Sources/Random Data Sources/Random Integer Generator

Description

Block Random Integer Generator generates uniformly distributed random integers in the range , where set by the Set size parameter. Use this block to generate random binary or integer data.

Ports

Output

Out — random integer output
scalar | vector | matrix

Random integer output returned as a scalar, vector, or matrix. This port has no name in the block. The data type is set using the Output data type parameter.

The number of lines in the output data is equal to the value of the Samples per frame parameter and corresponds to the number of samples in one frame. The number of columns in the output data is equal to the number of elements in the Set size parameter and corresponds to the number of channels.

Data types: Int,Bool

Parameters

Set size — set pass size:q[<br>] 8 (by default) | positive integer | vector-string of positive integers

Set the size, , given as a positive integer or a vector string of positive integers. The block generates integers in the range . The number of elements in Set size corresponds to the number of independent channels output from the block.

  • If Set size is a scalar, then all output random variables are independent and equally distributed.

  • If Set size is a vector, then the length of the vector determines the number of output channels. Channels can have different output ranges.

Source of initial seed — source of the initial pass value:q[<br>] Parameter (by default)

The source of the initial value for the random number generator is in the form:

  • `Parameter' — the block sets the initial number of the random number generator to Initial seed.

Initial seed — initial number of
0 (by default) | non-negative integer

The initial value for the random number generator in the form of a non-negative integer. If the Initial seed parameter is a constant, the resulting sequence is repeatable.

Dependencies

To use this parameter, set the Source of initial seed parameter to Parameter.

Sample time — sampling period
1 (by default) | -1 | positive scalar

The sampling period specified as a positive number. To inherit the sampling period, set this parameter to '-1'.

Samples per frame — samples per output frame
1 (by default) | -1 | positive number

Samples per frame as a positive integer indicating the number of samples per frame in one output channel.

Output data type — output data type
Int (by default) | Bool

The type of output data in the form of Int or `Bool'.

If this parameter is set to Bool, you must set the Set size parameter to 2

Learn more

Timing

The time between output updates is equal to the product of the values of the parameter Samples per frame and Sample time. For example, if Sample time and Samples per frame are 1, the block outputs a sample every second. If you increase Samples per frame to 10, then the block outputs a vector of 10 by 1 every 10 seconds. This ensures that the equivalent output speed is independent of the Samples per frame parameter.