Random Uniform Source: Difference between revisions
No edit summary |
(Add comparison to Random Source block) |
||
Line 2: | Line 2: | ||
Uniform Random Number Generator | 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 [https://xoroshiro.di.unimi.it/xoroshiro128plus.c xoroshiro128+] algorithm in C++ which [https://prng.di.unimi.it has been shown] to be require much less processing time than the [https://en.wikipedia.org/wiki/Mersenne_Twister 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 == | == Parameters == |
Revision as of 21:29, 12 January 2022
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
Source Files
- C++ files
- TODO
- Header files
- TODO
- Public header files
- TODO
- Block definition
- TODO