Table Of Contents

Mathematical Morphological Filter (G Dataflow)

Last Modified: December 18, 2017

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

connector_pane_image
datatype_icon

extension type

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

The following illustration represents the output sequence when extension type is Zero padding.

Where X is the input signal, and k is the length of structure element.

Filtering a Signal with the Symmetric Method

The following illustration represents the output sequence when extension type is Symmetric.

Where X is the input signal, and k is the length of structure element.

If k > n, this node pads X with k - n zeros at both ends of the new sequence, where n is the length of X.

Filtering a Signal with the Periodic Method

The following illustration represents the output sequence when extension type is Periodic.

Where X is the input signal, and k is the length of structure element.

If k > n, this node periodically repeats X more than once at both ends of the sequence.

Default: Zero padding

datatype_icon

signal

Input signal.

This input accepts the following data types:

  • 1D array of double-precision, floating-point numbers
  • Waveform
  • 1D array of waveforms
datatype_icon

structure element

Structure element to use in the filtering process.

datatype_icon

operation type

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 ( i ) = max { x ( i j ) + s ( j ) } , 0 i n 1 , 0 j k 1

where x(i) is the ith element in the input signal and s(j) is the jth 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 ( i ) = min { x ( i + j ) s ( j ) } , 0 i n 1 , 0 j k 1

where x(i) is the ith element in the input signal and s(j) is the jth 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

datatype_icon

zero phase?

A Boolean that specifies whether to perform zero-phase filtering of the signal.

True Performs zero-phase filtering of the signal.
False Does not perform zero-phase filtering of the signal.

Default: True

datatype_icon

error in

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.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

filtered signal

Filtered signal.

This output can return the following data types:

  • 1D array of double-precision, floating-point numbers
  • Waveform
  • 1D array of waveforms
datatype_icon

error out

Error information.

The node produces this output 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.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics