Learn R Programming

alkahest (version 1.3.0)

baseline_rollingball: Rolling Ball Baseline Estimation

Description

Rolling Ball Baseline Estimation

Usage

baseline_rollingball(x, y, ...)

# S4 method for numeric,numeric baseline_rollingball(x, y, m, s)

# S4 method for ANY,missing baseline_rollingball(x, m, s)

Value

Returns a list with two components x and y.

Arguments

x, y

A numeric vector. If y is missing, an attempt is made to interpret x in a suitable way (see grDevices::xy.coords()).

...

Currently not used.

m

An odd integer giving the window size (i.e. the number of adjacent points to be used; see window_sliding()) for minimization/maximization.

s

An odd integer giving the window size (i.e. the number of adjacent points to be used; see window_sliding()) for smoothing.

Author

N. Frerebeau

References

Kneen, M. A. and Annegarn, H. J. (1996). Algorithm for Fitting XRF, SEM and PIXE X-Ray Spectra Backgrounds. Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms, 109/110: 209-213. tools:::Rd_expr_doi("10.1016/0168-583X(95)00908-6").

See Also

signal_correct()

Other baseline estimation methods: baseline_asls(), baseline_linear(), baseline_peakfilling(), baseline_polynomial(), baseline_rubberband(), baseline_snip()

Examples

Run this code
## X-ray diffraction
data("XRD")

## Subset from 20 to 70 degrees
XRD <- signal_select(XRD, from = 20, to = 70)

## Plot spectrum
plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")

## Rolling Ball baseline
baseline <- baseline_rollingball(XRD, m = 201, s = 151)

plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")
lines(baseline, type = "l", col = "red")

Run the code above in your browser using DataLab