Last Modified: June 25, 2019

Analyzes an input sequence for valid peaks and tracks the number of peaks encountered and a record of indices, which locates the points that exceed the threshold in a valid peak.

The level that all valid peaks must equal or exceed for the duration of the minimum width.

This input accepts a double-precision, floating-point number or a 1D array of double-precision, floating-point numbers. This input accepts a 1D array of double-precision, floating-point numbers when **signal** is a 1D array of waveforms or a 2D array of double-precision, floating-point numbers.

**Default: **0

The minimum width, in number of samples, that the input sequence must remain at or above the threshold for the candidate peak to be considered a valid peak. This input must be greater than zero. If this input is less than or equal to zero, this node sets the number of valid peaks to zero and returns an error.

This input accepts a 32-bit signed integer or a 1D array of 32-bit signed integers. This input accepts a 1D array of 32-bit signed integers when **signal** is a 1D array of waveforms or a 2D array of double-precision, floating-point numbers.

**Default: **1

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

Sample period of the time-domain signal in seconds.

Set this input to 1/*fs*, where *fs* is the sampling frequency of the time-domain signal.

This input is available only if you wire a 1D array of double-precision, floating-point numbers or a 2D array of double-precision, floating-point numbers to **signal**.

**Default: **1

The mode in which to retrieve the peak location.

This input accepts a ring or a 1D array of rings. This input accepts a 1D array of rings when **signal** is a 1D array of waveforms or a 2D array of double-precision, floating-point numbers.

This input is available only if you wire one of the following data types to **signal**:

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

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

Index | 0 | Retrieves the peak locations as array indexes. |

Time | 1 | Retrieves the peak locations as time in seconds. |

**Default: **Index

Locations of peaks detected in terms of array index or time in seconds.

This output can return a 1D array of clusters or a 1D array of double-precision, floating-point numbers.

This output is available only if you wire one of the following data types to **signal**:

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

Algorithm for Calculating the Location by Time

This node calculates location by time according to the following equation:

Time = Index * **dt**

When the input signal is a waveform or a 1D array of waveforms, **dt** is contained in the input signal.

Why the Peaks Found May not be the Actual Points in the Input Data

Because the peak detection algorithm uses a quadratic fit to find the peaks, the algorithm interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found may not be actual points in the input data but may be at fractions of an index and at amplitudes not found in the input array.

A Boolean that indicates whether this node detected a peak.

This output is available only if you wire a double-precision, floating-point number to **signal**.

The number of valid peaks.

This output can return a 32-bit signed integer or a 1D array of 32-bit signed integers.

This output changes to **index** if you wire a double-precision, floating-point number to **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.

A peak is valid where the consecutive elements of the input sequence exceed the threshold, and the number of elements that exceed the threshold is equal to at least **width**. This node detects the peak when the number of consecutive elements that exceed the **threshold** is greater than or equal to **width**.

The following figure shows the threshold detector result of a sinusoid waveform, where the **threshold** is 0.1 and **width** is 4. The red square represents the beginning index of a detected peak.

The following figure also shows a valid peak. Here the input waveform is a step signal. The **threshold** is 0.5 and **width** is 5. Because thirteen consecutive elements exceed the threshold, the beginning index of the peak is 7.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

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