Documentation Center

  • Trial Software
  • Product Updates

Contents

frest.Random

Package: frest

Random input signal for simulation

Syntax

input = frest.Random('OptionName',OptionValue)
input = frest.Random(sys)

Description

input = frest.Random('OptionName',OptionValue) creates the Random input signal using the options specified by comma-separated name/value pairs.

input = frest.Random(sys) creates a Random input signal based on the dynamics of a linear system sys.

To view a plot of your input signal, type plot(input). To obtain a timeseries for your input signal, use the generateTimeseries command.

Input Arguments

sys

Linear system for creating a random signal based on the dynamic characteristics of this system. You can specify the linear system based on known dynamics using tf, zpk, or ss. You can also obtain the linear system by linearizing a nonlinear system.

The resulting random signal automatically sets these options based on the linear system:

  • Ts is set such that the Nyquist frequency of the signal is five times the upper end of the frequency range to avoid aliasing issues.

  • NumSamples is set such that the frequency response estimation includes the lower end of the frequency range.

Other random options have default values.

'OptionName',OptionValue

Signal characteristics, specified as comma-separated pairs of option name string and the option value.

Option NameOption Value
'Amplitude'Signal amplitude.

Default: 1e-5
'Ts'Sample time of the chirp signal in seconds.

Default: 1e-3
'NumSamples'Number of samples in the Random signal.

Default: 1e4
'Stream'Random number stream you create using the MATLAB® command RandStream. The state of the stream you specify stores with the input signal. This stored state allows the software to return the same result every time you use generateTimeseries and frestimate with the input signal.

Default: Default stream of the MATLAB session

Examples

Create a Random input signal with 1000 samples taken at 100 Hz and amplitude of 0.02:

input = frest.Random('Amplitude',0.02,'Ts',1/100,'NumSamples',1000);
 

Create a Random input signal using multiplicative lagged Fibonacci generator random stream:

% Specify the random number stream
stream = RandStream('mlfg6331_64','Seed',0);

% Create the input signal
input = frest.Random('Stream',stream);

See Also

| | | |

Was this topic helpful?