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 parameter Set size. Use this block to generate random binary or integer data.

Ports

Output

# OUT_1 — random integers
scalar | vector | the matrix

Details

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

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

Data types

Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, Bool

Complex numbers support

No

Parameters

Parameters

# Set size — set the size
Real number

Details

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

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

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

Default value

8

Program usage name

SetSize

Tunable

No

Evaluatable

Yes

# Source of initial seed — source of the initial value
Parameter

Details

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

  • Parameter — the block sets the initial number of the random number generator in Initial seed.

Values

Parameter

Default value

Parameter

Program usage name

SeedSource

Tunable

No

Evaluatable

No

# Initial seed — initial value
Real number

Details

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

Dependencies

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

Default value

0

Program usage name

Seed

Tunable

No

Evaluatable

Yes

# Sample time — sampling period
SampleTime (real number / vector of two real numbers)

Details

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

Default value

1

Program usage name

SampleTime

Tunable

No

Evaluatable

Yes

# Samples per frame — counts per output frame
Real number

Details

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

Default value

1

Program usage name

SamplesPerFrame

Tunable

No

Evaluatable

Yes

# Output data type — type of output data
Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Bool

Details

The type of output data.

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

Values

Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Bool

Default value

Int64

Program usage name

OutputDataType

Tunable

No

Evaluatable

No

Additional Info

Choosing the time

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