public class FindPeaksTools
extends java.lang.Object
Constructor and Description |
---|
FindPeaksTools() |
Modifier and Type | Method and Description |
---|---|
static int[] |
filterPeaks(int[] idx,
double[] vals,
double minD,
double minW,
double maxW,
double minH,
double fitMin)
This is the second part of the Java implementation of the Octave findPeaks function
(see https://searchcode.com/codesearch/view/64213481/)
We estimate widths of peaks remove peaks that have quality issues:
width smaller than given minal width or larger than maximal width.
|
static int[] |
findPeaks(double[] vals,
double threshold,
double minD,
boolean doFiltering,
double minW,
double maxW,
double minH)
Main function to identify peaks an array of double values.
|
static int[] |
identifyPeaksAtMinimalDistance(double[] vals,
double threshold,
double minD)
This function identifies peaks above a threshold, and with a minimal distance between
them.
|
public static int[] findPeaks(double[] vals, double threshold, double minD, boolean doFiltering, double minW, double maxW, double minH)
vals
- Array of values in which we search for peaksthreshold
- Threshold above which the values need to lie to be considered peak candidatesminD
- Minimal distance between peaks (unit spacing between individual values is assumed)doFiltering
- Should we do filtering for width and height or just accept the peaks found in the primary search?minW
- Minimal width (if filtering)maxW
- Maximal width (if filtering)minH
- Minimal height (above threshold for fitted parabola, effective only when filtering)public static int[] identifyPeaksAtMinimalDistance(double[] vals, double threshold, double minD)
vals
- Values of the function for which peaks should be found. Unit spacing between sequential values is assumedthreshold
- Threshold above which a value need to lie to be considered as a candidate for being peakminD
- Minimal distance between neighboring peakspublic static int[] filterPeaks(int[] idx, double[] vals, double minD, double minW, double maxW, double minH, double fitMin)
idx
- the pre-filtered peak candidates,typicaly obtained from the method identifyPeaksAtMinimalDistancevals
- Underlying values (complete dataset)minD
- distance required between the peaks (minD)minW
- Minimal fitting widthmaxW
- Maximal fitting widthminH
- Minimal fitting heightfitMin
- Minimal environment around peak for parabola fitting