Skip to contents

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. If y is missing, an attempt is made to interpret x in a suitable way (see grDevices::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; see window_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 .

Author

N. Frerebeau

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")