UniformRandom

UniformRandom#

class UniformRandom(options)#

Bases: RandomWaveform

UniformRandom generates uniform random waveform signals.

Creates random signals with values uniformly distributed between specified lower and upper bounds. Uses MATLAB’s rand() function for pseudo-random number generation. Inherits from RandomWaveform.

Example1:

% Create uniform random between 0 and 1
uniform = UniformRandom(duration = 0.01);
uniform.plot();

Example2:

% Create uniform random between -2 and 2
uniform = UniformRandom(lowerBound = -2, upperBound = 2, duration = 0.01);
uniform.plot();
Constructor Summary
UniformRandom(options)#

Construct a UniformRandom object.

Parameters:
  • samplingRate (double, optional) – Sampling rate in Hz (default: [])

  • startTime (double, optional) – Start time in seconds (default: 0)

  • duration (double, optional) – Duration in seconds (default: [])

  • lowerBound (double, optional) – Lower bound of uniform distribution (default: 0)

  • upperBound (double, optional) – Upper bound of uniform distribution (default: 1)

Property Summary
LowerBound double = 0#

Lower bound of the uniform distribution.

UpperBound double = 1#

Upper bound of the uniform distribution.

Method Summary
TimeFunc()#

Get the time function for the uniform random waveform.

Creates a function handle that generates uniform random values between the configured lower and upper bounds. Implements the abstract TimeFunc() method from Waveform.

Returns:

Function that takes time array and returns uniform random values

Return type:

function_handle