Table Of Contents

Peak-Valley Detector (G Dataflow)

Last Modified: June 25, 2019

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

This node is based on an algorithm that fits a quadratic polynomial to sequential groups of data points. The number of data points used in the fit is specified by width. For each peak or valley, the quadratic fit is tested against the threshold level. Peaks with heights lower than the threshold or valleys with troughs higher than the threshold are ignored.

connector_pane_image
datatype_icon

pixel values

Pixel data to be processed.

datatype_icon

threshold

Control that rejects peaks or valleys that are too small.

Any peak found with a fitted amplitude that is less than threshold is ignored. Valleys are ignored if the fitted trough is greater than threshold.

datatype_icon

width

Number of consecutive data points to use in the quadratic least-squares fit.

width must be greater than or equal to 3 but should be no larger than one-fourth of the approximate width of the peaks or valleys. Large widths can reduce the apparent amplitude of peaks and shift the apparent location. The less noise in the data, the smaller the value you can choose.

datatype_icon

peaks/valleys

Control that specifies whether to look for peaks (positive-going bumps) or valleys (negative-going bumps).

The settings for this control are 0 (peaks) and 1 (valleys).

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

locations

Array containing the locations of peaks or valleys found in the current block of data.

Locations are reported in indices from the beginning of processing.

datatype_icon

amplitudes

Array containing the amplitudes of peaks or valleys found in the current block of data.

datatype_icon

2nd derivatives

Array containing the second derivatives of peaks or valleys found in the current block of data.

datatype_icon

number found

Number of peaks or valleys found in the current block of data.

number found is the size of the locations, amplitudes, and 2nd derivatives arrays.

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: Not supported

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


Recently Viewed Topics