baseline_peakfilling {alkahest}R Documentation

4S Peak Filling

Description

Baseline estimation by iterative mean suppression.

Usage

baseline_peakfilling(x, y, ...)

## S4 method for signature 'numeric,numeric'
baseline_peakfilling(x, y, n, m, by = 10, lambda = 1600, d = 2, sparse = FALSE)

## S4 method for signature 'ANY,missing'
baseline_peakfilling(x, n, m, by = 10, lambda = 1600, d = 2, sparse = FALSE)

Arguments

x, y

A numeric vector. If y is missing, an attempt is made to interpret x in a suitable way (see grDevices::xy.coords()).

...

Currently not used.

n

An integer value giving the number of iterations.

m

An odd integer giving the half window size.

by

A length-one numeric vector givging the umber of buckets to divide x into.

lambda

An integer giving the smoothing parameter. The larger lambda is, the smoother the curve (see smooth_whittaker()).

d

An integer specifying the order of the penalty (see smooth_whittaker()).

sparse

A logical scalar: should sparse matrices be used for computation (see smooth_whittaker())? If TRUE, Matrix is required.

Author(s)

N. Frerebeau

References

Liland, K. H. (2015). 4S Peak Filling - baseline estimation by iterative mean suppression. MethodsX, 2, 135-140. doi:10.1016/j.mex.2015.02.009.

See Also

signal_correct(), smooth_whittaker()

Other baseline estimation methods: baseline_linear(), baseline_polynomial(), baseline_rollingball(), baseline_rubberband(), baseline_snip()

Examples

## X-ray diffraction
data("XRD")

## 4S Peak Filling baseline
baseline <- baseline_peakfilling(XRD, n = 10, m = 5, by = 10, sparse = TRUE)

plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")
lines(baseline, type = "l", col = "red")

[Package alkahest version 1.1.1 Index]