- 3.0.2 core module.
ct::core::GaussianNoise Class Reference

Gaussian noise generator. More...

#include <GaussianNoise.h>

Public Member Functions

 GaussianNoise (double mean=0.0, double standardDeviation=1.0)
 Standard constructor. More...
 
double operator() ()
 Scalar generator. More...
 
template<size_t size>
Eigen::Matrix< double, size, 1 > gen ()
 Vector generator. More...
 
void noisify (double &value)
 adds Gaussian noise to a single scalar variable More...
 
template<size_t size>
void noisify (Eigen::Matrix< double, size, 1 > &value)
 adds Gaussian noise to a vector More...
 

Detailed Description

Gaussian noise generator.

This class generates random Gaussian noise given a mean and a distribution. It can either create a single (pseudo) random variable or an entire vector.

Unit test NoiseTest.cpp illustrates the use of GaussianNoise

Examples:
NoiseTest.cpp.

Constructor & Destructor Documentation

◆ GaussianNoise()

ct::core::GaussianNoise::GaussianNoise ( double  mean = 0.0,
double  standardDeviation = 1.0 
)
inline

Standard constructor.

Parameters
meanthe mean of the Gaussian distribution
standardDeviationthe standard deviation of the distribution

Member Function Documentation

◆ operator()()

double ct::core::GaussianNoise::operator() ( )
inline

Scalar generator.

generates a single scalar random variable

Returns
random variable

Referenced by noisify().

◆ gen()

template<size_t size>
Eigen::Matrix<double, size, 1> ct::core::GaussianNoise::gen ( )
inline

Vector generator.

All entries in the vector are separately generated random variables

Returns
vector of random variables

References i.

◆ noisify() [1/2]

void ct::core::GaussianNoise::noisify ( double &  value)
inline

adds Gaussian noise to a single scalar variable

References operator()().

◆ noisify() [2/2]

template<size_t size>
void ct::core::GaussianNoise::noisify ( Eigen::Matrix< double, size, 1 > &  value)
inline

adds Gaussian noise to a vector

Different random variables are used to perturb each entry of the vector

Parameters
valuethe vector to perturb

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