> 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/scopeview/use-functions/advanced-functions/advanced-or-siharmo.md).

# Advanced | SIHARMO

## HARMONICS – \[SIHARMO]

Computes the harmonics of a signal.

## CATEGORY

Advanced

![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/EASZKh57qm8hpSTWvbeo/image2018%209%2025_8%209%2028.png)

## DESCRIPTION

The function allows computing the harmonics of a signal using the exact fundamental frequency. This function computes module (amplitude), angle (phase) and the real and imaginary parts of the harmonics.

## RESULT VARIABLES AND PARAMETERS

<table data-header-hidden><thead><tr><th width="172"></th><th></th></tr></thead><tbody><tr><td><strong>Module (m)</strong></td><td>Module (or amplitude) for the symmetric components of a harmonic.</td></tr><tr><td><strong>Phase (a)</strong></td><td>Angle a (or phase) of the symmetric component sequence, between -180 and 180 degrees [°].</td></tr><tr><td><strong>Phase (a0)</strong></td><td>Angle of the symmetric component sequence, found between 0 and 360 degrees [°].</td></tr><tr><td><strong>Real (r)</strong></td><td>Real part r of the required symmetric component sequence (m * cos(a)).</td></tr><tr><td><strong>Imaginary (i)</strong></td><td>Imaginary part i of the required symmetric component sequence (m * sin(a)).</td></tr><tr><td><strong>Signal</strong></td><td>Input signal to perform analysis</td></tr><tr><td><strong>Freq</strong></td><td>Fundamental frequency of the signal in Hertz [Hz], normally computed with the sifreq function.</td></tr><tr><td><strong>Harmonic</strong> <strong>number</strong></td><td>Number of harmonic to compute.<br>- <strong>0:</strong> DC;<br>- <strong>1:</strong> Fundamental;<br>- <strong>2:</strong> 2nd harmonic;<br>- <strong>n:</strong> nth harmonic (max. 30).</td></tr><tr><td><strong>Begin_time</strong></td><td>Time at which the analysis of a signal must start. This time is expressed in milliseconds [ms]. This value must be greater than 0 and lower than the size of the acquisition buffer. The default value is 0.</td></tr><tr><td><strong>End_time</strong></td><td>Time at which the analysis of a signal must end. This time is expressed in milliseconds [ms]. The value of this time must be larger than the specified begin_time and smaller than the duration of the test. Use the “HUGE” value to specify the end of the test. The default value is HUGE.</td></tr><tr><td><strong>Note</strong></td><td>The begin time and end time specified for the calculation of the harmonics must be identical to those used in the sifreq sequences which served to compute the fundamental frequency.</td></tr><tr><td><strong>Factor</strong></td><td>Multiplying factor for the results generated by the function. The default value of the multiplying factor is 1.0 and has no effect on the results. The module is multiplied by the absolute value of thefactor. Hence, the phase is modified if the multiplying factor is negative. In this case, 180 degrees are added to the phase.</td></tr></tbody></table>

## SYNTAX

**\[m, a, a0, r, i]** = siharmo(input, freq,n,begin,end,factor)

## CHARACTERISTICS

Data type support

Double Floating point

## EXAMPLE

In the following example, the harmonics function compute the third harmonic components of a signal. Module and angle are shown.

![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/7W4T3VX9ReH67s9KEd0z/image2018%209%2025_8%2010%200.png)


---

# 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/scopeview/use-functions/advanced-functions/advanced-or-siharmo.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.
