> 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/hypersim/library-blocks-reference/control-measurements/fourier-analysis.md).

# Fourier Analysis

## Description

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-0e1bcfdfb009f961f839c0c8a34d12e263901c05%2Fimage%20(918).png?alt=media" alt="" width="210"><figcaption></figcaption></figure>

The **Fourier analysis** block, located in the **Control Measurements** library, performs a Fourier analysis of the input signal over a running window of one cycle at the fundamental frequency. This block can be used to compute the fundamental magnitude and phase of a signal that contains harmonics.

At the start of the simulation, the outputs hold the **Initial magnitude** and **Initial phase** values for one cycle at the specified fundamental frequency.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-b0d07b3ee5fc03ff649c8d453140d4b1bfd08aa5%2Fimage%20(919).png?alt=media" alt=""><figcaption><p>Internal circuit of the block</p></figcaption></figure>

## Mask parameters

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-f74b2af9360757693ee8d5923ace6fef6e7a7c1b%2Fimage%20(920).png?alt=media" alt="" width="440"><figcaption></figcaption></figure>

<table><thead><tr><th width="240.39996337890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Fundamental frequency</strong></td><td>Fundamental frequency used for the Fourier analysis running window (Hz). Variable [0, 1e12]</td></tr><tr><td><strong>Rank of the harmonics</strong></td><td>Harmonic component for Fourier analysis n = [0, 100] :<br>0 analyzes the DC component, 1 analyzes the fundamental, and n analyzes harmonic n.</td></tr><tr><td><strong>Initial magnitude</strong></td><td>Initial value of the magnitude of the output signal for the first simulation cycle MagInit = [0, 1e12].<br>Cannot be modified during the simulation.</td></tr><tr><td><strong>Initial phase</strong></td><td>Initial value of the phase of the output signal for the first simulation cycle (°) PhaseInit = [0, 360]<br>Cannot be modified during the simulation.</td></tr></tbody></table>

## Inputs

| Input | Description   |
| ----- | ------------- |
| **u** | Input signal. |

## Outputs

| Output  | Description                                                              |
| ------- | ------------------------------------------------------------------------ |
| **Mag** | Amplitude of the specified harmonic component (same units as the input). |
| **Pha** | Phase of the specified harmonic component (same units as the input).     |


---

# 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/hypersim/library-blocks-reference/control-measurements/fourier-analysis.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.
