Manual

FindPeaks1D.findpeaks1dMethod
findpeaks1d(x; 
            height=nothing, 
            distance=nothing, 
            prominence=nothing, 
            width=nothing, 
            wlen=nothing, 
            relheight=0.5)

Find all local maxima in a 1-D signal with specified height, distance, prominence, width.

Arguments

  • x: 1-D signal
  • height: the first element is the minimal and the second, if supplied, is the maximal peak height
  • distance: the minimal peak distance
  • prominence: the first element is the minimal and the second, if supplied, is the maximal peak prominence
  • width: the first element is the minimal and the second, if supplied, is the maximal peak width
  • wlen: used for calculation of the peak prominence
  • relheight: used for calculation of peak width

Returns

Peak indices and properties

Examples

julia> x = [13, 12, 14, 18, 19, 19, 19, 15, 11, 6, 4, 10, 8, 13, 8, 13, 3, 18, 7, 4];

julia> pkindices, pkproperties = findpeaks1d(x)
([6, 12, 14, 16, 18], Dict{String,Any}())

julia> pkindices, pkproperties = findpeaks1d(x, height=11)
([6, 14, 16, 18], Dict{String,Any}("peak_heights" => [19, 13, 13, 18]))

julia> pkindices, pkproperties = findpeaks1d(x, height=11, distance=3)
([6, 14, 18], Dict{String,Any}("peak_heights" => [19, 13, 18]))
source
FindPeaks1D.peakprominences1dMethod
peakprominences1(x, pkindices, wlen=nothing)

Calculate the prominence of each peak in a 1-D signal.

Arguments

  • x: 1-D signal
  • pkindices: peak indices
  • wlen: a window length in samples to restrict peak finding to a window around the current peak

Returns

  • prominences: prominences for each peaks
  • leftbases, rightbases: indices of the left and right of each peak for peaks' bases
source
FindPeaks1D.peakwidths1dMethod
peakwidths1d(x, pkindices, relheight, prominences, leftbases, rightbases)

Calculate the width of each peak in a 1-D signal.

Arguments

  • x: 1-D signal
  • pkindices: peak indices
  • relheight: relative height with respect to the peak heights and prominences
  • prominencedata: output of peakprominences1d
  • leftbases, rightbases: indices of the left and right of each peak for peaks' bases

Returns

  • widths: width for each peak in samples
  • widthheights: height at which the widths are evaluated
  • leftips, rightips: interpolated left and right intersection points of a horizontal line at the respective widthheights
source
FindPeaks1D.peakwidths1dMethod
peakwidths1d(x, pkindices, relheight=0.5, prominencedata=nothing, wlen=nothing)

Calculate the width of each peak in a 1-D signal.

Arguments

  • x: 1-D signal
  • pkindices: peak indices
  • relheight: relative height with respect to the peak heights and prominences
  • wlen: a window length in samples to restrict peak finding to a window around the current peak

Returns

  • widths: width for each peak in samples
  • widthheights: height at which the widths are evaluated
  • leftips, rightips: interpolated left and right intersection points of a horizontal line at the

respective widthheights

source