Troubleshooting Frequency Response Estimation
When to Troubleshoot
If, after analyzing your frequency response estimation, 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.
Time Response Not at Steady State
This time response has not reached steady state.
This plot shows a steadystate time response.
Because frequency response estimation requires steadystate 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.
Possible Cause  Action 

Model cannot initialize to steady state. 

(Sinestream input) Not enough periods for the output to reach steady state. 

(Chirp input) Signal sweeps through the frequency range too quickly.  Increase the simulation time by increasing NumSamples . See
Modify Estimation Input Signals. 
After you try the suggested actions, recompute the estimation either:
At all frequencies
In a particular frequency range (only for sinestream input signals)
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 Modify Estimation Input Signals.Estimate the frequency response
sysest2
with the modified input signal usingfrestimate
.Merge the original estimated frequency response
sysest
and the recomputed estimated frequency responsesysest2
:
Analyze the recomputed frequency response, as described in Analyze Estimated Frequency Response.
For an example of frequency response estimation with timevarying source blocks, see Effects of TimeVarying Source Blocks on Frequency Response Estimation
FFT Contains Large Harmonics at Frequencies Other than the Input Signal Frequency
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 cause problems when you want to analyze the response of your linear system to small perturbations.
For models operating in the linear range, the input amplitude A_{1} in y(t) must be larger than the amplitudes of other harmonics, A_{2} and A_{3}.
$$\begin{array}{l}u(t)={A}_{1}\mathrm{sin}({\omega}_{1}+{\varphi}_{1})\\ y(t)={A}_{1}\mathrm{sin}({\omega}_{1}+{\varphi}_{1})+{A}_{2}\mathrm{sin}({\omega}_{2}+{\varphi}_{2})+{A}_{3}\mathrm{sin}({\omega}_{3}+{\varphi}_{3})+\mathrm{...}\end{array}$$
Adjust the amplitude of your input signal to decrease the impact of other harmonics, and repeat the estimation. 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:
Time Response Grows Without Bound
When the time response grows without bound, frequency response estimation results are inaccurate. Frequency response estimation is only accurate close to the operating point.
Try the suggested actions listed the table and repeat the estimation.
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 Simulink Model 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 steadystate operating point. See Compute SteadyState Operating Points. 
Stable model captures a growing transient. 
If the model captures a growing transient, increase the number of periods in
the input signal by changing 
Time Response Is Discontinuous or Zero
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.
Increase the amplitude of your input signal, and repeat the estimation.
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:
Time Response Is Noisy
When the time response is noisy, frequency response estimation results may be biased.
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 aSimulink.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 Estimate Frequency Response Models with Noise Using Signal Processing Toolbox and Estimate Frequency Response Models with Noise Using System Identification Toolbox.
For a related example, see Disable Noise Sources During Frequency Response Estimation.
Time Response Shows Harmonics That Do Not Change Smoothly
The estimated frequency response result does not match the linear system bode plot, possibly only over a certain frequency range. When the time responses show magnitudes that do not change smoothly, additional frequency components are affecting the response. These additional frequency components come from the defined input signal.
When the input signal is created using frest.Sinestream
, the default value of SamplesPerPeriod
is 40
. This default setting produces a coarse input signal, which
causes the mismatch in the bode plot.
To create a smoother input signal, increase the value of the
SamplesPerPeriod
setting. For more information about setting
SamplesPerPeriod
, see the following:
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)