Baseline estimation by iterative mean suppression.
Usage
baseline_peakfilling(x, y, ...)
# S4 method for class 'numeric,numeric'
baseline_peakfilling(x, y, n, m, by = 10, lambda = 1600, d = 2, sparse = FALSE)
# S4 method for class 'ANY,missing'
baseline_peakfilling(x, n, m, by = 10, lambda = 1600, d = 2, sparse = FALSE)Arguments
- x, y
A
numericvector. Ifyis missing, an attempt is made to interpretxin a suitable way (seegrDevices::xy.coords()).- ...
Currently not used.
- n
An
integervalue giving the number of iterations.- m
An odd
integergiving the half window size.- by
A length-one
numericvector giving the umber of buckets to dividexinto.- lambda
An
integergiving the smoothing parameter. The largerlambdais, the smoother the curve (seesmooth_whittaker()).- d
An
integerspecifying the order of the penalty (seesmooth_whittaker()).- sparse
A
logicalscalar: should sparse matrices be used for computation (seesmooth_whittaker())? IfTRUE, Matrix is required.
Value
Returns a list with two components x and y.
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_asls(),
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")
