Random input signal
frest.Random object to represent a random input signal
for frequency response estimation. The random signal contains uniformly distributed random
numbers in the interval
[0 Amplitude] or
for positive and negative amplitudes, respectively.
Random signals are useful because they can excite the system uniformly at all frequencies up to the Nyquist frequency.
You can use a random input signal for estimation at the command line, in the Model Linearizer, or with the Frequency Response Estimator block. The estimation algorithm injects the sinestream signal at the input point you specify for estimation, and measures the response at the output point.
When you use a random input signal for estimation, the frequencies returned in the
frd model depend on the length and sampling time of the signal.
They are the frequencies obtained in the fast Fourier transform of the input signal. For more
information, see the Algorithm section of
To view a plot of your input signal, type
plot(input). To create a
timeseries object for your input signal, use the
creates a random signal with properties based on the dynamics of the linear system
input = frest.Random(
sys. For instance, if you have an exact linearization of your
system, you can use it to initialize the parameters.
sys— Linear dynamics system
frest.Random object automatically sets the
following properties 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
NumSamples is set such that the frequency response
estimation includes the lower end of the frequency range.
The remaining properties use default values.
Amplitude— Signal amplitude
1e-5(default) | nonzero scalar
Signal amplitude, specified as a scalar. If
Positive, the random signal values are uniformly distributed in the range
Negative, the random signal values are uniformly distributed in the range
Ts— Sample time
1e-3(default) | positive scalar
Sample time of the random signal in seconds, specified as a positive scalar.
NumSamples— Number of samples
1e4(default) | positive integer
Number of samples in the random signal, specified as a positive integer.
Stream— Random number stream
Random number stream, specified as a
RandStream object. The state of the stream you specify is stored with the
input signal. This stored state allows the software to return the same result every time
the input signal.
Stream is the default stream of the current
|Frequency response estimation of Simulink models|
|Generate time-domain data for input signal|
|Plot time-domain simulation of nonlinear and linear models|
|Plot frequency response model in time- and frequency-domain|
|Final time of simulation for frequency response estimation|
Create a Random input signal with
1000 samples taken at
100 Hz and an amplitude of
input = frest.Random('Amplitude',0.02,... 'Ts',1/100,... 'NumSamples',1000);
Plot the random signal.
Create a multiplicative lagged Fibonacci generator random stream.
stream = RandStream('mlfg6331_64','Seed',0);
Create a random input signal using this stream.
input = frest.Random('Stream',stream);
In the Model Linearizer, to use a random input signal for estimation, on the Estimation tab, select Input Signal > Random.