PeakFinder Type

Peak finder based on the Python SciPy package.

Constructors

Constructor Description

PeakFinder()

Full Usage: PeakFinder()

Instance members

Instance member Description

this.Execute

Full Usage: this.Execute

Parameters:
    x : float[]

Returns: int[] 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.

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. For this call, the properties of this PeakFinder instance will be used (that were before set with the Set.. methods).

x : float[]
Returns: int[]

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.

ArgumentOutOfRangeException distance` must be greater than or equal to 1 - distance

this.Execute

Full Usage: this.Execute

Parameters:
    x : float[] - A signal with peaks.
    ?height : float - Required height of peaks. Either a number or null. The value is always interpreted as the minimal required height.
    ?threshold : float - Required threshold of peaks, the vertical distance to its neighboring samples. Either a number or null. The value element is always interpreted as the minimal required threshold.
    ?distance : float - 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 : float - Required prominence of peaks. Either a number or null. The value is always interpreted as the minimal required prominence.
    ?width : float - Required width of peaks in samples. Either a number or null. The value is always interpreted as the minimal required width.
    ?wlen : int - 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 : float - 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 PeakFinder._peak_widths for a full description of its effects.
    ?plateau_size : float - Required size of the flat top of peaks in samples. Either a number or null. The value is always interpreted as the minimal required plateau size.

Returns: int[] 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.

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.

x : float[]

A signal with peaks.

?height : float

Required height of peaks. Either a number or null. The value is always interpreted as the minimal required height.

?threshold : float

Required threshold of peaks, the vertical distance to its neighboring samples. Either a number or null. The value element is always interpreted as the minimal required threshold.

?distance : float

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 : float

Required prominence of peaks. Either a number or null. The value is always interpreted as the minimal required prominence.

?width : float

Required width of peaks in samples. Either a number or null. The value is always interpreted as the minimal required width.

?wlen : int

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 : float

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 PeakFinder._peak_widths for a full description of its effects.

?plateau_size : float

Required size of the flat top of peaks in samples. Either a number or null. The value is always interpreted as the minimal required plateau size.

Returns: int[]

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.

ArgumentOutOfRangeException distance` must be greater than or equal to 1 - distance

this.Execute

Full Usage: this.Execute

Parameters:
    x : float[] - A signal with peaks.
    ?height : obj - 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 : obj - 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 : float - 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 : obj - 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 : obj - 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 : int - 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 : float - 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 PeakFinder._peak_widths for a full description of its effects.
    ?plateau_size : obj - 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.

Returns: int[] 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.

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.

x : float[]

A signal with peaks.

?height : obj

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 : obj

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 : float

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 : obj

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 : obj

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 : int

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 : float

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 PeakFinder._peak_widths for a full description of its effects.

?plateau_size : obj

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.

Returns: int[]

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.

