> 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-sigcmp.md).

# Advanced | SIGCMP

## Signal Comparison – \[SIGCMP]

Compare the signal with a defined reference.

## CATEGORY

Advanced

![](https://opal-rt.atlassian.net/wiki/download/thumbnails/1517322362/hyp33.PNG?version=1\&modificationDate=1757702648301\&cacheVersion=1\&api=v2\&width=377\&height=250)

## DESCRIPTION

Compares the Test Signal (Signal A) with Reference Signal (Signal B) by creating an envelope around the reference signal, based on the margin value (Tol), and making sure the Test signal stays in that envelope.

## RESULT VARIABLES AND PARAMETERS

<table data-header-hidden><thead><tr><th width="96.199951171875"></th><th></th></tr></thead><tbody><tr><td><strong>Result</strong></td><td>is a Signal based on Comparison of Reference Signal by considering the Margin</td></tr><tr><td><strong>Signal A</strong></td><td>Test Signal</td></tr><tr><td><strong>Signal B</strong></td><td>Reference Signal</td></tr><tr><td><strong>Tol</strong></td><td>Margin, percentage of the maximum of steady state.<br>example: 0.01 equals to 1%</td></tr></tbody></table>

## SYNTAX

**res** = sigcmp( Signal A, Signal B, Tol)

## EXAMPLE

The following functions are defined in ScopeView in order to demonstrate a usage of Sigcmp:

![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/wlYuc5lPQfCCcMP2oPwx/hyp34.PNG)

Followings are defined functions signal views in ScopeView:

| **y**          | ![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/EtyateSlKL2O879UUJ4f/hyp36.PNG) |
| -------------- | -------------------------------------------------------------------------------------------------- |
| **y2**         | ![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/9bS96Y6ouuXgkplh5eVj/hyp37.PNG) |
| **s (SigCMp)** | ![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/1x6G6Ohoum3mQFkSQmn1/hyp38.PNG) |
| **maxf(s)**    | ![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/RHEXfCLch5e80ssyoBdP/hyp39.PNG) |

and here is the superimposed view of above signals:

![](https://content.gitbook.com/content/fwfLeQP2Iaoefor0ZUNi/blobs/TRtWRiK4MRr25hUBTre9/hyp60.PNG)

The output of **Sigcmp** is a signal, however to use it in conjunction with the python API, one might want to wrap the output signal in the [**Misc. | MAXF**](https://www.opal-rt.com/docs/scopeview/use-functions/miscellaneous-functions/misc.-or-maxf.md). If the MAXF value is zero, it means the signals are considered as equal.


---

# 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-sigcmp.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.
