Main Content

When you perform frequency response estimation, you can analyze the result by examining
the raw simulated response and the FFT used to convert it to an estimated frequency response.
To do so, use the Diagnostic viewer (in **Model Linearizer**) or the Simulation Results
Viewer (at the MATLAB^{®} command line).

Use the Diagnostic Viewer to analyze the results of your frequency response
estimation, obtained by performing the steps in Estimate Frequency Response Using Model Linearizer, with the extra step
of activating the Diagnostic Viewer before performing estimation. To do so, in the
**Estimation** tab, select **Diagnostic Viewer**.

Then, perform the estimation. The Diagnostic Viewer appears in the plot pane.

To open the Diagnostic Viewer to view a previously estimated model in the **Model
Linearizer**:

In the

**Linear Analysis Workspace**, select the estimated model.In the

**Plots and Results**tab, click**Diagnostic Viewer**.**Note**This option is only available for models that have been previously estimated with the

**Diagnostic Viewer**check box selected.

Use the Simulation Results Viewer to analyze the results of your frequency response
estimation, obtained by performing the steps in Estimate Frequency Response at the Command Line. Make sure you keep the `simout`

output argument of
`frestimate`

.

To open the Simulation Results Viewer using the `frest.simView`

command using the simulated output `simout`

,
the input signal `input`

is that you used for estimation, and the
estimated frequency response you obtained, `sysest`

.

frest.simView(simout,input,sysest)

By default, the Diagnostic Viewer shows these plots:

Frequency Response

Time Response (Simulated Output)

FFT of Time Response

To select the plots displayed in the Diagnostic Viewer using the **Model
Linearizer**:

If the

**Diagnostic Viewer**tab is not visible, in the**Plots and Results**tab, select the**Diagnostic Viewer**plot.In the

**Diagnostic Viewer**tab, in the**Plot Visibilities**section, select the plots that you want to view.

To modify plot settings, such as axis frequency units, right-click on a plot, and select the corresponding option.

By default, the Simulation Results Viewer shows these plots:

Frequency Response

Time Response (Simulated Output)

FFT of Time Response

To select the plots displayed in the Simulation Results Viewer, choose the
corresponding plot from the **Edit** > **Plots** menu. To modify plot settings, such as axis frequency units, right-click a
plot, and select the corresponding option.

Use the Bode plot to analyze the frequency response. If the frequency response does not match the dynamics of your system, see Troubleshooting Frequency Response Estimation for information about possible causes and solutions. While troubleshooting, you can use the Bode plot controls to view the time response at the problematic frequencies.

You can usually improve estimation results by either modifying your input signal or disabling the model blocks that drive your system away from the operating point, and repeating the estimation.

Use this plot to check whether the simulated output is at steady state at specific frequencies. If the response has not reached steady state, see Time Response Not at Steady State for possible causes and solutions.

If you used the sinestream input for estimation, check both the filtered and the
unfiltered time response. You can toggle the display of filtered and unfiltered output by
right-clicking the plot and selecting **Show filtered steady state output
only**. If both the filtered and unfiltered response appear at steady state,
then your model must be at steady state. You can explore other possible causes in Troubleshooting Frequency Response Estimation.

**Note**

If you used the sinestream input for estimation, toggling the filtered and
unfiltered display only updates the Time Response and FFT plots. This selection does not
change the estimation results. For more information about filtering during estimation,
see the Algorithms section of `frestimate`

.

Use this plot to analyze the spectrum of the simulated output.

For example, you can use the spectrum to identify strong nonlinearities. When the FFT plot shows large amplitudes at frequencies other than the input signal, your model is operating outside of linear range. If you are interested in analyzing the linear response of your system for small perturbations, explore possible solutions in FFT Contains Large Harmonics at Frequencies Other than the Input Signal Frequency.

Use the controls in the **Diagnostic Viewer** tab of the **Model
Linearizer** to analyze the estimation results at specific frequencies.

If the

**Diagnostic Viewer**tab is not visible, in the**Plots and Results**tab, select the**Diagnostic Viewer**plot.In the

**Diagnostic Viewer**tab, in the**Frequency Selector**section, specify the frequency range that you want to inspect. Use the frequency units used in the Bode plot in the Diagnostic Viewer.

In the Simulation Results Viewer, use the Bode controls to display the simulated output and its spectrum at specific frequencies.

Drag the arrows individually to display the time response and FFT at specific frequencies.

Drag the shaded region to shift the time response and FFT to a different frequency range.

You can display a data tip on the Time Response, FFT, and Bode plots in the Simulation Results Viewer by clicking the corresponding curve. Dragging the data tip updates the information.

Data tips are useful for correcting poor estimation results at a specific sinestream frequency, which requires you to modify the input at a specific frequency. You can use the data tip to identify the frequency index where the response does not match your system.

In the previous figure, the Time Response data tip shows that the frequency index is 11.
You can use this frequency index to modify the corresponding portion of the input signal.
For example, to modify the `NumPeriods`

and
`SettlingPeriods`

properties of the sinestream signal, using MATLAB code:

input.NumPeriods(11) = 80; input.SettlingPeriods(11) = 75;

To modify the sinestream in the **Model Linearizer**, see Modify Sinestream Signal Using Model Linearizer

For MIMO systems, view frequency response information for specific input and output channels:

In both the Diagnostic Viewer and Simulation Results Viewer, right-click any plot, and select

**I/O Selector**.Choose the input channel in the

**From**list and the output channel in the**To**list.

`frest.simCompare`

| `frest.simView`

| `frestimate`