> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/simulation-and-analysis/fft-analyzer.md).

# FFT Analyzer

## Description

The **FFT Analyzer app** allows you to perform Fourier analysis of simulation data and provides access to all the simulation data that are defined as structure-with-time variables in your workspace.

The app displays the spectrum as a bar graph or as a list in percentages relative to a base value or to the DC component of the signal.

The FFT Analyzer specifically works with data from SPS models.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-98a719850d6a91837795aa990edc41fb551f284d%2FFFT_analyser_app_dialogbox.png?alt=media" alt=""><figcaption></figcaption></figure>

## Open the FFT Analyzer App

* powergui Block Parameters dialog box: On the **Apps** tab, click **FFT Analyzer**.
* MATLAB<sup>®</sup> command prompt:

{% code lineNumbers="true" %}

```matlab
powerFFT
```

{% endcode %}

## Parameters

<table data-header-hidden><thead><tr><th width="250.22222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>Structure with time (click to update)</strong> — Refresh simulation data variables<br>button</td><td><p>Refreshes the list of simulation data variables in the <strong>Structure with time</strong> drop-down menu. Refreshing allows you to import additional simulation signals from the workspace without the need to close and reopen the tool.</p><p>If the workspace contains no structure-with-time variables, the drop-down menu shows Empty list.</p></td></tr><tr><td><strong>Structure with time</strong> — List of simulation data variables<br>Empty list (default)</td><td><p>Lists all the simulation data variables that are present in your workspace.</p><p>Use the drop-down list to select the structure-with-time variable that you want to analyze. If the workspace contains no structure-with-time variables, the list shows Empty list. Structure-with-time variables are generated by the Scope and To Workspace blocks in your model.</p></td></tr><tr><td><strong>Signal</strong> — Selected signal<br>no default</td><td><p>Lists the signal of the structure-with-time variable specified in the <strong>Structure with time</strong> drop-down menu.</p><p>Structure-with-time variables that have multiple signals can be generated by a Scope block that has multiple input ports.</p><p>The list shows the name of the signals as they are labeled in your models.</p><p>If a signal is not labeled, such as the third signal of Scope2 in this figure, the list shows unnamed (input 3).<br><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-54b26c2dc2fafbb85e5b1e2fa2462f414e20c7f2%2FFFT_analyser_app_signal.png?alt=media" alt=""></p></td></tr><tr><td><strong>Dimension</strong> — Index of selected signal<br>no default</td><td><p>Indicates the index of the signal specified by the <strong>Signal</strong> parameter.</p><p>For example, the <strong>Dimension</strong> parameter allows you to select the Ib measurement of a three-phase signal connected to the second input of Scope2 block.<br><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-434c5f55e850be6d4bd60bc8960224f7229d7606%2Fimage.png?alt=media" alt=""></p></td></tr><tr><td><strong>Zoom on</strong> — Upper plot zoom<br>Signal (default) | FFT window</td><td><p>Select Signal to display the complete view of the signal selected by the <strong>Structure with time</strong>, <strong>Signal</strong>, and <strong>Dimension</strong> parameters in blue in the upper plot.</p><p>The FFT window that is specified by the <strong>Start time</strong>, <strong>Number of cycles</strong>, and <strong>Fundamental frequency</strong> parameters is displayed in red. Select FFT window to display only the portion of the selected signal where the FFT analysis is performed in the upper plot.</p></td></tr><tr><td><strong>Start time (s)</strong> — Start time of the FFT analysis<br>0 (default) | positive scalar</td><td>Specifies the start times for the FFT analysis. The FFT analysis is performed on the portion of the signal starting at the specified time and for the specified number of cycles.</td></tr><tr><td><strong>Number of cycles</strong> —<br>1 (default) | positive integer</td><td>Specifies the number of cycles of the selected signal to analyze for the FFT analysis.</td></tr><tr><td><strong>Fundamental frequency (Hz)</strong> —<br>60 (default) | positive scalar</td><td>Specifies the fundamental frequency, in Hz, as a reference frequency for the FFT analysis.</td></tr><tr><td><strong>Max frequency (Hz)</strong> —<br>1000 (default) | positive scalar</td><td>Specifies the maximum frequency, in Hz, for the FFT analysis.</td></tr><tr><td><strong>Max frequency for THD computation</strong> —<br>Nyquist frequency (default) | Same as Max frequency</td><td><p>Select Nyquist frequency to compute the THD to the maximum frequency equal to the Nyquist frequency.</p><p>The Nyquist frequency is half the sampling frequency of the selected signal.</p><p>Select Same as Max frequency to compute the THD to the maximum frequency equal to the frequency specified in the <strong>Max frequency (Hz)</strong> parameter.</p><p>The THD calculation includes all the inter harmonics of the selected input signal.</p></td></tr><tr><td><strong>Display style</strong> — Display style for spectrum<br>Bar (relative to fundamental) (default) | Bar (relative to specified base) | Bar (relative to DC component) | List (relative to fundamental) | List (relative to specified base) | List (relative to DC component)</td><td><p>Select Bar (relative to fundamental) to display the spectrum as a bar graph relative to the fundamental frequency.</p><p>Select Bar (relative to specified base) to display the spectrum as a bar graph relative to the base defined by the <strong>Base value</strong> parameter.</p><p>Select Bar (relative to DC component) to display the spectrum as a bar graph relative to the DC component of the signal.</p><p>Select List (relative to fundamental) to display the spectrum as a list in percentages relative to the fundamental or DC component.</p><p>Select List (relative to specified base) to display the spectrum as a list in percentages relative to the base value defined by the <strong>Base value</strong> parameter.</p><p>Select List (relative to DC component) to display the spectrum as a list relative to the DC component of the signal.</p></td></tr><tr><td><strong>Base value</strong> — Harmonics base value<br>1 (default) | positive scalar</td><td>Enter a base value for the display of harmonics.</td></tr><tr><td><strong>Frequency axis</strong> — Frequency axis of FFT spectrum<br>Hertz (default) | Harmonic order</td><td>Select Hertz to display the spectrum frequency axis in hertz. Select Harmonic order to display the spectrum frequency axis in harmonic order relative to the fundamental frequency.</td></tr><tr><td><strong>Compute FFT</strong> —<br>button</td><td>Displays the FFT analysis results for the selected simulation data signal in the <strong>FFT</strong> graph.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/simulation-and-analysis/fft-analyzer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
