Table Of Contents

Peak Detection (G Dataflow)

Version:
    Last Modified: January 9, 2017

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

    connector_pane_image
    datatype_icon

    end of data?

    A Boolean 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.

    Default: True

    datatype_icon

    reset

    A Boolean that determines whether to process the first block of data.

    True Processes only the first block of data.
    False Processes consecutive blocks of data.

    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

    datatype_icon

    signal

    The input signal.

    This input accepts the following data types:

    • Waveform
    • Array of waveforms
    • Array of double-precision, floating-point numbers.
    datatype_icon

    threshold

    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.

    Default: 0

    datatype_icon

    width

    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.

    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

    datatype_icon

    peaks/valleys

    An enum that determines whether the node looks for peaks or valleys in the input signal.

    Name Description
    Peaks

    Looks for peaks in the input signal.

    Valleys

    Looks for valleys in the input signal.

    Default: Peaks

    datatype_icon

    error in

    Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

    Default: No error

    datatype_icon

    locations

    The index locations of all peaks or valleys detected in the current block of 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. To view the locations in terms of time, use the following equation:

    Time Locations[i] = t0 + dt*Locations[i]

    datatype_icon

    amplitudes

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

    spd-note-note
    Note  

    The index locations and amplitudes of peaks or valleys might deviate from actual peaks or valleys for noisy signals with large dynamic ranges.

    datatype_icon

    2nd derivatives

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

    This input 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.

    spd-note-note
    Note  

    It is assumed that dt, the time difference between samples, is equal to 1.

    datatype_icon

    count

    The number of peaks or valleys found in the current block of data.

    datatype_icon

    error out

    Error information. The node produces this output according to standard error behavior.

    Algorithm for Calculating Peaks or Valleys

    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


    Recently Viewed Topics