Last Modified: March 15, 2017

Filters a signal with a specific structure element using a mathematical morphological filter.

Method by which to extend the input signal at both ends of the sequence.

Name | Value | Description |
---|---|---|

Zero padding | 0 | Extends the input signal by padding zeros at both ends of the original signal. |

Symmetric | 1 | Extends the input signal to form a new sequence that is symmetric at both ends of the original signal. |

Periodic | 2 | Extends the input signal to form a new sequence that is periodic at both ends of the original signal. |

Filtering a Signal with the Zero Padding Method

Filtering a Signal with the Symmetric Method

Filtering a Signal with the Periodic Method

**Default: **Zero padding

Structure element to use in the filtering process.

Fundamental operation of the morphological filter.

Name | Value | Description |
---|---|---|

Dilation | 0 | Specifies to perform dilation on the input signal. |

Erosion | 1 | Specifies to perform erosion on the input signal. |

Algorithm and Example for the Dilation Operation

The dilation of a 1D signal *f* is defined as follows:

$D\left(i\right)=\mathrm{max}\left\{x(i-j)+s\left(j\right)\right\},\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\le i\le n-1,\text{\hspace{0.17em}}0\le j\le k-1$

where *x*(*i*) is the *i*-th element in the input signal and *s*(*j*) is the j-th element in **structure element**.

The following image shows an example of the dilation effect. The original signal consists of two pulses with widths of 20, and the **structure element** is an array of ten zeros. The filtered signal expands the pulses in the original signal.

Algorithm and Example for the Erosion Operation

The erosion of a 1D signal *f* is defined as follows:

$E\left(i\right)=\mathrm{min}\left\{x(i+j)-s\left(j\right)\right\},\text{\hspace{0.17em}}\text{\hspace{0.17em}}0\le i\le n-1,\text{\hspace{0.17em}}0\le j\le k-1$

where *x*(*i*) is the *i*-th element in the input signal and *s*(*j*) is the j-th element in **structure element**.

The following image shows an example of the erosion effect. The original signal consists of two pulses with widths of 20, and the **structure element** is an array of ten zeros. The filtered signal shrinks the pulses in the original signal.

**Default: **Dilation

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

Filtered signal.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

You can use mathematical morphological filters to reduce various types of noise in an input signal while preserving the compatibility of those shapes with the size of the structure element.

The following image shows the result of using a mathematical morphological filter to remove the baseline and suppress the noise in an ECG signal.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: This product does not support FPGA devices