Documentation 
On this page… 

Frequency response estimation uses sinestream or chirp input signals.
Sinusoidal Signal  When to Use 

Sinestream  Recommended for most situations. Especially useful when:

Chirp 

A sinestream signal consists of several adjacent sine waves of varying frequencies. Each frequency excites the system for a period of time.
This example shows how to create a sinestream input signal based upon a linearized model using the Linear Analysis Tool.
Obtain a linearized model, linsys1.
For example, see Linearize Simulink Model at Model Operating Point, which shows how to linearize a model.
In the Linear Analysis Tool, click the Frequency Response Estimation tab. In the Input Signal list, select Sinestream.
The Create sinestream input dialog box opens.
In the System list, select linsys1. Click Initialize frequencies and parameters.
This action adds frequency points to the Frequency content viewer.
The software automatically selects frequency points based on the dynamics of linsys1. The software also automatically determines other parameters of the sinestream signal, including:
amplitude
number of periods
settling periods
ramp periods
number of samples at each period
Click OK to create the sinestream input signal. A new input signal, in_sine1, appears in the Linear Analysis Workspace.
You can create a sinestream signal from both continuoustime and discretetime signals in Simulink^{®} models using the following commands:
Signal at Input Linearization Point  Command 

Continuous  frest.Sinestream 
Discrete  frest.createFixedTsSinestream 
Create a sinestream signal in the most efficient way using a linear model that accurately represents your system dynamics:
input = frest.Sinestream(sys)
sys is the linear model you obtained using exact linearization.
You can also define a linear system based on your insight about the system using the tf, zpk, and ss commands.
For example, create a sinestream signal from a linearized model:
magball io(1) = linio('magball/Desired Height',1); io(2) = linio('magball/Magnetic Ball Plant',... 1,'output'); sys = linearize('magball',io); input = frest.Sinestream(sys)
The resulting input signal stores the frequency values as Frequency. frest.Sinestream automatically specifies NumPeriods and SettlingPeriods for each frequency:
Frequency : [0.05786;0.092031;0.14638 ...] (rad/s) Amplitude : 1e005 SamplesPerPeriod : 40 NumPeriods : [4;4;4;4 ...] RampPeriods : 0 FreqUnits (rad/s,Hz): rad/s SettlingPeriods : [1;1;1;1 ...] ApplyFilteringInFRESTIMATE (on/off) : on SimulationOrder (Sequential/OneAtATime): Sequential
For more information about sinestream options, see the frest.Sinestream reference page.
You can plot your input signal using plot(input).
The mapping between the parameters of the Create sinestream input dialog box in the Linear Analysis Tool and the options of frest.Sinestream is as follows:
Create sinestream input dialog box  frest.Sinestream option 

Amplitude  'Amplitude' 
Number of periods  'NumPeriods' 
Settling periods  'SettlingPeriods' 
Ramp periods  'RampPeriods' 
Number of samples at each period  'SamplesPerPeriod' 
Frequency response estimation using frestimate performs the following operations on a sinestream input signal:
Injects the sinestream input signal you design, u_{est}(t), at the linearization input point.
Simulates the output at the linearization output point.
frestimate adds the signal you design to existing Simulink signals at the linearization input point.
Discards the SettlingPeriods portion of the output (and the corresponding input) at each frequency.
The simulated output at each frequency has a transient portion and steady state portion. SettlingPeriods corresponds to the transient components of the output and input signals. The periods following SettlingPeriods are considered to be at steady state.
Filters the remaining portion of the output and the corresponding input signals at each input frequency using a bandpass filter.
When a model is not at steady state, the response contains lowfrequency transient behavior. Filtering typically improves the accuracy of your model by removing the effects of frequencies other than the input frequencies. These frequencies are problematic when your sampled data has finite length. These effects are called spectral leakage.
frestimate uses a finite impulse response (FIR) filter. The software sets the filter order to match the number of samples in a period such that any transients associated with filtering appear only in the first period of the filtered steadystate output. After filtering, frestimate discards the first period of the input and output signals.
You can specify to disable filtering during estimation using the signal ApplyFilteringInFRESTIMATE property.
Estimates the frequency response of the processed signal by computing the ratio of the fast Fourier transform of the filtered steadystate portion of the output signal y_{est}(t) and the fast Fourier transform of the filtered input signal u_{est}(t):
$$G(s)\approx \frac{\text{fastFouriertransformof}{y}_{est}(t)}{\text{fastFouriertransform}{u}_{est}(t)}$$
To compute the response at each frequency, frestimate uses only the simulation output at that frequency.
The sweptfrequency cosine (chirp) input signal excites your system at a range of frequencies, such that the input frequency changes instantaneously.
Alternatively, you can use the sinestream signal, which excites the system at each frequency for several periods. See Supported Input Signals for more information about choosing your signal.
This example shows how to create a chirp input signal based upon a linearized model using the Linear Analysis Tool.
Obtain a linearized model, linsys1.
For example, see Linearize Simulink Model at Model Operating Point, which shows how to linearize a model.
In the Linear Analysis Tool, click the Frequency Response Estimation tab. In the Input Signal list, select Chirp.
The Create chirp input dialog box opens.
In the System list, select linsys1 selected. Click Compute parameters.
The software automatically selects frequency points based on the dynamics of linsys1. The software also automatically determines other parameters of the chirp signal, including:
frequency range at which the linear system has interesting dynamics (see the From and To boxes of Frequency Range).
amplitude.
sample time. To avoid aliasing, the Nyquist frequency
of the signal is five times the upper end of the frequency range, $$\frac{2\pi}{5*\mathrm{max}(FreqRange)}$$.
number of samples.
initial phase.
sweep method
sweep shape.
Click OK to create the chirp input signal. A new input signal in_chirp1 appears in the Linear Analysis Workspace.
Create a chirp signal in the most efficient way using a linear model that accurately represents your system dynamics:
input = frest.Chirp(sys)
sys can be the linear model you obtained using exact linearization techniques. You can also define a linear system based on your insight about the system using the tf, zpk, and ss commands.
For example, create a chirp signal from a linearized model:
magball io(1) = linio('magball/Desired Height',1); io(2) = linio('magball/Magnetic Ball Plant',... 1,'output'); sys = linearize('magball',io); input = frest.Chirp(sys)
The input signal is:
FreqRange : [0.0578598408615998 10065.3895573969] (rad/s) Amplitude : 1e005 Ts : 0.00012484733494616 (sec) NumSamples : 1739616 InitialPhase : 270 (deg) FreqUnits (rad/s or Hz): rad/s SweepMethod(linear/ : linear quadratic/ logarithmic)
For more information about chirp signal properties, see the frest.Chirp reference page.
You can plot your input signal using plot(input).
The mapping between the parameters of the Create chirp input dialog box in the Linear Analysis Tool and the options of frest.Chirp is as follows:
Create chirp input dialog box  frest.Chirp option 

Frequency range > From  First element associated with the 'FreqRange' option 
Frequency range > To  Second element associated with the 'FreqRange' option 
Amplitude  'Amplitude' 
Sample time (sec)  'Ts' 
Number of samples  'NumSamples' 
Initial phase (deg)  'InitialPhase' 
Sweep method  'SweepMethod' 
Sweep shape  'Shape' 