Package 'ampd'

Title: An Algorithm for Automatic Peak Detection in Noisy Periodic and Quasi-Periodic Signals
Description: A method for automatic detection of peaks in noisy periodic and quasi-periodic signals. This method, called automatic multiscale-based peak detection (AMPD), is based on the calculation and analysis of the local maxima scalogram, a matrix comprising the scale-dependent occurrences of local maxima. For further information see <doi:10.3390/a5040588>.
Authors: Felix Scholkmann <[email protected]>
Maintainer: Oliver Sieber <[email protected]>
License: GPL
Version: 0.2
Built: 2024-12-08 06:54:16 UTC
Source: CRAN

Help Index


AMPD

Description

Implementation of the automatic multiscale-based peak detection (AMPD) algorithm. AMPD enables to detect peaks in noisy periodic and quasi-periodic signals

Usage

AMPD(data, L = NaN, extended = FALSE, splitting = FALSE,
  splittingSize = NaN)

Arguments

data

list containing noisy data with quasi-periodic distribution of local maxima

L

maximum number of scales (corresponding to the maximum width of the window used)

extended

default FALSE, if TRUE it uses an optimzed algorithm, which is capable to detect Maxima at the beginning and/or the end of the data. This was a bottleneck for the old algorithm. FALSE uses the traditional method.

splitting

default FALSE, splits the data vector to achieve better computation performance. However, with this option, no other parameter than the positions of the maxima will be returned

splittingSize

default NaN, it is recommended to specify a splitting size, otherwise a splitting size of 5000 is used. The splitting size is adapted anyway, so that at least 10 local maxima are included.

Value

A list with different variables: LMS ($LMS), rescaled LMS ($rLMS), position of global minimum of the row-wise summation of LMS ($minLoc), position of maxima ($maximaLoc). Note that for big data vectors, only the positions of the local maxima will be returned. The others remain empty.

References

Scholkmann et al. (2012). An Efficient Algorithm for Automatic Peak Detection in Noisy Periodic and Quasi-Periodic Signals. Algorithms, 5 (4), 588-603 http://www.mdpi.com/1999-4893/5/4/588

Examples

t = seq(0,2,0.005)
data = sin(25*t)*sin(0.3*t)+0.4*t
dataNoise = jitter(data,1000)
result = AMPD(dataNoise)
result2 = AMPD(dataNoise, extended=TRUE)
par(mfrow=c(1,2))
plot(dataNoise, main="traditional algorithm", type="l")
points(result$maximaLoc, dataNoise[result$maximaLoc],col="red")
plot(dataNoise, main="extended algorithm", type="l")
points(result2$maximaLoc, dataNoise[result2$maximaLoc],col="red")