Adaptive Raman Spectroscopy Baseline Correction Method, Device and Medium Based on Gaussian Smoothing and Morphological Filtering
Through the cascade filtering structure and dynamic convergence mechanism of Gaussian smoothing and morphological filtering, the problem of baseline drift in Raman spectroscopy is solved, and high-efficiency spectral feature retention and baseline correction in complex backgrounds are achieved, which is suitable for high-real-time scenarios.
Patent Information
- Application Number
- CN202510570661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-06
AI Technical Summary
In existing Raman spectral analysis, the baseline drift problem leads to the offset or distortion of the spectral signal, affecting the identification and quantitative analysis of feature peaks. Traditional methods are sensitive to parameter selection, low computational efficiency, and insufficient feature retention when dealing with complex backgrounds.
Adaptive Raman spectral baseline correction method based on Gaussian smoothing and morphological filtering is adopted. Through the cascade filtering structure and dynamic convergence mechanism, Gaussian smoothing, morphological filtering and iterative dynamic baseline update, high-frequency noise is suppressed and spectral characteristics are retained, and the relative change of the total area of the signal is used as the adaptive termination condition.
It significantly improves the accuracy and efficiency of baseline correction, can effectively retain spectral characteristics in complex contexts, and is suitable for high real-time scenarios, reducing the sensitivity and computational complexity of parameter selection.
Smart Images

