Improved Num-Local Piecewise Polynomial Fitting Algorithm for Accurate Correction of Raman Spectroscopy Baselines
Tian Chao-fan,Li Jian-jun,Weng Guo-jun,Zhu Jian,Zhao Jun-wu
DOI: https://doi.org/10.3964/j.issn.1000-0593(2024)04-1073-08
2024-01-01
Spectroscopy and spectral analysis
Abstract:Baseline correction, one of the extremely critical steps in Raman spectroscopy pre-processing, is of great significance for further Raman spectroscopy data analysis, Raman imaging, etc. Currently, the most common baseline correction algorithm is based on polynomial fitting; due to its manual or semi-manual form, manual experience, a high level of user expertise, and a tedious processing process are required, leading to large differences in processing results. At the same time, the polynomial order and the moving segmentation window are difficult to select in the process, so the processed results are often under-fitted or over-fitted. This paper improves the Numlocal Piecewise Polynomial Fitting (NPPF) algorithm for accurately calibrating Raman spectral baselines. Firstly, an improved segmentation-based local optimum algorithm is used to select the approximate lateral width of the bottom contour of the widest peak in the spectrum as the background point window width; the minimum and second minimum values within the window, in turn, are selected as the background baseline points to be fitted, avoiding the difficulty of selecting background points, and achieving more accurate selection of each background contour baseline point. Then, the three fitted curve functions are obtained by iterative coverage of each window three times, and each point in the selected window corresponds to three curve function values, which are calculated with the previous fitted absolute value separately. The curve function value with the minimum absolute value is taken as the fitted curve value at this point. Thismethod better avoids the underfitting and overfitting phenomenon of the Piecewise Polynomial Fitting(PPF) algorithm and also determines the order and segmentation window in the fitting process. In this paper, two Raman spectra with different background types are simulated, and the NPPF and PPF algorithms are compared to process the two simulated spectra separately. The Root Mean Square Error (RMSE) of NPPF processing results is found to be smaller, which confirms the superiority of NPPF over PPF. Finally, the Raman spectra of the actual samples (alizarin and rhodamine 6G) are processed by comparing NPPF and PPF, and it is found that the fitted baseline of NPPF is more accurate, which confirms that the NPPF algorithm in this paper has wide practical application value and prospect in the baseline correction pretreatment of Raman spectra.