Manual
FindPeaks1D.findpeaks1d
— Methodfindpeaks1d(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 signalheight
: the first element is the minimal and the second, if supplied, is the maximal peak heightdistance
: the minimal peak distanceprominence
: the first element is the minimal and the second, if supplied, is the maximal peak prominencewidth
: the first element is the minimal and the second, if supplied, is the maximal peak widthwlen
: used for calculation of the peak prominencerelheight
: 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]))
FindPeaks1D.localmaxima1d
— Methodlocalmaxima1d(x)
Finds all local maxima in a 1-D signal. The first and the last sample can't be maxima.
FindPeaks1D.peakprominences1d
— Methodpeakprominences1(x, pkindices, wlen=nothing)
Calculate the prominence of each peak in a 1-D signal.
Arguments
x
: 1-D signalpkindices
: peak indiceswlen
: a window length in samples to restrict peak finding to a window around the current peak
Returns
prominences
: prominences for each peaksleftbases
,rightbases
: indices of the left and right of each peak for peaks' bases
FindPeaks1D.peakwidths1d
— Methodpeakwidths1d(x, pkindices, relheight, prominences, leftbases, rightbases)
Calculate the width of each peak in a 1-D signal.
Arguments
x
: 1-D signalpkindices
: peak indicesrelheight
: relative height with respect to the peak heights and prominencesprominencedata
: output ofpeakprominences1d
leftbases
,rightbases
: indices of the left and right of each peak for peaks' bases
Returns
widths
: width for each peak in sampleswidthheights
: height at which thewidths
are evaluatedleftips
,rightips
: interpolated left and right intersection points of a horizontal line at the respectivewidthheights
FindPeaks1D.peakwidths1d
— Methodpeakwidths1d(x, pkindices, relheight=0.5, prominencedata=nothing, wlen=nothing)
Calculate the width of each peak in a 1-D signal.
Arguments
x
: 1-D signalpkindices
: peak indicesrelheight
: relative height with respect to the peak heights and prominenceswlen
: a window length in samples to restrict peak finding to a window around the current peak
Returns
widths
: width for each peak in sampleswidthheights
: height at which thewidths
are evaluatedleftips
,rightips
: interpolated left and right intersection points of a horizontal line at the
respective widthheights