Troubleshooting Frequency Response Estimation
When to Troubleshoot
After you estimate the frequency response, you can analyze
the results. If the frequency response plot does not match
the expected behavior of your system, you can use the time response
and FFT plots to help you improve the results.
If your estimation is slow or you run out of memory during estimation,
see Managing Estimation Speed and Memory.
Back to Top
Time Response Not at Steady State
What Does This Mean?
This time response has not reached steady state.

This plot shows a steady-state time response.

Because frequency response estimation requires steady-state
input and output signals, transients produce inaccurate estimation
results.
For sinestream input signals, transients sometimes interfere
with the estimation either directly or indirectly through spectral
leakage. For chirp input signals, transients interfere with estimation.
How Do I Fix It?
| Possible Cause | Action |
| Model cannot initialize to steady state. | |
| (Sinestream input) Not enough periods for the output to reach
steady state. | Increase the number of periods for frequencies that
do not reach steady state by changing the NumPeriods
and SettlingPeriods. See Modifying Input Signals for Estimation. Check that filtering is enabled during estimation.
You enable filtering by setting the ApplyFilteringInFRESTIMATE option
to on. For information about how estimation uses
filtering, see the frestimate reference
page.
|
| (Chirp input) Signal sweeps through the frequency range too
quickly. | Increase the simulation time by increasing NumSamples.
See Modifying Input Signals for Estimation. |
After you try the suggested actions, recompute the estimation
either:
To recompute the estimation in a particular frequency
range:
Determine the frequencies for which you want to recompute
the estimation results. Then, extract a portion of the sinestream
input signal at these frequencies using fselect.
For example, these commands extract a sinestream input signal
between 10 and 20 rad/s from the input signal input:
input2 = fselect(input,10,20);
Modify the properties of the extracted sinestream
input signal input2, as described in Modifying Input Signals for Estimation.
Estimate the frequency response sysest2 with
the modified input signal using frestimate.
Merge the original estimated frequency response sysest and
the recomputed estimated frequency response sysest2:
Remove data from sysest at the
frequencies in sysest2 using fdel. For example:
sysest = fdel(sysest,input2.Frequency)
Concatenate the original and recomputed responses
using fcat. For example:
sys_combined = fcat(sysest2,sysest)
You can analyze the recomputed frequency response, as
described in Analyzing Estimated Frequency Response.
For an example of frequency response estimation with time-varying
source blocks, see Effects of Time-Varying Source
Blocks on Frequency Response Estimation
Back to Top
FFT Contains Large Harmonics at Frequencies Other than the
Input Signal Frequency
What Does This Mean?
When the FFT plot shows large amplitudes at frequencies other
than the input signal, your model is operating outside the linear
range. This condition can causes problems when you want to analyze
your linear system response to small perturbations.

For models operating in the linear range, the input amplitude A1 in y(t) must
be larger than the amplitudes of other harmonics, A2 and A3.


How Do I Fix It?
Adjust the amplitude of your input signal to decrease the impact
of other harmonics, and repeat the estimation, as described in Estimating Frequency Response. Typically,
you should decrease the input amplitude level to keep the model operating
in the linear range.
For more information about modifying signal amplitudes, see
one of the following:
Back to Top
Time Response Grows Without Bound
What Does This Mean?
When the time response grows without bound, frequency response
estimation results are inaccurate. Frequency response estimation is
only accurate close to the operating point.

How Do I Fix It?
Try the suggested actions listed the table and repeat the estimation,
as described in Estimating Frequency Response.
| Possible Cause | Action |
| Model is unstable. | You cannot estimate the frequency response using frestimate.
Instead, use exact linearization to get a linear representation of
your model. See Linearize at Model Operating Point or
the linearize reference page. |
| Stable model is not at steady state. | Disable all source blocks in your model, and repeat the estimation
using a steady-state operating point. See Steady-State Operating Points (Trimming) from Specifications. |
| Stable model captures a growing transient. | If the model captures a growing transient, increase the
number of periods in the input signal by changing NumPeriods.
Repeat the estimation using a steady-state operating point, as described
in Estimating Frequency Response. |
Back to Top
Time Response Is Discontinuous or Zero
What Does This Mean?
Discontinuities or noise in the time response indicate that
the amplitude of your input signal is too small to overcome the effects
of the discontinuous blocks in your model. Examples of discontinuous
blocks include Quantizer, Backlash,
and Dead Zones.
If you used a sinestream input signal and estimated with filtering,
turn filtering off in the Simulation Results Viewer to see the unfiltered
time response.
The following model with a Quantizer block shows
an example of the impact of an input signal that is too small. When
you estimate this model, the unfiltered simulation output includes
discontinuities.


How Do I Fix It?
Increase the amplitude of your input signal, and repeat the
estimation, as described in Estimating Frequency Response.
With a larger amplitude, the unfiltered simulated output of
the model with a Quantizer block is smooth.

For more information about modifying signal amplitudes, see
one of the following:
Back to Top
Time Response Is Noisy
What Does This Mean?
When the time response is noisy, frequency response estimation
results may be biased.

How Do I Fix It?
frestimate does not
support estimating frequency response estimation of Simulink models
with blocks that model noise. Locate such blocks with frest.findSources and disable them
using the BlocksToHoldConstant option of frestimate.
If you need to estimate a model with noise, use frestimate to simulate an output signal
from your Simulink model for estimation—without modifying
your model. Then, use the Signal Processing Toolbox™ or System Identification Toolbox software
to estimate a model.
To simulate the output of your model in response to a specified
input signal:
Create a random input signal.
For example:
in = frest.Random('Ts',0.001,'NumSamples',1e4);
You can also specify your own custom signal
as a timeseries object.
For example:
t = 0:0.001:10;
y = sin(2*pi*t);
in_ts = timeseries(y,t);
Simulate the model to obtain the
output signal. For example:
[sysest,simout] = frestimate(model,op,io,in_ts)
The second output argument of frestimate, simout,
is a Simulink.Timeseries object that stores the simulated
output. in_ts is the corresponding input data.
Generate timeseries objects
before using with other MathWorks® products:
input = generateTimeseries(in_ts);
output = simout{1}.Data;You can use data from timeseries objects
directly in Signal Processing Toolbox software, or convert these
objects to System Identification Toolbox data format. For examples,
see Estimating Frequency Response Models with Noise Using Signal Processing Toolbox and Estimating Frequency Response Models with Noise Using System Identification Toolbox.
For a related example, see Effects of Noise on Frequency Response Estimation.
Back to Top
 | Analyzing Estimated Frequency Response | | Effects of Time-Varying Source
Blocks on Frequency Response Estimation |  |
Learn more about resources for designing, testing, and implementing control systems.
Get free kit