Last Modified: June 25, 2019

Finds the location, amplitude, and second derivative of peaks or valleys in the input signal.

A Boolean or an array of Booleans that determines whether to process only one block of data.

True | Processes only one block of data. |

False | Processes consecutive blocks of data. |

After processing the last block of data, this node manages internal data. If you only want to process one block of data, set this input to True. If you want to process consecutive blocks of data, set this input to False for all but the last block of data.

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

**Default: **True

A Boolean or an array of Booleans that determines whether to process only the first block of data.

True | Processes only the first block of data, or resets the internal state of the node. |

False | Processes consecutive blocks of data, or keeps the internal state of the node. |

When you wire a double-precision, floating-point number to **signal**, this input determines whether to reset the internal state of the node and restart the peak detection.

How to Set up **reset** at the Beginning of a Loop

When **signal** is a waveform, an array of waveforms, or an array of double-precision, floating-point numbers, this node requires some internal setup at the beginning for proper operation. If you only want to process one block of data, set this input to True. If you want to process consecutive blocks of data, set this input to True for the first block and False for all other blocks of data.

**Default: **True

The threshold at which this node ignores peaks and valleys. This node ignores peaks if the fitted amplitude is less than this input. This node ignores valleys if the fitted trough is greater than this input.

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 number of consecutive data points to use in the quadratic least squares fit. This input is coerced to a value greater than or equal to 3.

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.

The value of **width** should be no more than about 1/2 of the half-width of the peaks or valleys and can be much smaller (but >2) for noise-free data.

How width Affects Detecting False Peaks

Large widths can reduce the apparent amplitude of peaks and shift the apparent location. For noisy data, this modification is unimportant since the noise obscures the actual peak. Ideally, the width should be as small as possible but must be balanced against the possibility of false peak detection due to noise.

**Default: **3

A value that determines whether the node looks for peaks or valleys in the input signal.

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

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

Peaks | Looks for peaks in the input signal. |

Valleys | Looks for valleys in the input signal. |

**Default: **Peaks

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

Sampling interval of the 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

Mode in which to retrieve peak and valley locations.

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 or valley locations as array indexes. |

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

**Default: **Index

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

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

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.

The measurements of the second derivative of the amplitude at each of the peaks or valleys found in the current block of data.

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

This output gives an approximate measure of the sharpness of each peak or valley. If this node detects peaks, these values are negative. If this node detects valleys, the values are positive.

This output is available only if you wire one of the following data types 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.

This node uses an algorithm that fits a quadratic polynomial to sequential groups of data points. The input **width** specifies the number of data points to use in the fit.

For each peak or valley, this node tests the quadratic fit against the input **threshold**. This node ignores peaks with heights lower than **threshold** or valleys with troughs higher than **threshold**. This node detects peaks and valleys only after processing approximately **width**/2 data points beyond the location of the peak or valley. This delay has implications only for real-time processing.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

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