## Estimate Time-Series Power Spectra

### How to Estimate Time-Series Power Spectra Using the App

You must have already imported your data into the app, as described in Preparing Time-Series Data.

To estimate time series spectral models in the System Identification app:

1. In the System Identification app, select Estimate > Spectral Models to open the Spectral Model dialog box.

2. In the Method list, select the spectral analysis method you want to use. For information about each method, see Selecting the Method for Computing Spectral Models.

3. Specify the frequencies at which to compute the spectral model in either of the following ways:

• In the Frequencies field, enter either a vector of values, a MATLAB® expression that evaluates to a vector, or a variable name of a vector in the MATLAB workspace. For example, `logspace(-1,2,500)`.

• Use the combination of Frequency Spacing and Frequencies to construct the frequency vector of values:

• In the Frequency Spacing list, select `Linear` or `Logarithmic` frequency spacing.

### Note

For `etfe`, only the `Linear` option is available.

• In the Frequencies field, enter the number of frequency points.

For time-domain data, the frequency ranges from 0 to the Nyquist frequency. For frequency-domain data, the frequency ranges from the smallest to the largest frequency in the data set.

4. In the Frequency Resolution field, enter the frequency resolution, as described in Controlling Frequency Resolution of Spectral Models. To use the default value, enter `default` or leave the field empty.

5. In the Model Name field, enter the name of the correlation analysis model. The model name should be unique in the Model Board.

6. Click to add this model to the Model Board in the System Identification app.

7. In the Spectral Model dialog box, click .

8. To view the estimated disturbance spectrum, select the Noise spectrum check box in the System Identification app. For more information about working with this plot, see Noise Spectrum Plots.

To export the model to the MATLAB workspace, drag it to the To Workspace rectangle in the System Identification app. You can view the power spectrum and the confidence intervals of the resulting `idfrd` model object using the `bode` command.

### How to Estimate Time-Series Power Spectra at the Command Line

You can use the `etfe`, `spa`, and `spafdr` commands to estimate power spectra of time series for both time-domain and frequency-domain data. The following table provides a brief description of each command.

You must have already prepared your data, as described in Preparing Time-Series Data.

The resulting models are stored as an `idfrd` model object, which contains `SpectrumData` and its variance. For multiple-output data, `SpectrumData` contains power spectra of each output and the cross-spectra between each output pair.

Estimating Frequency Response of Time Series

CommandDescription
`etfe`

Estimates a periodogram using Fourier analysis.

`spa`

Estimates the power spectrum with its standard deviation using spectral analysis.

`spafdr`

Estimates the power spectrum with its standard deviation using a variable frequency resolution.

For example, suppose `y` is time series data. The following commands estimate the power spectrum `g` and the periodogram `p`, and plot both models with three standard deviation confidence intervals:

```g = spa(y); p = etfe(y); spectrum(g,p); ```

For detailed information about these commands, see the corresponding reference pages.

##### Support 평가판 신청