A collection of background subtraction algorithms for spectroscopic data
To install the package, simply type "
]" followed up by "
add BackgroundSubtraction" in the Julia REPL.
The main function is based on the multi-component background learning model (MCBL), with the corresponding function
mcbl(A::AbstractMatrix, k::Int, x::AbstractVector, l::Real)
Ais the data matrix, each column of which is assumed to be a spectrogram.
kis the number of components in the multi-component background model.
xis the index vector corresponding to rows of
A. For example, if a column of
Ais an X-ray diffraction spectrogram,
xshould be the angle of diffraction of each row.
lis the length scale of the background component. It controls how quickly the background model is allowed to vary with
x. This functions as an important regularization for medium-sized data (100s-1000s spectrograms).
There are 3 parameters controlling the algorithm, which can optionally be passed as keyword arguments:
minresis the minimum residual standard deviation after which the algorithms terminates.
nsigmais the number of standard deviations above the noise level after which a data point is classified as a peak. A smaller number will be more agressive in classifying points as peaks.
maxiteris the maximum number of iterations between updating the noise and background model.
If you use the MCBL for work or a publication, please cite the original article:
Ament, S.E., Stein, H.S., Guevarra, D. et al. Multi-component background learning automates signal detection for spectroscopic data. npj Comput Mater 5, 77 (2019). https://doi.org/10.1038/s41524-019-0213-0