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

Quantization of data. More...

#include <QuantizationNoise.h>

Public Types

enum  QuantizationMethod { FLOOR, ROUND }
 The quanitization method. More...
 

Public Member Functions

 QuantizationNoise (double bias=0.0, double quantizationInterval=1.0, QuantizationMethod method=FLOOR)
 Default constructor. More...
 
void noisify (double &value, size_t index=0)
 Applies quantization to a value. More...
 
template<size_t size>
void noisify (Eigen::Matrix< double, size, 1 > &value)
 Applies quantization to a vector. More...
 
void reset ()
 Resets the quantization. More...
 

Detailed Description

Quantization of data.

This class provides basic functionality to simulate quantization of (sensor) data. Data input can be either rounded down or rounded to a given quantization interval. It tracks the rest of the quantization for the subsequent call

Examples:
NoiseTest.cpp.

Member Enumeration Documentation

◆ QuantizationMethod

The quanitization method.

Enumerator
FLOOR 

Enum to round down

ROUND 

Enum to round

Constructor & Destructor Documentation

◆ QuantizationNoise()

ct::core::QuantizationNoise::QuantizationNoise ( double  bias = 0.0,
double  quantizationInterval = 1.0,
QuantizationMethod  method = FLOOR 
)
inline

Default constructor.

Parameters
biasA bias to apply after the quantization (will not be quantized!)
quantizationIntervalThe quantization interval to quantize to
methodThe quantization method

Member Function Documentation

◆ noisify() [1/2]

void ct::core::QuantizationNoise::noisify ( double &  value,
size_t  index = 0 
)
inline

Applies quantization to a value.

This applies quantization to a value and stores the rest. The given index serves to track the rest of the quantization for the next call. The index is not a time index but simply an 'ID'.

Parameters
valueThe value to quantize
indexThe identifier
Examples:
NoiseTest.cpp.

References FLOOR, and ROUND.

Referenced by noisify(), and TEST().

◆ noisify() [2/2]

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

Applies quantization to a vector.

This applies quantization to a vector and stores the rest. It uses the entry in the vector as an identifier to store the rest of the value

Parameters
valueThe value to quantize

References i, and noisify().

◆ reset()

void ct::core::QuantizationNoise::reset ( )
inline

Resets the quantization.

Deletes the quantization rest to reset the quantization


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