baseline_rubberband | R Documentation |
Rubberband Baseline Estimation
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, ...)
x , y |
A |
... |
Extra arguments to be passed to |
noise |
A length-one |
spline |
A |
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.
Returns a list
with two components x
and y
.
baseline_rubberband()
is slightly modified from C. Beleites'
hyperSpec::spc.rubberband()
.
N. Frerebeau
signal_correct()
Other baseline estimation methods:
baseline_asls()
,
baseline_linear()
,
baseline_peakfilling()
,
baseline_polynomial()
,
baseline_rollingball()
,
baseline_snip()
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.