WA Multiscale Peak Detection (Array) VI
- Updated2024-07-30
- 4 minute(s) read
Uses multiresolution wavelet analysis to detect peaks or valleys in a signal. Wire data to the signal input to determine the polymorphic instance to use or manually select the instance.

Inputs/Outputs
peaks/valleys
—
peaks/valleys specifies whether this VI looks for peaks or valleys in the signal. The default is peaks.
signal
—
signal specifies the input signal.
threshold
—
threshold specifies the threshold this VI uses to reject peaks or valleys of a particular size. If this VI looks for peaks, this VI ignores peaks with a peak amplitude less than threshold. If this VI looks for valleys, this VI ignores valleys with a valley amplitude greater than threshold.
width
—
width specifies the width, in number of samples, of the peaks or valleys. This VI coerces the value to a power of 2.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
detrend settings
—
detrend settings specifies the settings this VI uses to remove the trend from the signal.
sampling rate
—
sampling rate specifies the sampling rate of signal in hertz. sampling rate must be greater than 0, or this VI sets sampling rate to 1 automatically. The default is 1.
number of peaks
—
number of peaks returns the number of peaks or valleys this VI detects.
location
—
location returns the locations of the peaks or valleys this VI detects.
amplitude
—
amplitude returns the amplitudes of the peaks or valleys this VI detects.
peak plot
—
peak plot returns the signal and the peaks or valleys this VI detects. If detrend? is TRUE, peak plot also returns the trend of the input signal. You can plot this information on an XY graph.
error out
—
error out contains error information. This output provides standard error out functionality. |
WA Multiscale Peak Detection Details
This VI executes the following steps to detect peaks by using a wavelet-based method.
- Calculates the undecimated wavelet transform (UWT) level based on the width and the UWT level based on the threshold frequency, separately. This VI chooses the greater UWT level from the two results to control the decomposition level.
- Performs UWT on the input signal by using the biorthogonal wavelet bior3_1 and the greater UWT level calculated in step 1.
- Searches for zero-crossing points in the detail coefficients at all levels.
- Selects the zero-crossing points at the largest scale as the coarse estimation of the real peaks.
- Searches the finer scale for the corresponding nearest zero-crossing point for each detected point.
- Repeats step 5 until this VI reaches the finest scale, which is the first level.
Examples
Refer to the following VIs for examples of using the WA Multiscale Peak Detection VI:
- Breakdown Point Detection VI: labview\examples\Wavelet Analysis\WAApplications
- ECG QRS Complex Detection VI: labview\examples\Wavelet Analysis\WAApplications
- Peak Detection (Wavelet vs. Normal) VI: labview\examples\Wavelet Analysis\WAGettingStarted
- Peak Detection in a Signal with Baseline Wandering VI: labview\examples\Wavelet Analysis\WAGettingStarted
peaks/valleys
—
signal
—
threshold
—
width
—
error in (no error)
—
detrend settings
—
detrend? (F)
—
number of peaks
—
location
—
peak plot
—
error out
—