ArgumentOutOfRangeException distance` must be greater than or equal to 1 - distance

this.LeftBases

Full Usage: this.LeftBases

The position of the lowest valley point to the left of each peak. This array is only set if the parameter 'Prominence' was specified.

this.LeftEdges

Full Usage: this.LeftEdges

Position of the first point to the left of each peak, whose value is different from the peak's value. This array is only set if the parameter 'PlateauSize' was specified.

this.LeftIps

Full Usage: this.LeftIps

The left intersection points of each peak. This array is only set if the parameter 'Width' was specified.

this.LeftThresholds

Full Usage: this.LeftThresholds

The left thresholds of each peak. This array is only set if the parameter 'Threshold' was specified.

this.PeakHeights

Full Usage: this.PeakHeights

The peak height of each peak. This array is only set if the parameter Height was specified.

this.PeakPositions

Full Usage: this.PeakPositions

The peak positions (indices of the y-array). This array is always set after a call to Execute.

this.PlateauSizes

Full Usage: this.PlateauSizes

The plateau sizes of each peak. This array is only set if the parameter PlateauSize was specified.

this.Prominences

Full Usage: this.Prominences

The prominence values of each peak. This array is only set if the parameter 'Prominence' was specified.

this.ResetDistance

Full Usage: this.ResetDistance

Returns: PeakFinder This instance.

Resets the distance parameter, so that there is no requirement to the distance of the peaks anymore.

Returns: PeakFinder

This instance.

this.ResetHeight

Full Usage: this.ResetHeight

Returns: PeakFinder This instance.

Resets the height parameter, so that there is no requirement to the height of the peaks anymore.

Returns: PeakFinder

This instance.

this.ResetPlateauSize

Full Usage: this.ResetPlateauSize

Returns: PeakFinder This instance.

Resets the plateau size parameter, so that there is no requirement to the plateau size of the peaks anymore.

Returns: PeakFinder

This instance.

this.ResetProminence

Full Usage: this.ResetProminence

Returns: PeakFinder This instance.

Resets the prominence parameter, so that there is no requirement to the prominence values of the peaks anymore.

Returns: PeakFinder

This instance.

this.ResetRelativeHeight

Full Usage: this.ResetRelativeHeight

Returns: PeakFinder This instance.

Resets the relative height parameter to its default value of 0.5.

Returns: PeakFinder

This instance.

this.ResetThreshold

Full Usage: this.ResetThreshold

Returns: PeakFinder This instance.

Resets the threshold parameter, so that there is no requirement to the threshold value of the peaks anymore.

Returns: PeakFinder

This instance.

this.ResetWLen

Full Usage: this.ResetWLen

Returns: PeakFinder This instance.

Resets the width of the search window for the neighbouring values around a peak to the full spectral range.

Returns: PeakFinder

This instance.

this.ResetWidth

Full Usage: this.ResetWidth

Returns: PeakFinder This instance.

Resets the width parameter, so that there is no requirement to the width of the peaks anymore.

Returns: PeakFinder

This instance.

this.RightBases

Full Usage: this.RightBases

The position of the lowest valley point to the right of each peak. This array is only set if the parameter 'Prominence' was specified.

this.RightEdges

Full Usage: this.RightEdges

Position of the first point to the right of each peak, whose value is different from the peak's value. This array is only set if the parameter 'PlateauSize' was specified.

this.RightIps

Full Usage: this.RightIps

The right intersection points of each peak. This array is only set if the parameter 'Width' was specified.

this.RightThresholds

Full Usage: this.RightThresholds

The right thresholds of each peak. This array is only set if the parameter 'Threshold' was specified.

this.SetDistance

Full Usage: this.SetDistance

Parameters:
    value : float - The minimal horizontal distance required between neighbouring peaks (in points).

Returns: PeakFinder This instance.

Sets the minimal horizontal distance (>= 1) between neighbouring peaks, required for all peaks. Smaller peaks are removed first until the condition is fulfilled for all remaining peaks.

value : float

The minimal horizontal distance required between neighbouring peaks (in points).

Returns: PeakFinder

This instance.

this.SetHeight

Full Usage: this.SetHeight

Parameters:
    value : float - The minimal height.

Returns: PeakFinder This instance.

Sets the minimal height required for all peaks.

value : float

The minimal height.

Returns: PeakFinder

This instance.

this.SetHeight

Full Usage: this.SetHeight

Parameters:
    value : float * float - The minimal and maximal height for all peaks.

Returns: PeakFinder This instance.

Sets the minimal and maximal height required for all peaks.

value : float * float

The minimal and maximal height for all peaks.

Returns: PeakFinder

This instance.

this.SetHeight

Full Usage: this.SetHeight

Parameters:
    value : float[] - The minimal height for each peak.

Returns: PeakFinder This instance.

Sets the minimal height required for each peak.

value : float[]

The minimal height for each peak.

Returns: PeakFinder

This instance.

this.SetHeight

Full Usage: this.SetHeight

Parameters:
    value : (float * float)[] - The minimal and maximal height for each peak.

Returns: PeakFinder This instance.

Sets the minimal and maximal height required for each peak.

value : (float * float)[]

The minimal and maximal height for each peak.

Returns: PeakFinder

This instance.

this.SetPlateauSize

Full Usage: this.SetPlateauSize

Parameters:
    value : float - The minimal plateau size value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal plateau size value required for all peaks.

value : float

The minimal plateau size value required for all peaks.

Returns: PeakFinder

This instance.

this.SetPlateauSize

Full Usage: this.SetPlateauSize

Parameters:
    value : float * float - The minimal plateau size value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal and maximal plateau size value required for all peaks.

value : float * float

The minimal plateau size value required for all peaks.

Returns: PeakFinder

This instance.

this.SetPlateauSize

Full Usage: this.SetPlateauSize

Parameters:
    value : float[] - The minimal plateau size value for required each peak.

Returns: PeakFinder This instance.

Sets the minimal plateau size value required for each peak.

value : float[]

The minimal plateau size value for required each peak.

Returns: PeakFinder

This instance.

this.SetPlateauSize

Full Usage: this.SetPlateauSize

Parameters:
    value : (float * float)[] - The minimal and maximal plateau size value required for each peak.

Returns: PeakFinder This instance.

Sets the minimal and maximal plateau size value required for each peak.

value : (float * float)[]

The minimal and maximal plateau size value required for each peak.

Returns: PeakFinder

This instance.

this.SetProminence

Full Usage: this.SetProminence

Parameters:
    value : float - The minimal prominence value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal prominence value required for all peaks. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.

value : float

The minimal prominence value required for all peaks.

Returns: PeakFinder

This instance.

this.SetProminence

Full Usage: this.SetProminence

Parameters:
    value : float * float - The minimal and maximal prominence values required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal and maximal prominence values required for all peaks. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.

value : float * float

The minimal and maximal prominence values required for all peaks.

Returns: PeakFinder

This instance.

this.SetProminence

Full Usage: this.SetProminence

Parameters:
    value : float[] - The minimal prominence values required for each peak.

Returns: PeakFinder This instance.

Sets the minimum prominence values required for each peak. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.

value : float[]

The minimal prominence values required for each peak.

Returns: PeakFinder

This instance.

this.SetProminence

Full Usage: this.SetProminence

Parameters:
    value : (float * float)[] - The minimal and maximal prominence values required for each peak..

Returns: PeakFinder This instance.

Sets the minimal and maximal prominence values required for each peak. Prominence is defined as the smaller of the two difference values between the peak height and the height of the neighbouring valleys.

value : (float * float)[]

The minimal and maximal prominence values required for each peak..

Returns: PeakFinder

This instance.

this.SetRelativeHeight

Full Usage: this.SetRelativeHeight

Parameters:
    value : float - The relative height value.

Returns: PeakFinder

Sets the relative height value that is used to determine the width of the peaks. The width of a peak is determined at the y-value, which is (prominence x relative height) below the peak's y-value.

value : float

The relative height value.

Returns: PeakFinder

this.SetThreshold

Full Usage: this.SetThreshold

Parameters:
    value : float - The minimal threshold value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal threshold value required for all peaks. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.

value : float

The minimal threshold value required for all peaks.

Returns: PeakFinder

This instance.

this.SetThreshold

Full Usage: this.SetThreshold

Parameters:
    value : float * float - The minimal and maximal threshold value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal and maximal threshold value required for all peaks. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.

value : float * float

The minimal and maximal threshold value required for all peaks.

Returns: PeakFinder

This instance.

this.SetThreshold

Full Usage: this.SetThreshold

Parameters:
    value : float[] - The minimal threshold value required for each peak.

Returns: PeakFinder This instance.

Sets the minimal threshold value required for each peak. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.

value : float[]

The minimal threshold value required for each peak.

Returns: PeakFinder

This instance.

this.SetThreshold

Full Usage: this.SetThreshold

Parameters:
    value : (float * float)[] - The minimal and maximal threshold values required for each peak.

Returns: PeakFinder This instance.

Sets the minimal and maximal threshold value required for each peak. Threshold is defined as minimum difference value between the peak height and its immediate neightbouring points.

value : (float * float)[]

The minimal and maximal threshold values required for each peak.

Returns: PeakFinder

This instance.

this.SetWLen

Full Usage: this.SetWLen

Parameters:
    value : int - width of the search window for the neighbouring values around a peak (in points).

Returns: PeakFinder This instance.

Sets the width of the search window for the neighbouring values around a peak (in points). Used for calculation of the peaks prominences, thus it is only used if one of the parameters 'prominence' or 'width' is given.

value : int

width of the search window for the neighbouring values around a peak (in points).

Returns: PeakFinder

This instance.

this.SetWidth

Full Usage: this.SetWidth

Parameters:
    value : float - The minimal width value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal width value required for all peaks. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.

value : float

The minimal width value required for all peaks.

Returns: PeakFinder

This instance.

this.SetWidth

Full Usage: this.SetWidth

Parameters:
    value : float * float - The minimal and maximal width value required for all peaks.

Returns: PeakFinder This instance.

Sets the minimal and maximal width value required for all peaks. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.

value : float * float

The minimal and maximal width value required for all peaks.

Returns: PeakFinder

This instance.

this.SetWidth

Full Usage: this.SetWidth

Parameters:
    value : float[] - The minimal width value required for each peak.

Returns: PeakFinder This instance.

Sets the minimal width value required for each peak. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.

value : float[]

The minimal width value required for each peak.

Returns: PeakFinder

This instance.

this.SetWidth

Full Usage: this.SetWidth

Parameters:
    value : (float * float)[] - The minimal and maximal width values required for each peak.

Returns: PeakFinder This instance.

Sets the minimal and maximal width values required for each peak. The width of a peak is determined at the y-value, which is (prominence x relative height) less than the peak's y-value.

value : (float * float)[]

The minimal and maximal width values required for each peak.

Returns: PeakFinder

This instance.

this.Warnings

Full Usage: this.Warnings

Returns: string

The warnings during the execution of the peak finder algorithm.

Returns: string

this.WidthHeights

Full Usage: this.WidthHeights

The height at which the width of each peak was determined. This array is only set if the parameter 'Width' was specified.

this.Widths

Full Usage: this.Widths

The width of each peak. This array is only set if the parameter 'Width' was specified.

this._local_maxima_1d

Full Usage: this._local_maxima_1d

Parameters:
    x : float[] - The array (e.g., a spectrum).

Returns: int[] * int[] * int[] Tuple of midpoints (indices of midpoints of local maxima), LeftEdges: Indices of edges to the left of local maxima, and RightEdges: Indices of edges to the right of local maxima.

Find local maxima in a 1D array. This function finds all local maxima in a 1D array and returns the indices for their edges and midpoints(rounded down for even plateau sizes).

A maxima is defined as one or more samples of equal value that are surrounded on both sides by at least one smaller sample.

x : float[]

The array (e.g., a spectrum).

Returns: int[] * int[] * int[]

Tuple of midpoints (indices of midpoints of local maxima), LeftEdges: Indices of edges to the left of local maxima, and RightEdges: Indices of edges to the right of local maxima.

this._peak_prominences

Full Usage: this._peak_prominences

Parameters:
    x : float[] - The signal, e.g. a spectrum with peaks.
    peaks : int[] - The indices of the peak positions in x.
    wlen : int - A window length in samples (see `peak_prominences`) which is rounded up to the nearest odd integer.If smaller than 2 the entire signal `x` is used.

Returns: float[] * int[] * int[] * string

Calculate the prominence of each peak in a signal.

x : float[]

The signal, e.g. a spectrum with peaks.

peaks : int[]

The indices of the peak positions in x.

wlen : int

A window length in samples (see `peak_prominences`) which is rounded up to the nearest odd integer.If smaller than 2 the entire signal `x` is used.

Returns: float[] * int[] * int[] * string