baseline_rubberband {alkahest} | R Documentation |
Rubberband Baseline Estimation
Description
Rubberband Baseline Estimation
Usage
baseline_rubberband(x, y, ...)
## S4 method for signature 'numeric,numeric'
baseline_rubberband(x, y, noise = 0, spline = TRUE, ...)
## S4 method for signature 'ANY,missing'
baseline_rubberband(x, noise = 0, spline = TRUE, ...)
Arguments
x , y |
A |
... |
Extra arguments to be passed to |
noise |
A length-one |
spline |
A |
Details
A convex envelope of the spectrum is determined and the baseline is estimated as the part of the convex envelope lying below the spectrum. Note that the rubber band does not enter the concave regions (if any) of the spectrum.
Value
Returns a list
with two components x
and y
.
Note
baseline_rubberband()
is slightly modified from C. Beleites'
hyperSpec::spc.rubberband()
.
Author(s)
N. Frerebeau
See Also
Other baseline estimation methods:
baseline_asls()
,
baseline_linear()
,
baseline_peakfilling()
,
baseline_polynomial()
,
baseline_rollingball()
,
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")
## Rubberband baseline
baseline <- baseline_rubberband(BEGe)
plot(BEGe, type = "l", xlab = "Energy (keV)", ylab = "Count")
lines(baseline, type = "l", col = "red")