## Analyze Estimated Frequency Response

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).

### View Simulation Results

#### View Simulation Results Using **Model Linearizer**

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.

#### View Simulation Results (MATLAB Code)

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)

### Interpret Frequency Response Estimation Results

#### Select Plots Displayed in Diagnostic Viewer

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.

#### Select Plots Displayed in Simulation Results Viewer

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.

#### Frequency Response

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.

#### Time Response (Simulated Output)

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`

.

#### FFT of Time Response

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.

### Analyze Simulated Output and FFT at Specific Frequencies

#### Using the Diagnostic Viewer in **Model Linearizer**

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.

#### Using the Simulation Results 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.

### Annotate Frequency Response Estimation Plots

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

### Displaying Estimation Results for Multiple-Input Multiple-Output (MIMO) Systems

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.

### Result Thinning

When you have an estimated frequency response result with a large number of frequency
points and you are interested in data across a certain frequency range at a specific
resolution, you can use **Result Thinning** in **Model Linearizer**
to extract interpolated frequency response data from an estimated frequency response
`frd`

model across a specified frequency range and number of frequency
points.

To apply thinning to an estimated frequency response result, select the estimated model
in the **Linear Analysis Workspace** or **MATLAB Workspace** pane. Then, on the **Plots and
Results** tab, click **Result Thinning**.

In the Specify frequencies dialog box, specify the frequencies by either
`range`

or `values`

. By default, the dialog lets you
specify logarithmically-spaced or linearly-spaced frequencies by range. To specify
frequencies by values, in the **Specify by** list, select
`values`

, and then specify a vector of frequency values using the
**Values** parameter. The frequency values must lie between the smallest
and largest frequency points in the model you want to thin.

Click **OK**. The software performs linear interpolation
and returns an `frd`

model containing the interpolated frequency response
data at the specified frequencies.

For an example of thinning a response estimated with PRBS input signal, see Frequency Response Estimation in Model Linearizer Using Pseudorandom Binary Sequence.

## See Also

`frest.simView`

| `frest.simCompare`

| `frestimate`