Click or drag to resize

PeakFinderExecute(Double, Object, Object, NullableDouble, Object, Object, NullableInt32, Double, Object) Method

Find peaks inside a signal based on peak properties. This function takes a 1-D array and finds all local maxima by simple comparison of neighboring values.Optionally, a subset of these peaks can be selected by specifying conditions for a peak's properties.

Namespace: Altaxo.Science.Spectroscopy.PeakSearching
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public int[] Execute(
	double[] x,
	Object? height = null,
	Object? threshold = null,
	double? distance = null,
	Object prominence = null,
	Object? width = null,
	int? wlen = null,
	double rel_height = 0,5,
	Object? plateau_size = null
)

Parameters

x  Double
A signal with peaks.
height  Object  (Optional)
Required height of peaks. Either a number, null, an array matching or a 2-element sequence of the former.The first element is always interpreted as the minimal and the second, if supplied, as the maximal required height.
threshold  Object  (Optional)
Required threshold of peaks, the vertical distance to its neighboring samples.Either a number, null, an array matching x or a 2-element sequence of the former.The first element is always interpreted as the minimal and the second, if supplied, as the maximal required threshold.
distance  NullableDouble  (Optional)
Required minimal horizontal distance (>= 1) in samples between neighbouring peaks. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.
prominence  Object  (Optional)
Required prominence of peaks. Either a number, null, an array matching x or a 2-element sequence of the former.The first element is always interpreted as the minimal and the second, if supplied, as the maximal required prominence.
width  Object  (Optional)
Required width of peaks in samples. Either a number, null, an array matching x or a 2-element sequence of the former.The first element is always interpreted as the minimal and the second, if supplied, as the maximal required width.
wlen  NullableInt32  (Optional)
Used for calculation of the peaks prominences, thus it is only used if one of the arguments `prominence` or width is given.See argument wlen in `peak_prominences` for a full description of its effects.
rel_height  Double  (Optional)
Used for calculation of the peaks width, thus it is only used if `width` is given. Default value is 0.5. See argument `rel_height` in _peak_widths(Double, Int32, Double, Double, Int32, Int32) for a full description of its effects.
plateau_size  Object  (Optional)
Required size of the flat top of peaks in samples. Either a number, null, an array matching x or a 2-element sequence of the former. The first element is always interpreted as the minimal and the second, if supplied as the maximal required plateau size.

Return Value

Int32
Indices of peaks in `x` that satisfy all given conditions. See also the other properties of this class for access to more results. Note that most of the properties are only set, if the corresponding parameter is specified in this call.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptiondistance` must be greater than or equal to 1 - distance
See Also