This document
describes the basic concepts in peak detection. You will learn how
to apply these concepts to the peak detection VIs in LabVIEW and
the peak detection functions in Measurement Studio.
Note:To locate the
LabVIEW VIs used in this document, click theSearchbutton
on theFunctionspalette
and type in the VI name.I
ntroductintr
Peak detection is one of the most important time-domain functions
performed in signal monitoring. Peak detection is the process of
finding the locations and amplitudes of local maxima and minima in
a signal that satisfies certain properties. These properties can be
simple or complex. For example, requiring that a peak exceeds a
certain threshold value is a simple property. However, requiring
that a peak’s shape resembles that of a prototype peak is a complex
property.
Peak detection is important in many applications, such as
chemistry, biology, and music. Scientists and engineers who use
analysis techniques such as spectroscopy, chromatography, and tone
detection often use peak detection methods specific to those
analysis techniques. However, this document describes a general
method that applies to a variety of signal types. This is the
method used in LabVIEW and Measurement Studio for peak detection
functions.
In some applications, you do not need to know the exact peak
amplitudes and locations, rather you need to know the number or
general locations of peaks. In this case, use a threshold peak
detection function, such as the Threshold Peak Detector VI in
LabVIEW.
Figure 1 shows the Threshold Peak Detector VI and the VI's inputs
and outputs. The VI scans the input sequenceX, searches
for valid peaks, and keeps track of the indices of the beginnings
of the peaks and the total number of peaks found. A peak is
considered valid if it has the following
characteristics:
The elements ofXbegin
belowthreshold,
exceedthresholdat
some index, and then return to a value belowthreshold
The number of successive elements that exceedthresholdis
greater than or equal towidth.
Figure 1. Threshold Peak Detector VI
This VI does not identify the locations or the amplitudes of peaks
with great accuracy, but the VI does give an idea of where and how
often a signal crosses above a certain threshold value.
The following graph shows a multitone signal after being scanned by
the Threshold Peak Detector VI. The input parameters arethreshold=1.00andwidth=10.
The VI identifies two peaks, located at approximately 15 and 47.
The locations at which they cross the threshold are marked by black
dots in Figure 2. However, the VI fails to identify the third
potential peak, which crosses the threshold at approximately 132,
because it is not at least 10 points wide.
Figure 2. Threshold peak detection performed on a multitone
signal, with the parameters set to threshold =1.00and
width =10
This VI has some limited but important applications. It is
important to understand the distinction between this VI and that of
the Peak Detector VI, which is described below.
Some applications require more robust and accurate peak detection
algorithms. The rest of this document focuses on uses of advanced
peak detection functions, tips to keep in mind and pitfalls to
avoid while using them, and methods for ensuring that your peak
detection measurements are accurate and useful.
The following sections focus mainly on peaks. However, except where
noted, the same information can be used for finding valleys or
local minima.
Figure 3 shows the Peak Detector VI and the VI's inputs and
outputs. Figure 4 shows the equivalent function prototype in the<