> 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/rt-lab/simulink-blocks-reference/rt-events-library/rte-filter.md).

# RTE Filter

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-8d3d8a4bccc2a8da2c67f9c8952e73c792e4c11e%2FRTE_filter_block.png?alt=media" alt="" width="101"><figcaption></figcaption></figure>

The **RTE Filter** block, located in the **RT-EVENTS/Math Operations** library, removes pulses (pairs of opposite transitions) from a Boolean input signal that are smaller than a fixed width. The block can remove only high pulses, only low pulses, or both.

{% hint style="danger" %}
The **pulse width limit** must be smaller than the inherited sample time.
{% endhint %}

Generally, the filter block can correctly manage the removal of pulses with a width 10 times smaller than the sample time. When the block is set to remove only high pulses or only low pulses, it must delay the first event if the first event of a pulse occurs in the last T seconds of the calculation step (where T is smaller than the pulse width) and the pulse is larger than the pulse width limit. This occurs because the block cannot predict whether a pulse with a transition so close to the end of the step will be larger or smaller than the pulse width limit.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-386de4e4d3ae34a81821db088eed6cf5bdb9c04e%2FRTE_filter_mask.png?alt=media" alt="" width="317"><figcaption></figcaption></figure>

<table><thead><tr><th width="260.4000244140625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Pulse Type</strong></td><td>Select which pulses to remove from the input signal: high pulses, low pulses, or both.</td></tr><tr><td><strong>Pulse Width Limit</strong></td><td>Minimum pulse width. Pulses below this limit are removed.</td></tr><tr><td><strong>Maximum Number of Events</strong></td><td>Maximum number of events (transitions) allowed during a single step. Events above this number are not output.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="260.4000244140625">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Input (Double)</strong></td><td>RTE Boolean signal to filter.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="261.20001220703125">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Output (Double)</strong></td><td>Filtered RTE Boolean signal.</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic     | Value                         |
| ------------------ | ----------------------------- |
| Direct Feedthrough | Yes                           |
| Sample Time        | Inherited and fixed discrete. |
| Work offline       | Yes                           |
| Dimensionalized    | Yes                           |


---

# 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/rt-lab/simulink-blocks-reference/rt-events-library/rte-filter.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.
