public class Peaks
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
debug |
static int |
post |
static int |
pre |
Constructor and Description |
---|
Peaks() |
Modifier and Type | Method and Description |
---|---|
static double |
expDecayWithHold(double av,
double decayRate,
double[] data,
int start,
int stop) |
static int |
findPeaks(double[] data,
int[] peaks,
int width)
General peak picking method for finding n local maxima in an array
|
static java.util.LinkedList<java.lang.Integer> |
findPeaks(double[] data,
int width,
double threshold)
General peak picking method for finding local maxima in an array
|
static java.util.LinkedList<java.lang.Integer> |
findPeaks(double[] data,
int width,
double threshold,
double decayRate,
boolean isRelative)
General peak picking method for finding local maxima in an array
|
static void |
getSlope(double[] data,
double hop,
int n,
double[] slope)
Uses an n-point linear regression to estimate the slope of data.
|
static int |
imax(double[] arr) |
static int |
imin(double[] arr) |
static double |
max(double[] arr) |
static double |
min(double[] arr) |
static void |
normalise(double[] data) |
static boolean |
overThreshold(double[] data,
int index,
int width,
double threshold,
boolean isRelative,
double av) |
public static boolean debug
public static int pre
public static int post
public static int findPeaks(double[] data, int[] peaks, int width)
data
- input datapeaks
- list of peak indexeswidth
- minimum distance between peakspublic static java.util.LinkedList<java.lang.Integer> findPeaks(double[] data, int width, double threshold)
data
- input datawidth
- minimum distance between peaksthreshold
- minimum value of peakspublic static java.util.LinkedList<java.lang.Integer> findPeaks(double[] data, int width, double threshold, double decayRate, boolean isRelative)
data
- input datawidth
- minimum distance between peaksthreshold
- minimum value of peaksdecayRate
- how quickly previous peaks are forgottenisRelative
- minimum value of peaks is relative to local averagepublic static double expDecayWithHold(double av, double decayRate, double[] data, int start, int stop)
public static boolean overThreshold(double[] data, int index, int width, double threshold, boolean isRelative, double av)
public static void normalise(double[] data)
public static void getSlope(double[] data, double hop, int n, double[] slope)
data
- input datahop
- spacing of data pointsn
- length of linear regressionslope
- output datapublic static double min(double[] arr)
public static double max(double[] arr)
public static int imin(double[] arr)
public static int imax(double[] arr)