random_signal_generator
A utility for generating random data signals
Classes | Public Member Functions | Public Attributes | List of all members
pcd::random_signal_generator Class Reference

A class for generating random signals. More...

#include <random_signal_generator.h>

Classes

class  impl
 The private implementation class for the random_signal_generator. More...
 

Public Member Functions

 random_signal_generator (uint32_t n_points, double desired_mean, double desired_standard_deviation)
 Instantiates a new random_signal_generator. More...
 
void generate (std::vector< double > &signal)
 Generates a new randomized signal with the currently set parameters. More...
 

Public Attributes

uint32_t n_points
 The number of points to create for the signal. More...
 
double desired_mean
 The desired mean of the signal. More...
 
double desired_standard_deviation
 The desired standard deviation of the signal. More...
 
uint8_t n_bases
 (OPTIONAL) The number of basis vectors used to create the signal. DEFAULT = 50 More...
 
double max_frequency
 (OPTIONAL) The maximum frequency of the signal's content, in Hz. DEFAULT = 10.0 More...
 
double noise_percentage
 (OPTIONAL) The amount of noise to superimpose on the signal, in percentage of the desired standard deviation. DEFAULT = 0.0 More...
 

Detailed Description

A class for generating random signals.

Constructor & Destructor Documentation

◆ random_signal_generator()

random_signal_generator::random_signal_generator ( uint32_t  n_points,
double  desired_mean,
double  desired_standard_deviation 
)

Instantiates a new random_signal_generator.

Parameters
n_pointsThe number of points desired in the generated signal.
desired_meanThe desired mean value of the generated signal.
desired_standard_deviationThe desired standard deviation of the generated signal.

Member Function Documentation

◆ generate()

void random_signal_generator::generate ( std::vector< double > &  signal)

Generates a new randomized signal with the currently set parameters.

Parameters
signalA vector for storing the generated signal.

Member Data Documentation

◆ desired_mean

double pcd::random_signal_generator::desired_mean

The desired mean of the signal.

This specifies the average amplitude of the generated signal.

◆ desired_standard_deviation

double pcd::random_signal_generator::desired_standard_deviation

The desired standard deviation of the signal.

This specifies the standard deviation of the generated signal's amplitude from desired_mean.

◆ max_frequency

double pcd::random_signal_generator::max_frequency

(OPTIONAL) The maximum frequency of the signal's content, in Hz. DEFAULT = 10.0

This controls the maximum number of peaks/valleys in the signal over the specified number of points.

◆ n_bases

uint8_t pcd::random_signal_generator::n_bases

(OPTIONAL) The number of basis vectors used to create the signal. DEFAULT = 50

This controls the number of random sine waves that are superimposed to create the random signal. More bases increase the complexity of the signal but takes longer to compute.

◆ n_points

uint32_t pcd::random_signal_generator::n_points

The number of points to create for the signal.

This specifies the length of the generated signal as a number of points.

◆ noise_percentage

double pcd::random_signal_generator::noise_percentage

(OPTIONAL) The amount of noise to superimpose on the signal, in percentage of the desired standard deviation. DEFAULT = 0.0

This enables Gaussian (white) noise to be added to the random signal.


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