Products & Services Solutions Academia Support User Community Company

Learn more about System Identification Toolbox   

Frequency Response Plots

What Is Frequency Response?

Frequency response plots show the complex values of a transfer function as a function of frequency.

In the case of linear dynamic systems, the transfer function G is essentially an operator that takes the input u of a linear system to the output y:

For a continuous-time system, the transfer function relates the Laplace transforms of the input U(s) and output Y(s):

In this case, the frequency function G(iw) is the transfer function evaluated on the imaginary axis s=iw.

For a discrete-time system sampled with a time interval T, the transfer function relates the Z-transforms of the input U(z) and output Y(z):

In this case, the frequency function G(eiwT) is the transfer function G(z) evaluated on the unit circle. The argument of the frequency function G(eiwT) is scaled by the sampling interval T to make the frequency function periodic with the sampling frequency .

How Frequency Response Helps to Validate Models

You can plot the frequency response of a model to gain insight into the characteristics of linear model dynamics, including the frequency of the peak response and stability margins. Frequency-response plots are available for all linear parametric models and spectral analysis (nonparametric) models.

The frequency response of a linear dynamic model describes how the model reacts to sinusoidal inputs. If the input u(t) is a sinusoid of a certain frequency, then the output y(t) is also a sinusoid of the same frequency. However, the magnitude of the response is different from the magnitude of the input signal, and the phase of the response is shifted relative to the input signal.

Frequency response plots provide insight into linear systems dynamics, such as frequency-dependent gains, resonances, and phase shifts. Frequency response plots also contain information about controller requirements and achievable bandwidths. Finally, frequency response plots can also help you validate how well a linear parametric model, such as a linear ARX model or a state-space model, captures the dynamics.

One example of how frequency-response plots help validate other models is that you can estimate a frequency response from the data using spectral analysis (nonparametric model), and then plot the spectral analysis result on top of the frequency response of the parametric models. Because nonparametric and parametric models are derived using different algorithms, agreement between these models increases confidence in the parametric model results.

What Does a Frequency-Response Plot Show?

System Identification Tool GUI supports the following types of frequency-response plots for linear parametric models, linear state-space models, and nonparametric frequency-response models:

The following figure shows a sample Bode plot of the model dynamics, created in the System Identification Tool GUI.

How to Plot Bode Plots Using the GUI

To create a frequency-response plot for parametric linear models in the System Identification Tool GUI, select the Frequency resp check box in the Model Views area. For general information about creating and working with plots, see Working with Plots in the System Identification Tool GUI.

To include or exclude a model on the plot, click the corresponding model icon in the System Identification Tool GUI. Active models display a thick line inside the Model Board icon.

In addition to the frequency-response curve, you can display a confidence interval on the plot. The confidence interval corresponds to the range of response values with a specific probability of being the actual response of the system. The toolbox uses the estimated uncertainty in the model parameters to calculate confidence intervals and assumes the estimates have a Gaussian distribution.

For example, for a 95% confidence interval, the region around the nominal curve represents the range of values that have a 95% probability of being the true system response. You can specify the confidence interval as a probability (between 0 and 1) or as the number of standard deviations of a Gaussian distribution. For example, a probability of 0.99 (99%) corresponds to 2.58 standard deviations.

The following table summarizes the Frequency Function plot settings.

Frequency Function Plot Settings

ActionCommand

Display the confidence interval.

  • To display the dashed lines on either side of the nominal model curve, select Options > Show confidence intervals. Select this option again to hide the confidence intervals.

  • To change the confidence value, select Options > Set % confidence level, and choose a value from the list.

  • To enter your own confidence level, select Options > Set confidence level > Other. Enter the value as a probability (between 0 and 1) or as the number of standard deviations of a Gaussian distribution.

Change the frequency values for computing the noise spectrum.

The default frequency vector is 128 linearly distributed values, greater than zero and less than or equal to the Nyquist frequency.

Select Options > Frequency range and specify a new frequency vector in units of rad/s.

Enter the frequency vector using any one of following methods:

  • MATLAB expression, such as [1:100]*pi/100 or logspace(-3,-1,200). Cannot contain variables in the MATLAB workspace.

  • Row vector of values, such as [1:.1:100]

    Note   To restore the default frequency vector, enter [].

Change frequency units between hertz and radians per second.Select Style > Frequency (Hz) or Style > Frequency (rad/s).
Change frequency scale between linear and logarithmic.Select Style > Linear frequency scale or Style > Log frequency scale.
Change amplitude scale between linear and logarithmic.Select Style > Linear amplitude scale or Style > Log amplitude scale.

(Multiple-output system only)
Select an input-output pair to view the noise spectrum corresponding to those channels.

    Note   You cannot view cross spectra between different outputs.

Select the output by name in the Channel menu.

How to Plot Bode and Nyquist Plots at the Command Line

You can plot Bode and Nyquist plots for linear models using the bode, ffplot, and nyquist commands.

All plot commands have the same basic syntax, as follows:

In this case, command represents any of the plotting commands.

To display confidence intervals for a specified number of standard deviations, use the following syntax:

command(model,'sd',sd)

where sd is the number of standard deviations of a Gaussian distribution. For example, a confidence value of 99% for the nominal model curve corresponds to 2.58 standard deviations.

To display a filled confidence region, use the following syntax:

command(model,'sd',sd,'fill')

The following table summarizes commands that generate Bode and Nyquist plots for linear models. For detailed information about each command and how to specify the frequency values for computing the response, see the corresponding reference page.

CommandDescriptionExample
bode

Plots the magnitude and phase of the frequency response on a logarithmic frequency scale.

To create the bode plot of the model mod, use the following command:

bode(mod)
ffplot

Plots the magnitude and phase of the frequency response on a linear frequency scale (hertz).

To create the bode plot of the model mod, use the following command:

ffplot(mod)
nyquistPlots the imaginary versus real part of the transfer function.

    Note   Does not support time-series models.

To plot the frequency response of the model mod, use the following command:

nyquist(mod)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS