GNU Radio Manual and C++ API Reference  3.7.13.4
The Free & Open Software Radio Ecosystem
gr::random Class Reference

pseudo random number generator More...

#include <gnuradio/random.h>

Public Member Functions

 random (unsigned int seed=0, int min_integer=0, int max_integer=2)
 
 ~random ()
 
void reseed (unsigned int seed)
 Change the seed for the initialized number generator. seed = 0 initializes the random number generator with the system time. Note that a fast initialization of various instances can result in the same seed. More...
 
void set_integer_limits (const int minimum, const int maximum)
 
int ran_int ()
 
float ran1 ()
 Uniform random numbers in the range [0.0, 1.0) More...
 
float gasdev ()
 Normally distributed random numbers (Gaussian distribution with zero mean and variance 1) More...
 
float laplacian ()
 Laplacian distributed random numbers with zero mean and variance 1. More...
 
float rayleigh ()
 Rayleigh distributed random numbers (zero mean and variance 1 for the underlying Gaussian distributions) More...
 
float impulse (float factor)
 FIXME: add description. More...
 
gr_complex rayleigh_complex ()
 Normally distributed random numbers with zero mean and variance 1 on real and imaginary part. This results in a Rayleigh distribution for the amplitude and an uniform distribution for the phase. More...
 

Protected Attributes

long d_seed
 
bool d_gauss_stored
 
float d_gauss_value
 
boost::mt19937 * d_rng
 
boost::uniform_real< float > * d_uniform
 
boost::uniform_int * d_integer_dis
 
boost::variate_generator< boost::mt19937 &, boost::uniform_real< float > > * d_generator
 
boost::variate_generator< boost::mt19937 &, boost::uniform_int<> > * d_integer_generator
 

Detailed Description

pseudo random number generator

Constructor & Destructor Documentation

gr::random::random ( unsigned int  seed = 0,
int  min_integer = 0,
int  max_integer = 2 
)
gr::random::~random ( )

Member Function Documentation

float gr::random::gasdev ( )

Normally distributed random numbers (Gaussian distribution with zero mean and variance 1)

float gr::random::impulse ( float  factor)

FIXME: add description.

float gr::random::laplacian ( )

Laplacian distributed random numbers with zero mean and variance 1.

float gr::random::ran1 ( )

Uniform random numbers in the range [0.0, 1.0)

int gr::random::ran_int ( )

Uniform random integers in the range set by 'set_integer_limits' [min, max).

float gr::random::rayleigh ( )

Rayleigh distributed random numbers (zero mean and variance 1 for the underlying Gaussian distributions)

gr_complex gr::random::rayleigh_complex ( )

Normally distributed random numbers with zero mean and variance 1 on real and imaginary part. This results in a Rayleigh distribution for the amplitude and an uniform distribution for the phase.

void gr::random::reseed ( unsigned int  seed)

Change the seed for the initialized number generator. seed = 0 initializes the random number generator with the system time. Note that a fast initialization of various instances can result in the same seed.

void gr::random::set_integer_limits ( const int  minimum,
const int  maximum 
)

set minimum and maximum for integer random number generator. Limits are [minimum, maximum) Default: [0, std::numeric_limits< IntType >::max)]

Member Data Documentation

bool gr::random::d_gauss_stored
protected
float gr::random::d_gauss_value
protected
boost::variate_generator<boost::mt19937&, boost::uniform_real<float> >* gr::random::d_generator
protected
boost::uniform_int* gr::random::d_integer_dis
protected
boost::variate_generator<boost::mt19937&, boost::uniform_int<> >* gr::random::d_integer_generator
protected
boost::mt19937* gr::random::d_rng
protected
long gr::random::d_seed
protected
boost::uniform_real<float>* gr::random::d_uniform
protected

The documentation for this class was generated from the following file: