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
numeric
vector. Ify
is missing, an attempt is made to interpretx
in a suitable way (seegrDevices::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 giving the umber of buckets to dividex
into.- lambda
An
integer
giving the smoothing parameter. The largerlambda
is, the smoother the curve (seesmooth_whittaker()
).- d
An
integer
specifying the order of the penalty (seesmooth_whittaker()
).- sparse
A
logical
scalar: 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")