Random Uniform Source

From GNU Radio
Revision as of 21:29, 12 January 2022 by 172.18.0.3 (talk) (Add comparison to Random Source block)
Jump to navigation Jump to search

Uniform Random Number Generator

Generates a number of samples of random numbers of [min, max) meaning the max value won't be included. Repeat samples if specified. Great for creating bytes of information for a modulator.

Ex: With min=0 and max=2, the sequence 01110101... will be generated.

Supports an output of type int, short, and byte.

This block differs from Random Source in the pseudorandom number generator used. This block implements the xoroshiro128+ algorithm in C++ which has been shown to be require much less processing time than the MT19937 algorithm used by Numpy in Random Source. The disadvantage of the xoroshiro128+ algorithm is it fails the Hamming-weight dependencies test after 5TB of generated values and thus is unsuitable for generating many random values if "optimal pseudo-randomness" is required.

TL;DR: This block operates faster than Random Source but uses a less "pseudorandom" algorithm.

Parameters

minimum
defines minimal integer value output.
maximum
output values are below this value
seed
for Pseudo Random Number Generator. Defaults to 0. In this case current time is used.

Example Flowgraph

Random-uniform-source-ex.png

Source Files

C++ files
TODO
Header files
TODO
Public header files
TODO
Block definition
TODO