Baseline estimation by iterative mean suppression.
Usage
baseline_peakfilling(x, y, ...)
# S4 method for numeric,numeric
baseline_peakfilling(x, y, n, m, by = 10)
# S4 method for ANY,missing
baseline_peakfilling(x, n, m, by = 10)
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
An
integer
specifying the binning ratio (i.e. the number of points to be grouped together; seewindow_tumbling()
).
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
Other baseline estimation methods:
baseline_linear()
,
baseline_polynomial()
,
baseline_rollingball()
,
baseline_rubberband()
,
baseline_snip()
Examples
## gamma-ray spectrometry
data("BEGe")
## Subset from 2.75 to 200 keV
BEGe <- signal_select(BEGe, from = 3, to = 200)
## Plot spectrum
plot(BEGe, type = "l", xlab = "Energy (keV)", ylab = "Count")
## 4S Peak Filling
baseline <- baseline_peakfilling(BEGe, n = 5, m = 5, by = 2)
plot(BEGe, type = "l", xlab = "Energy (keV)", ylab = "Count")
lines(baseline, type = "l", col = "red")