Figure CN120084775B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectral signals, and more specifically to an adaptive Raman spectrum baseline correction method, device and medium based on Gaussian smoothing and morphological filtering. Background Art
[0002] Raman spectroscopy analysis is a non-destructive testing technology widely used in the fields of chemistry, biology, materials, etc., which can provide molecular structure information of substances. However, Raman spectra are often interfered by the problem of baseline drift in practical applications. Especially in the presence of high fluorescence background, the fluorescence signal will mask the Raman characteristic peaks, seriously affecting the accuracy and interpretability of the spectra. Baseline drift is mainly caused by factors such as fluorescence background and instrument noise, resulting in the overall shift or distortion of the spectral signal, and further affecting the identification and quantitative analysis of characteristic peaks. Therefore, how to effectively process and correct the interfered Raman spectral signal is an important direction in the research of spectral signal processing.
[0003] Commonly used baseline correction methods include polynomial fitting, wavelet transform, and morphological filtering, etc. Although these methods can alleviate the problem of baseline drift to a certain extent, there are still limitations: polynomial fitting is easily interfered by noise, resulting in inaccurate fitting; wavelet transform can separate signals and noise, but is sensitive to parameter selection and has complex calculations; morphological filtering (such as minimum filtering) can initially estimate the baseline, but it is difficult to balance noise suppression and feature retention.
[0004] Therefore, how to solve the problems of traditional methods being sensitive to parameter selection, low calculation efficiency, and insufficient feature retention when dealing with complex backgrounds is the main research content of the present invention. Summary of the Invention
[0005] In view of this, the present invention provides an adaptive Raman spectrum baseline correction method, device and medium based on Gaussian smoothing and morphological filtering, ensuring the integrity of spectral features during the correction process, and is particularly suitable for complex background analysis in high real-time scenarios.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] An adaptive Raman spectrum baseline correction method based on Gaussian smoothing and morphological filtering, comprising:
[0008] Step 1: Perform Gaussian smoothing on the Raman spectral signal to obtain a smoothed signal;
[0009] Step 2: Perform morphological filtering on the smoothed signal to initially estimate the baseline;
[0010] Step 3: Perform Gaussian smoothing on the initially estimated baseline to obtain a smoothed baseline;
[0011] Step 4: Subtract the smoothed baseline from the Raman spectral signal to obtain the corrected spectral signal;
[0012] Step 5: Calculate the total area of the corrected spectral signal, and determine whether the relative change in the total area between adjacent iterations is less than a preset threshold. If the convergence condition is met, proceed to Step 6; otherwise, repeat the iterative process and execute Steps 1 to 5;
[0013] Step 6: Output the finally corrected spectral signal and the baseline estimation result.
[0014] Preferably, Step 1 specifically includes:
[0015] Step 101: Construct the standard deviation of Gaussian smoothing based on the noise intensity of the Raman spectrum;
[0016] Step 102: Perform edge extension on the Raman spectral signal to obtain the extended signal after mirror filling:
[0017]
[0018] where, is the k-th data point of the extended signal after mirror filling in the i-th iteration, is the Raman spectral signal in the (i - 1)-th iteration, is the k-th data point of the Raman spectral signal in the (i - 1)-th iteration, k is the index of the extended signal after filling, , N is the total length of the Raman spectral signal, σ is the standard deviation of Gaussian smoothing. For the initial iteration, i.e., when i = 1, the original Raman spectral signal is equivalent to the original input signal Y;
[0019] Step 103: Perform a convolution kernel operation on the extended signal to obtain the smoothed signal:
[0020]
[0021] where, is the smoothed signal in the i-th iteration, is the extended signal after mirror filling in the i-th iteration, is used to define the weight value at each position in the Gaussian kernel function in the i-th iteration. m is the position parameter in the kernel, i.e., the discretized offset from the center point, taking an integer value to represent the distance from each element in the kernel to the center point.
[0022] Preferably, Step 2 specifically includes:
[0023] Step 201: Set the structural element width of morphological filtering based on the standard deviation of Gaussian smoothing;
[0024] Step 202: Traverse the sliding window for the smoothed signal to determine the neighborhood window range:
[0025]
[0026] Among them, is the window data set for the i-th iteration, n is the index of the current processing position, W is the width of the structuring element, is the k-th data point of the smoothed signal for the i-th iteration;
[0027] Step 203: Perform a window minimum transformation on the window data set, and extract the minimum value within the window as the baseline estimate value:
[0028]
[0029] Among them, is the baseline estimate value at the n-th point for the i-th iteration;
[0030] Step 204: Sort the minimum values into an estimated baseline:
[0031]
[0032] Among them, is the generated estimated baseline for the i-th iteration.
[0033] Preferably, step 5 specifically includes:
[0034] Step 501: Calculate the total area of the original Raman spectrum signal:
[0035]
[0036] Among them, is the total area of the original Raman spectrum signal, is the k-th data point of the input original Raman spectrum signal;
[0037] Step 502: Calculate the total area of the spectrum signal after correction in the first round of iteration steps 1 - step 4, and determine whether the relative change between the total area of the spectrum signal after correction and the total area of the original Raman spectrum signal is less than a preset threshold. If the convergence condition is met, go to step 6; otherwise, repeat the iterative process to execute steps 1 to step 5, and determine whether the relative change in the total area between adjacent iterations is less than the preset threshold.
[0038] Preferably, the formula for calculating the relative change in the total area between adjacent iterations is:
[0039]
[0040] Among them, is the relative change rate of the area at the i-th iteration, , M is the maximum number of iterations, is the total area of the corrected spectral signal at the i-th iteration, is the total area of the corrected spectral signal at the i-1th iteration.
[0041] Preferably, the preset threshold is set to ≤0.01.
[0042] A computer device comprises: a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, an adaptive Raman spectroscopy baseline correction method based on Gaussian smoothing and morphological filtering is implemented.
[0043] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, an adaptive Raman spectroscopy baseline correction method based on Gaussian smoothing and morphological filtering is implemented.
[0044] It can be seen from the above technical solution that compared with the existing technology, the present invention discloses an adaptive Raman spectroscopy baseline correction method, device and medium based on Gaussian smoothing and morphological filtering. Through the cascade filtering structure, the spectral characteristics are effectively retained while suppressing high-frequency noise. Combined with the dynamic convergence mechanism and the iterative dynamic baseline update strategy, the relative change in the total signal area is used as the adaptive termination condition, which significantly improves the accuracy and efficiency of baseline correction, and solves the problems of traditional methods such as sensitivity to parameter selection, low computational efficiency, and insufficient feature retention when dealing with complex backgrounds. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0046] Figure 1 This is a flow chart of the adaptive Raman spectroscopy baseline correction method based on Gaussian smoothing and morphological filtering provided by the present invention.
[0047] Figure 2 This is a Gaussian smoothing process flow chart provided by the present invention.
[0048] Figure 3 This is the morphological filtering flow chart provided by the present invention.
[0049] Figure 4 This is a flow chart of the dynamic convergence mechanism and iterative dynamic baseline update provided by the present invention.
[0050] Figure 5 Schematic diagram of relative area change provided by the present invention.
[0051] Figure 6 Schematic diagram of baseline iteration process provided by the present invention.
[0052] Figure 7 Comparison diagram of the corrected signal and the standard Raman spectral frequency shift value of cyclohexane provided by the present invention. Detailed implementation manners
[0053] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0054] An embodiment of the present invention discloses an adaptive Raman spectral baseline correction method based on Gaussian smoothing and morphological filtering, as Figure 1 shown, including:
[0055] Step 1: Perform Gaussian smoothing on the Raman spectral signal to reduce high-frequency noise interference and obtain a smoothed signal;
[0056] Step 2: Perform morphological filtering on the smoothed signal to initially estimate the baseline;
[0057] Step 3: Perform Gaussian smoothing on the initially estimated baseline to improve the stability of the baseline estimation and obtain a smoothed baseline;
[0058] Step 4: Subtract the smoothed baseline from the Raman spectral signal to obtain a corrected spectral signal;
[0059] Step 5: Calculate the total area of the corrected spectral signal and determine whether the relative change with the area of the previous round is less than a preset threshold. If the convergence condition is met, go to Step 6; otherwise, update the smoothed signal and repeat Steps 1 to 5;
[0060] Step 6: Output the finally corrected spectral signal and the baseline estimation result.
[0061] The present invention constructs a cascaded filtering structure, Gaussian smoothing - morphological filtering - Gaussian smoothing, combines Gaussian smoothing with morphological filtering, and precisely corrects the baseline of Raman spectra. First, Gaussian smoothing is performed on the baseline to optimize it. On the premise of retaining spectral features, it effectively suppresses the interference of high - frequency noise on baseline estimation. Then, the baseline is initially estimated through morphological filtering (such as minimum - value filtering), and then Gaussian smoothing is performed on the initially estimated baseline to obtain a relatively stable baseline. Subsequently, baseline subtraction is performed on the initial signal to retain the true information of Raman spectra to the greatest extent.
[0062] In this embodiment, as Figure 2 shown, step 1 specifically includes:
[0063] Step 101: Construct the standard deviation of Gaussian smoothing based on the noise intensity of the Raman spectrum; here, the value of σ being 5 is the comprehensive result of noise characteristic analysis, parameter linkage design, iterative efficiency optimization, and experimental verification. Its core advantage lies in effectively balancing noise suppression and signal retention, and collaborating with the morphological filtering parameter W for optimization, which improves the algorithm convergence speed and is suitable for the efficient processing of actual spectra.
[0064] Step 102: Perform edge extension on the Raman spectrum signal to eliminate the boundary truncation effect and ensure the smooth continuity of the signal at the head and tail regions:
[0065]
[0066] Among them, is the k - th data point of the extended signal after mirror filling in the i - th iteration, is the input signal in the (i - 1) - th iteration, is the k - th data point of the signal Y in the (i - 1) - th iteration, k is the index of the extended signal after filling, and the range is usually , σ is the standard deviation of Gaussian smoothing, N is the total length of the Raman spectrum signal. For the first iteration, that is, when i = 1, is the original Raman spectrum signal, which is equivalent to the original input signal Y;
[0067] Step 103: Perform a convolution kernel operation on the extended signal to achieve double smoothing of the spectrum and the baseline, and reduce the interference of noise on baseline extraction and baseline removal:
[0068]
[0069] Among them, is the smoothed signal result of the convolution of the Gaussian kernel and the extended signal in the i - th iteration, is the extended signal after mirror filling in the i - th iteration, is the Gaussian kernel function, It is used to define the weight value of each position in the kernel of the i-th iteration. Its core function is to achieve a balance between noise suppression and signal detail retention through weight allocation and frequency domain filtering. σ is the standard deviation of Gaussian smoothing, which is used to control the width and smoothing intensity of the Gaussian kernel. m is the position parameter in the kernel, that is, the discretized offset from the center point, which only takes integer values and is used to represent the distance of each element in the kernel to the center point.
[0070] In this embodiment, as Figure 3 shown, step 2 specifically includes:
[0071] Step 201: Based on the smoothing parameter set the structural element width W of the morphological filtering. The value of W being 250 is the result of the combined action of signal characteristics, mathematical principles, experimental parameter tuning, and domain knowledge, aiming to balance the accuracy of baseline estimation and computational efficiency.
[0072] Step 202: Traverse the sliding window for the smoothed signal, determine the neighborhood window range of the current point n, extract the local signal segment, and cover the characteristic peak width through the sliding window to avoid the problem of signal boundary overflow:
[0073]
[0074] Among them, <s is the window data set of the i-th iteration, n is the current processing position index, W is the structural element width, is the k-th data point of the smoothed signal of the i-th iteration.
[0075] After the window data extraction is completed, perform a window minimum transformation on these data, execute the morphological erosion operation, and extract the minimum value within the window as the baseline estimation value. Erosion can suppress high-frequency noise. The formula for extracting the minimum value within the window as the baseline estimation value is:
[0076]
[0077] Among them, is the baseline estimation value of the n-th point in the i-th iteration, reflecting the latest point of the local signal.
[0078] Step 204: After extracting the window minimum value, sort the minimum values to construct the estimated baseline:
[0079]
[0080] Among them, is the estimated baseline signal generated in the i-th iteration.
[0081] An output estimation baseline is obtained, and the output estimation baseline is Gaussian-smoothed to obtain a smoothed baseline. Although morphological filtering can effectively extract the baseline trend, local high-frequency noise may remain. Through the convolution operation of the Gaussian kernel, these remaining noises are further filtered to make the baseline smoother, avoiding the introduction of high-frequency interference during subsequent baseline subtraction and suppressing the remaining noise of morphological filtering.
[0082] Through the cascade structure of Gaussian smoothing - morphological filtering - Gaussian smoothing, double smoothing of the signal and the baseline is achieved, suppressing the influence of high-frequency noise on the baseline processing of Raman spectral signals. Therefore, in the face of complex background noise, the suppression of noise and the retention of signal characteristics can be balanced. Especially in a high-fluorescence background or a complex noise environment, the interference in the peak area can be suppressed.
[0083] In this embodiment, the smoothed baseline is subtracted from the Raman spectral signal to obtain a corrected spectral signal. The calculation formula is:
[0084]
[0085] where, is the corrected spectral signal of the i-th iteration, is the corrected spectral signal of the (i - 1)-th iteration, is the smoothed baseline of the i-th iteration. For the first iteration, that is, when, is the input original Raman spectral signal, which is equivalent to the original input signal Y.
[0086] In this embodiment, the present invention aims at the problem that traditional baseline correction methods rely on a fixed number of iterations, which easily leads to overcorrection or undercorrection. Under a high-fluorescence background, the baseline morphology is complex and changeable, and it is difficult for static baseline estimation methods to adaptively adjust. A dynamic convergence mechanism and an iterative dynamic baseline update strategy are proposed, using the relative change in the total signal area as the convergence criterion. When the area change between adjacent iterations is less than a preset threshold, the calculation is automatically terminated, avoiding the blindness of artificially setting the number of iterations. Each iteration re-estimates the baseline based on the previous correction result, and through gradually approaching the true baseline morphology, high-adaptability correction of non-uniform backgrounds is achieved.
[0087] As Figure 4 shown, it specifically includes:
[0088] Step 501: First is the dynamic convergence mechanism. After the original Raman spectral signal is input, the initial area is calculated first. The original Raman spectral signal without any processing is directly accumulated and summed, laying the foundation for the subsequent calculation of the relative area change:
[0089]
[0090] where, It is the sum of all data points of the original Raman spectral signal.
[0091] Step 502: Calculate the total area of the spectral signal after correction in the first round of iteration steps 1 - 4. Calculate the relative area change based on the total area of the original Raman spectral signal and the total area of the corrected spectral signal after the first iteration. Measure the iteration convergence according to this area relative change rate. If the change rate is less than the threshold, it is considered that the Raman spectral signal after baseline removal has converged, that is, the baseline has been basically removed. Otherwise, repeat the iteration process.
[0092] In this solution, the convergence condition threshold is set to an area relative change rate less than 0.01, which can avoid premature termination of iteration, reduce baseline residue, and is especially suitable for high-fluorescence background scenarios of small signals. Tiny baseline residue may mask the effective peaks of the spectral signal. In this solution, the baseline gradually approaches the true value during iteration. A strict threshold can ensure that the baseline subtraction in the last iteration is thorough enough, and at the same time avoid the risk of underfitting. When the baseline adjustment amplitude is small during the iteration process, the algorithm gradually fine-tunes the baseline shape by increasing the number of iterations. This method can more accurately capture the wide background with gentle changes and interference signals with complex fluctuations, significantly improving the baseline fitting accuracy.
[0093] The formula for calculating the relative change in the total area between adjacent iterations is:
[0094]
[0095] where is the area relative change rate at the i-th iteration, , where is the maximum number of iterations, is the area of the Raman spectral signal after the i-th iteration.
[0096] The present invention realizes cyclic iterative baseline through a dynamic convergence mechanism and an iterative dynamic baseline update strategy, achieving the situation where the baseline can be removed just without overfitting or underfitting. This strategy has a small computational amount and hardware resource consumption, especially in high-real-time applications.
[0097] In the iterative dynamic baseline update strategy of this embodiment, the convergence condition threshold is set to ≤0.01. The relative area of its iteration process is as Figure 5As shown, the curve shows the convergence process of the relative area change in the iteration, verifying the efficiency of the dynamic convergence mechanism. When the relative area is greater than 0.01, it is considered that the Raman spectrum signal has not converged, that is, the baseline has not been completely removed. At this time, the signal with the baseline removed will return to the cascade filtering structure: Gaussian smoothing - morphological filtering - Gaussian smoothing. The signal is smoothed by Gaussian again, the estimated baseline is obtained using morphological filtering, the estimated baseline is smoothed, the smoothed baseline is subtracted, and the relative area change is calculated until the relative area change rate is less than 0.01.
[0098] Figure 6 Shows the baseline iteration process after cascade filtering. To visualize the baseline iteration process, the "sum of the baselines of the i-th iteration" in the figure is the result of accumulating the smoothed baselines obtained from the previous i iterations:
[0099]
[0100] Among them, Is the result of accumulating the smoothed baselines obtained from the previous i iterations, Is the smoothed baseline obtained from the i-th iteration. It can be seen from the figure that the baseline is closer to the target baseline of the original signal compared to the baseline obtained from the previous iteration. The baseline of the corrected signal is basically removed, and the characteristic peaks are clearly visible, verifying the effectiveness of the cascade filtering.
[0101] Figure 7 Shows the comparison chart of the characteristic peak positions between the corrected spectrum and the cyclohexane Raman frequency shift reference substance. The characteristic peak positions of the corrected spectrum are basically aligned with the standard values, and there is no peak position shift or intensity loss, verifying the integrity of the spectral characteristics. The present invention ensures the integrity of the spectral characteristics during the correction process through cascade filtering and dynamic convergence mechanism.
[0102] The experimental results show that the proposed method converges rapidly (relative area change rate ≤ 0.01) in multiple iterations, can accurately separate the baseline interference from the real signal, and ensure the integrity of the position and intensity of the characteristic peaks. Compared with traditional methods, the present invention constructs a cascade filtering structure combined with a dynamic convergence mechanism and an iterative dynamic baseline update strategy to filter out high fluorescence background and noise while retaining the Raman spectrum signal characteristics, especially suitable for complex background analysis in high real-time scenarios.
[0103] This embodiment provides a computer device, including: a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, it implements an adaptive Raman spectrum baseline correction method based on Gaussian smoothing and morphological filtering.
[0104] This embodiment provides a computer-readable storage medium with a computer program stored thereon. When the computer program is executed by a processor, it implements an adaptive Raman spectroscopy baseline correction method based on Gaussian smoothing and morphological filtering.
[0105] Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the aforementioned storage medium includes: various media such as removable storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0106] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, refer to the description in the method section.
[0107] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.
Claims
1. An adaptive Raman spectroscopy baseline correction method based on Gaussian smoothing and morphological filtering, characterized in that, Including: Step 1: Perform Gaussian smoothing on the Raman spectral signal to obtain the smoothed signal; Step 2: Perform morphological filtering on the smoothed signal to preliminarily estimate the baseline; Step 3: Perform Gaussian smoothing on the preliminarily estimated baseline to obtain the smoothed baseline; Step 4: Subtract the smoothed baseline from the Raman spectral signal to obtain the corrected spectral signal; Step 5: Calculate the total area of the corrected spectral signal, and determine whether the relative change in the total area between adjacent iterations is less than a preset threshold. If the convergence condition is met, proceed to Step 6; Otherwise, repeat the iterative process and execute Steps 1 to 5; Step 6: Output the finally corrected spectral signal and the baseline estimation result; Step 2 specifically includes: Step 201: Set the structural element width of the morphological filtering based on the standard deviation of the Gaussian smoothing; Step 202: Traverse the sliding window for the smoothed signal to determine the neighborhood window range: Among them, Y win (i) is the window data set for the i-th iteration, n is the current processing position index, W is the structural element width, and Y s (i) [k] is the k-th data point of the smoothed signal for the i-th iteration; Step 203: Perform a window minimum value transformation on the window data set, and extract the minimum value within the window as the baseline estimation value: b n (i) = min(Y win (i) ) where b n (i) is the baseline estimate value of the n points in the i-th iteration; Step 204: Sort the minimum values into the estimated baseline: Y′ b (i) = {b0 (i) , b1 (i) ,..., b N-1 (i)} where Y′ b (i) is the estimated baseline generated for the i-th iteration.
2. The adaptive Raman spectrum baseline correction method based on Gaussian smoothing and morphological filtering according to claim 1, wherein Step 1 specifically includes: Step 101: Construct the standard deviation of the Gaussian smoothing based on the noise intensity of the Raman spectrum; Step 102: Perform edge extension on the Raman spectral signal to obtain the extended signal after mirror filling: Among them, Y p (i) [k] is the k-th data point of the extended signal after mirror padding in the i-th iteration, Y c (i-1) is the Raman spectrum signal in the (i - 1)-th iteration, Y c (i-1) [k] is the k-th data point of the Raman spectrum signal in the (i - 1)-th iteration, k is the index of the extended signal after padding, k ∈ [-3σ, N + 3σ - 1], N is the total length of the Raman spectrum signal, σ is the standard deviation of Gaussian smoothing. For the first iteration, i.e., when i = 1, Y c (0) is the input original Raman spectrum signal; Step 103: Perform a convolution kernel operation on the extended signal to obtain the smoothed signal: Among them, Y s (i) is the smoothed signal for the i-th iteration, and Y p (i) is the extended signal after mirror padding for the i-th iteration. G m (i) (σ) is used to define the weight value at each position in the Gaussian kernel function G(σ) for the i-th iteration. m is the position parameter within the kernel, that is, the discretized offset from the center point, taking integer values, and is used to represent the distance from each element in the kernel to the center point.
3. The adaptive Raman spectrum baseline correction method based on Gaussian smoothing and morphological filtering according to claim 1, characterized in that Step 5 specifically includes: Step 501: Calculate the total area of the input original Raman spectral signal: Among them, A (0) is the total area of the original Raman spectrum signal, and Y c (0) [k] is the k-th data point of the input original Raman spectrum signal; Step 502: Calculate the total area of the corrected spectral signal in the first round of iteration of Steps 1 - 4, and determine whether the relative change in the total area of the corrected spectral signal and the total area of the original Raman spectral signal is less than a preset threshold. If the convergence condition is met, proceed to Step 6; otherwise, repeat the iterative process and execute Steps 1 to 5, and determine whether the relative change in the total area between adjacent iterations is less than a preset threshold.
4. The adaptive Raman spectroscopy baseline correction method based on Gaussian smoothing and morphological filtering according to claim 3, wherein The formula for the relative change in the total area between adjacent iterations is: where, Δ (i) is the relative change rate of area at the i-th iteration, i ∈ [0, M], M is the maximum number of iterations, A (i) is the total area of the corrected spectral signal at the i-th iteration, A (i-1) is the total area of the corrected spectral signal at the (i - 1)-th iteration.
5. The adaptive Raman spectrum baseline correction method based on Gaussian smoothing and morphological filtering according to claim 3, characterized in that The preset threshold is set to ≤0.
01.
6. A computer device, characterized in that, Including: A memory and a processor, where the memory stores a computer program that can run on the processor. When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
7. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium. When the computer program is executed by the processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
System and method for automated baseline correction for raman spectra
US20070136014A1