LocalMaximaSG: Find local maxima with Savitzky Golay filter

View source: R/peak_detection.R

LocalMaximaSGR Documentation

Find local maxima with Savitzky Golay filter

Description

Apply Savitzky Golay filter to the spectrum and find local maxima such that : second derivate Savitzky Golay filter < 0 and first derivate = 0 and intensity > minPeakHeight

Usage

LocalMaximaSG(sp, minPeakHeight = -Inf, noiseacf = 0.1, d = 3)

Arguments

sp

the array of spectrum values

minPeakHeight

minimum intensity of a peak

noiseacf

autocorrelation of the noise

d

the degree of Savitzky Golay filter, defalut 3

Value

array with peak's index in the spectrum

Examples

spectrum<-dnorm(x=seq(-5,5,length.out = 100))
index.max<-LocalMaximaSG(spectrum)

camilleroquencourt/ptairMS documentation built on April 24, 2024, 9:03 p.m.