CN113673409A - Automatic convergence spectrum correction method and device for spectrum analysis - Google Patents
Automatic convergence spectrum correction method and device for spectrum analysis Download PDFInfo
- Publication number
- CN113673409A CN113673409A CN202110939238.0A CN202110939238A CN113673409A CN 113673409 A CN113673409 A CN 113673409A CN 202110939238 A CN202110939238 A CN 202110939238A CN 113673409 A CN113673409 A CN 113673409A
- Authority
- CN
- China
- Prior art keywords
- spectrum
- baseline
- correction
- spectral
- spectral analysis
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001228 spectrum Methods 0.000 title claims abstract description 193
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000012937 correction Methods 0.000 title claims abstract description 50
- 238000010183 spectrum analysis Methods 0.000 title claims abstract description 40
- 239000011159 matrix material Substances 0.000 claims abstract description 71
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 25
- 230000003595 spectral effect Effects 0.000 claims description 66
- 230000006870 function Effects 0.000 claims description 28
- 230000014509 gene expression Effects 0.000 claims description 22
- 230000008569 process Effects 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 11
- 238000003860 storage Methods 0.000 claims description 7
- 230000003247 decreasing effect Effects 0.000 claims description 3
- 238000007405 data analysis Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 24
- 238000004891 communication Methods 0.000 description 10
- 238000005457 optimization Methods 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000009499 grossing Methods 0.000 description 4
- 238000012804 iterative process Methods 0.000 description 4
- 239000000126 substance Substances 0.000 description 4
- 238000013459 approach Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 241001122767 Theaceae Species 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 150000001875 compounds Chemical class 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000005670 electromagnetic radiation Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002329 infrared spectrum Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004611 spectroscopical analysis Methods 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
- 239000013076 target substance Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000011426 transformation method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/02—Preprocessing
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
Abstract
The invention relates to the field of spectral analysis baseline correction, in particular to an automatic convergence spectrum correction method and device for spectral analysis. The invention provides an automatic convergence spectrum correction method for spectrum analysis, which comprises the following steps: step S1, acquiring an original spectrum y and setting a smooth parameter lambda; step S2, weighting matrix WtCarrying out initialization; step S3, calculating a fitting spectrum baseline z according to a Whitchman algorithmt(ii) a Step S4, judging whether a cutoff condition is met, if the cutoff condition is not met, entering step S5, and if the cutoff condition is met, entering step S6; step S5, calculating and updating the weight matrix WtProceeding to step S3;and step S6, outputting the spectrum baseline, and obtaining final spectrum correction data according to the spectrum baseline correction. The invention improves the effectiveness and stability of spectrum baseline fitting and improves the reliability of spectrum data analysis and interpretation.
Description
Technical Field
The invention relates to the field of spectral analysis baseline correction, in particular to an automatic convergence spectrum correction method and device for spectral analysis.
Background
Spectroscopy, the subject of which is the study of the interaction of light with substances, is the generation of spectra by the interaction of electromagnetic or non-electromagnetic radiation with substances, with the aid of which it is possible to carry out theoretical studies and quantitative and qualitative analyses of substances.
Besides the information of the substance, background and random noise exist in the spectrum. Background noise, also known as baseline, interferes with the analysis and interpretation of the target signal, so spectral background signal subtraction, i.e. spectral correction, is the essential work for the basis of spectral analysis.
The baseline is usually a smooth curve independent of the target substance, and fitting and correcting of the baseline are performed manually or by a program. The algorithm of automatic baseline processing mainly comprises polynomial fitting, a punishment least square method, a wavelet transformation method, a derivative method and the like.
An adaptive weight iterative Penalized Least square method (airPLS) is a widely applied automatic baseline processing algorithm in the prior art. The airPLS spectral baseline fitting algorithm is derived from Whittaker (Whitcker) smoothing algorithm.
Whittaker in 1919 proposed a method for solving a fitted smooth curve by controlling the degree of fit and the degree of smoothness of the fitted curve, the degree of fit of the method is defined by the difference between the fitted spectrum and the original spectrum, the degree of smoothness is defined by the difference between adjacent elements of the fitted curve itself, and fitted smooth curves of different degrees of smoothness are obtained by controlling the smoothness parameters, see P EDINBURGH MATH SOC,1922,41: 63-75. DOI: 10.1017/S0013091500077853.
Eilers further studied the Whittaker smoothing algorithm and introduced a weight matrix for the need to fit a smooth curve when the raw spectral data was partially defective or non-uniform, see ANAL CHEM,2003,75(14): 3631-3636. DOI:10.1021/AC 034173T.
Zhimin Zhang et al define the weight matrix according to the characteristics of baseline fitting and generalize the smoothing algorithm into a baseline fitting algorithm by iteratively optimizing the weight matrix, see ANALYST,2010,135(5):1138.DOI: 10.1039/B922045C.
The invention CN202010191859.0 discloses a method, a system and a detection method for correcting a spectrogram baseline in tea near infrared spectrum analysis, and introduces a weighting function based on airPLS algorithm in order to solve the baseline fitting problem of multi-peak overlapping spectrum.
The automatic baseline fitting processing algorithm in the prior art generally has the following problems:
1) the condition of failure of baseline fitting is easy to occur, namely the intensity of a spectral peak is overestimated, even the algorithm generates a spectral peak which does not exist in an original spectrum, and the problem is caused to the analysis and the interpretation of spectral data;
2) the iterative optimization process is divergent, namely in the baseline iterative optimization process, the baseline difference of adjacent iterative times is increased along with the increase of the iterative times, so that the problem of uncontrollable quality of a fitted baseline is easily caused;
3) the weight range is not limited, and overlarge weight is easy to occur in the optimization process of the baseline, so that the matrix calculation is unstable, and the crash of a program or equipment is caused;
4) due to the fact that the iterative optimization process is divergent, the iterative cut-off condition can be defined only through the difference between the correction spectrum and the original spectrum, and the threshold value of the iterative cut-off condition changes along with the difference of the original spectrum, the effectiveness and consistency of the cut-off condition of the fitted spectrum baseline cannot be guaranteed, and the quality of the fitted spectrum baseline cannot be guaranteed.
Disclosure of Invention
The invention aims to provide an automatic convergence spectrum correction method and device for spectrum analysis, and solves the problem that the effectiveness and stability of a fitting baseline in the prior art are poor.
In order to achieve the above object, the present invention provides an automatic convergence spectrum correction method for spectrum analysis, comprising the steps of:
step S1, acquiring an original spectrum y and setting a smooth parameter lambda;
Step S3, calculating a fitting spectrum baseline z according to the Whittaker algorithmt;
Step S4, judging whether a cutoff condition is met, if the cutoff condition is not met, entering step S5, and if the cutoff condition is met, entering step S6;
step S5, calculating and updating the weight matrix WtIn step S3, the process proceeds to the weight matrix WtThe expression of (a) is:
wherein, WtIs the weight matrix for the t-th iteration,is WtMain diagonal line w oftThe ith element of (1);fitting spectral baseline z for the t-1 st timet-1The (i) th element of (a),correcting the spectrum d for the t-1 th fitt-1The ith element of (1), yiFor the i-th element of the original spectrum y,is a criterion for spectral peak and background region,andrespectively as a weighting function of a spectral peak region and a background region;
and step S6, outputting the spectrum baseline, and obtaining final spectrum correction data according to the spectrum baseline correction.
In one embodiment, in the step S3, the spectrum baseline ztThe expression of (a) is:
zt=(Wt+λDn'Dn)-1Wty;
wherein, WtThe coefficient is a weight matrix of the t iteration, the smooth parameter lambda is a weight coefficient for controlling the fitting degree and the smooth degree, D is a difference matrix, n is the order number of the difference matrix, and y is an original spectrum.
In one embodiment, the cutoff condition of step S4 is determined by comparing h (w)t,y,zt) And h (w)t-1,y,zt-1) Wherein h (w)t-1,y,zt-1) As a characteristic function of the result of the t-1 th iteration, h (w)t,y,zt) Is a characteristic function of the result of the t-th iteration.
In one embodiment, the cutoff condition of step S4 is:
||h(wt,y,zt)-h(wt-1,y,zt-1)||≤a2;
wherein, a2To calculate the accuracy parameter.
In one embodiment, the calculation accuracy parameter a2The following expression is satisfied:
where y is the original spectrum.
In one embodiment, the cutoff condition of step S4 is:
||h(wt,y,zt)||≤b2||h(wt-1,y,zt-1)||;
wherein, b2To calculate the accuracy parameter.
in one embodiment, the characteristic function h (w) of the result of the t-th iteration of step S4t,y,zt) Is defined as h (w)t,y,zt)=a3wt+b3y+c3zt+d3Wherein a is3、b3、c3And d3Is a constant value, wtThe main diagonal elements of the weight matrix for the t-th iteration, y the original spectrum, ztFitting spectral baseline for the t-th time.
In one embodiment, in step S4, a3=1,b3=d3=c 30 or a3=b3=d3=0,c 31 or a3=d3=0,b3=1,c3=-1。
In one embodiment, the cutoff condition of step S4 is furtherOne step includes limiting the maximum number of iterations tmax:
When the iteration number is larger than the maximum iteration number tmaxWhen it is, the cutoff condition is considered to be satisfied.
In one embodiment, the maximum number of iterations t of step S4max=10。
In an embodiment, the calculating of step S5 updates the weight matrix, which can be further detailed as:
step S51, defining a spectrum peak and a background area;
step S52, definition of weighting function of spectral peak region and background region.
In an embodiment, the determination condition of the spectral peak and the background region in step S51Is defined asWherein j (d)t) Correcting the spectrum d according to the t-th fittDefining the statistical indexes;
fitting correction spectrum d for the t timetThe statistical index of (1) includes dtAverage value of (2)Standard deviation ofMedian numberAnd quantile
In one embodiment of the present invention, the substrate is,wherein a is4,b4,c4,d4And e4Is a constant.
In one embodiment, in step S51, a4=c4=d4=e4=0,b 41 or a4=b4=c4=e4=0,d 41 or a4=b4=c4=d4=0,e 41 or a4=d4=e4=0,b4=1,
In one embodiment, in the step S52, the weight matrix WtOf (2) element(s)The following conditions are satisfied:
wherein, a5And b5Is a constant.
In one embodiment, in step S52, a50 and b5=1。
In one embodiment, in the step S52, the weighting function of the spectral peak region and the background regionAndthe following expression is satisfied:
In one embodiment, in the step S52, the weight matrix WtOf (2) element(s)The following conditions are satisfied:
In one embodiment, in step S52, a6=1。
Wherein, a7、b7And c7Is a constant.
In one embodiment, the constant a7And c7The following expression is satisfied: a is7>0 and c7>1。
In one embodiment, the constant a7、b7And c7The following expression is satisfied: a is7=1,b7=0,c7=2。
In order to achieve the above object, the present invention provides an automatic convergence spectrum correction apparatus for spectrum analysis, comprising:
a memory for storing instructions executable by the processor;
a processor for executing the instructions to implement the method of any one of the above.
To achieve the above object, the present invention provides a computer storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, perform the method as described in any one of the above.
According to the automatic convergence spectrum correction method and device for spectrum analysis, the problem of the existing spectrum baseline fitting technology based on the Whittaker algorithm is solved through a brand-new defined weight matrix and a cut-off condition, the effectiveness and stability of fitting a spectrum baseline are improved, and the reliability of analysis and interpretation of spectrum data is improved.
Drawings
The above and other features, properties and advantages of the present invention will become more apparent from the following description of the embodiments with reference to the accompanying drawings in which like reference numerals denote like features throughout the several views, wherein:
FIG. 1 discloses a flow chart of a method for automatically converging spectrum correction for spectral analysis according to an embodiment of the invention;
FIG. 2 is a diagram illustrating a spectral peak and background region determination rule according to an embodiment of the present invention;
FIG. 3 discloses a diagram of a baseline of a raw spectrum and a fitted spectrum according to an embodiment of the invention;
FIG. 4 is a diagram illustrating an original spectrum and a corrected spectrum according to an embodiment of the invention;
FIG. 5a discloses a diagram of a prior art raw spectrum and a fitted spectral baseline;
FIG. 5b discloses a schematic diagram of a prior art corrected spectrum;
FIG. 6a discloses a diagram of an original spectrum and a fitted spectral baseline according to a first embodiment of the present invention;
FIG. 6b discloses a schematic diagram of a corrected spectrum according to the first embodiment of the present invention;
FIG. 7a discloses a diagram of an original spectrum and a fitted spectral baseline according to a second embodiment of the present invention;
FIG. 7b discloses a diagram of a corrected spectrum according to a second embodiment of the present invention;
FIG. 8a discloses a diagram of an original spectrum and a fitted spectral baseline according to a third embodiment of the present invention;
FIG. 8b discloses a diagram of a corrected spectrum according to a third embodiment of the present invention;
FIG. 9 discloses a block diagram of an apparatus for automatically converging spectrum correction for spectral analysis according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a flowchart of an automatic convergence spectrum calibration method for spectrum analysis according to an embodiment of the present invention, and as shown in fig. 1, the automatic convergence spectrum calibration method for spectrum analysis according to the present invention includes the following steps:
step S1, acquiring an original spectrum y and setting a smooth parameter lambda;
Step S3, calculating a fitting spectrum baseline z according to the Whittaker algorithmt;
Step S4, judging whether a cutoff condition is met, if the cutoff condition is not met, entering step S5, and if the cutoff condition is met, entering step S6;
step S5, calculating and updating the weight matrix WtIn step S3, the process proceeds to the weight matrix WtThe expression of (a) is:
wherein, WtIs the weight matrix for the t-th iteration,is WtMain diagonal line w oftThe ith element of (1);fitting spectral baseline z for the t-1 st timet-1The (i) th element of (a),correcting the spectrum d for the t-1 th fitt-1The ith element of (1), yiFor the i-th element of the original spectrum y,is a determination condition of a spectral peak and a background region,Andrespectively as a weighting function of a spectral peak region and a background region;
and step S6, outputting the spectrum baseline, and obtaining final spectrum correction data according to the spectrum baseline correction.
Each step of the present invention is described in detail below.
And step S1, acquiring the original spectrum y and setting a smoothing parameter lambda.
The smoothness parameter lambda is used for controlling the weight of the fitting degree and the smoothness degree, and if the lambda is large, the smoothness degree of the fitting spectrum baseline is high, and the fitting degree is poor; and if the lambda is small, the smoothness degree of the fitted spectrum baseline is low, and the fitting degree is high.
Step S3, calculating a fitting spectrum baseline z according to the Whittaker algorithmt。
Calculating according to Whittaker algorithm to obtain spectrum baseline ztThe expression of (a) is:
zt=(Wt+λDn'Dn)-1Wty;
wherein, WtThe weight matrix of the t-th iteration, and the smoothness parameter lambda is the weight for controlling the degree of fitting and the degree of smoothnessAnd the coefficient, D is a difference matrix, n is the order of the difference matrix, and y is the original spectrum.
Difference matrix DnIs defined as:
where E is an m × m identity matrix, and E ═ E1;…ei;…em),E∈R(m,m),ei=(ei1,...eij,...eim);
When i ═ j, e ij1 is ═ 1; when i ≠ j, eij=0。
When n is equal to 1, the compound is,
Step S4, judging whether a cutoff condition is met, if the cutoff condition is not met, entering step S5, and if the cutoff condition is met, entering step S6;
the cut-off condition is controlled by the characteristic function difference and the maximum iteration times of adjacent iteration results, and the cut-off condition difference caused by the original spectrum difference can be overcome, so that the effectiveness and consistency of the cut-off condition of the fitting baseline are controlled, and the quality of the fitting spectrum baseline is further ensured.
In the present embodiment, the cutoff condition is determined by comparing h (w)t,y,zt) And h (w)t-1,y,zt-1) Wherein h (w)t-1,y,zt-1) A characteristic function, h (w), representing the result of the t-1 th iterationt,y,zt) Is a characteristic function of the result of the t-th iteration.
Further, the cutoff condition may be | | | h (w)t,y,zt)-h(wt-1,y,zt-1)||≤a2Wherein a is2To calculate the accuracy parameter.
Calculating the precision parameter a2According to the requirement of calculation accuracy.
Further, the cutoff condition may be | | | h (w)t,y,zt)||≤b2||h(wt-1,y,zt-1) I, where b2To calculate the accuracy parameter.
Calculating a precision parameter b2According to the requirement of calculation accuracy.
in this embodiment, the function h (w) of the characteristics of the result of the t-th iterationt,y,zt) Is defined as h (w)t,y,zt)=a3wt+b3y+c3zt+d3Wherein a is3、b3、c3And d3Is a constant value, wtThe main diagonal elements of the weight matrix for the t-th iteration, y the original spectrum, ztFitting spectral baseline for the t-th time.
Preferably, a3=1,b3=d3=c 30 or a3=b3=d3=0,c 31 or a3=d3=0,b3=1,c3=-1。
Further, the cutoff condition further includes limiting the maximum number of iterations tmaxWhen the number of iterations is greater than the maximum number of iterations tmaxWhen it is, the cutoff condition is considered to be satisfied.
Preferably, the maximum number of iterations tmax=10。
Step S5, calculating and updating the weight matrix WtThe process proceeds to step S3.
The baseline fitting of the spectrum is similar to the smoothness of the spectrum, and the fitting degree and the smoothness degree between the fitted spectrum and the original spectrum need to be controlled, and the difference is that the baseline fitting only needs to control the fitting degree of the background area, and the peak area only needs to control the smoothness degree of the curve and does not need to control the fitting degree. The weight of a spectrum peak area is smaller than that of a background area by defining a weight matrix W of the Whittaker algorithm, so that the fitting degree is dominated by the background area, and the purpose of selectively fitting the background area to obtain a fitting spectrum baseline is achieved.
Thus, the key to the baseline fitting is the definition of the weight matrix, which can be iteratively applied to WtOptimized, the weight matrix WtThe expression of (a) is:
wherein, WtIs the weight matrix for the t-th iteration,is WtMain diagonal line w oftThe ith element of (1);fitting spectral baseline z for the t-1 st timet-1The (i) th element of (a),correcting the spectrum d for the t-1 th fitt-1The ith element of (1), yiFor the i-th element of the original spectrum y,is a criterion for spectral peak and background region,andrespectively, the spectral peak region and the background region.
In an embodiment, the step S5 of calculating the updated weight matrix may be further detailed as: step S51, definition of spectral peak and background regions, and step S52, definition of weighting functions of spectral peak regions and background regions.
And step S51, definition of a spectrum peak and a background area.
Fig. 2 is a schematic diagram illustrating a determination rule of spectral peaks and background regions according to an embodiment of the present invention, as shown in fig. 2,the determination conditions for the spectral peak and background region are:
when in useThe time is a spectrum peak region, namely a square frame filling region in the figure 2;
when in useThe time is the background area, i.e. the area outside the filled area of the square in fig. 2.
Furthermore, the determination conditions of the spectral peak and the background regionIs defined asWherein j (d)t) Correcting spectra from the t-th fitdtDefining the statistical indexes;
fitting correction spectrum d for the t timetThe statistical index of (1) includes dtAverage value of (2)Standard deviation ofMedian numberAnd quantile
In a further step, the method comprises the following steps of,wherein a is4,b4,c4,d4And e4Is a constant.
In this example, by dtThe statistical indexes define the spectrum peak and the background area range, effectively avoid the problems that the existing algorithm overestimates the spectrum peak area intensity and generates the spectrum peak which does not exist in the original spectrum, can improve the effectiveness of fitting the spectrum base line and improve the reliability of analyzing and reading the spectrum data; in addition, the iterative process of fitting the spectral baseline is converted from the divergence state to the convergence state of the existing method, so that the stability of fitting the spectral baseline is improved.
Step S52, definition of weighting function of spectral peak region and background region.
Weight matrix passing of spectral peak and background regionIs determined whenWhen the spectrum is detected, the spectrum peak region is obtained,when in useWhen the image is in the background area, the image is the background area,
wherein, a5And b5Is a constant.
Preferably, a50 and b5=1。
In this embodiment, the weight matrix W is usedtThe optimization limits the weight range, and avoids the problem of unstable matrix calculation caused by overlarge weight in the optimization process of the existing method, thereby improving the stability of the algorithm.
Further, a weighting function of the spectral peak region and the background regionAndthe following expression is satisfied:
Preferably, a6=1。
Preferably, the first and second liquid crystal display panels are,with t andincreasing and decreasing.
Wherein, a7、b7And c7Is a constant.
Preferably, constant a7And c7The following expression is satisfied: a is7>0 and c7>1。
Preferably, constant a7、b7And c7The following expression is satisfied: a is7=1,b7=0,c7=2。
And step S6, outputting the spectrum baseline, and obtaining final spectrum correction data according to the spectrum baseline correction.
FIG. 3 illustrates a diagram of an original spectrum and a fitted spectral baseline that tends to converge as the number of iterations increases, as shown in FIG. 3, in accordance with an embodiment of the present invention.
FIG. 4 is a diagram illustrating an original spectrum and a corrected spectrum according to an embodiment of the present invention, wherein the corrected spectrum tends to converge as the number of iterations increases, as shown in FIG. 4.
The technical effect of the present invention will be described below by comparing three embodiments according to the present invention with the prior art. In order to compare the technical effects of the invention and the prior art, the iteration cut-off condition only sets the maximum iteration time limit, wherein the maximum iteration time tmax=10。
Fig. 5a shows a diagram of a baseline of a prior art raw spectrum and a fitted spectrum, fig. 5b shows a diagram of a prior art corrected spectrum, and in the prior art shown in fig. 5a and 5b, the airPLS spectrum baseline fitting algorithm most closely resembling the present invention is used.
Fig. 5a shows a fitted spectrum baseline of an original spectrum and different iterations, fig. 5b shows a corrected spectrum for different iterations, and as the number of iterations increases, the fitted baseline of the prior art in fig. 5a diverges, and the corresponding corrected spectrum in fig. 5b also diverges.
The fitted baselines in FIG. 5a are at 700 and 2800cm-1The region deviates from the original spectrum, so that the corrected spectrum in FIG. 5b, at 700cm-1The spectral peak intensity of the region was overestimated at 2800cm-1The regions show spectral peaks that were not present in the original spectrum. The limitation of the prior art causes the iterative spectrum baseline fitting result to be dispersed, so that the spectral peak is overestimated and a new spectral peak source appears, and the spectrum baseline fitting is invalid. According to the prior art, the divergence state becomes more serious as the number of iterations increases. In practical application, divergence superposition of the original spectrum in the prior art makes the baseline fitting result more uncontrollable and more prone to failure.
Fig. 6a discloses a diagram of an original spectrum and a fitted spectrum baseline according to a first embodiment of the present invention, and fig. 6b discloses a diagram of a corrected spectrum according to a first embodiment of the present invention, and in the first embodiment shown in fig. 6a and fig. 6b, only the optimized spectrum peak and background region definitions proposed by the present invention are used, and the weight matrix adopts the prior art shown in fig. 5a and fig. 5 b.
In the first embodiment, the determination condition of the spectral peak and the background region is a4=c4=d4=e4=0,b 41 is ═ 1, i.e
Fig. 6a is a fitted spectral baseline of the original spectrum with different iterations, and fig. 6b is a corrected spectrum with different iterations. As the number of iterations increases, the fitted baseline in fig. 6a overlaps the original spectrum in the background region, and the intensity of the corrected spectrum in fig. 6b approaches 0 in the background region.
The first embodiment circumvents the problem of overestimating the spectral peak regions and generating spectral peaks that are not present in the original spectrum of the prior art method shown in fig. 5a and 5b, while allowing the fitted spectral baseline in the iterative process to change from the divergent state to the convergent state of the prior art method.
The partial optimization results from the definition of the spectral peak region, from which it can be speculated that when a4=b4=c4=e4=0,d 41 or a4=b4=c4=d4=0,e 41 or a4=d4=e4=0,b4=1,All can reach a4=c4=d4=e4=0,b 41 the same or similar effect.
Fig. 7a discloses a diagram of the original spectrum and the fitted spectrum baseline according to the second embodiment of the present invention, and fig. 7b discloses a diagram of the corrected spectrum according to the second embodiment of the present invention, and in the second embodiment shown in fig. 7a and fig. 7b, only the weight matrix definition proposed by the present invention is used, and the spectrum peak and background region definition uses the prior art as shown in fig. 5a and fig. 5 b.
In a second embodiment, the weight matrix is passedAnddefinition, which defines the range of weights
FIG. 7a is a spectrum baseline of the original spectrum and the corrected spectrum of different iterations, FIG. 7b is a spectrum baseline of the corrected spectrum of different iterations, and the second embodiment defines the range of the weight matrix while obtaining the similar spectrum baseline fitting effect as the prior art method shown in FIG. 5a and FIG. 5bThereby avoiding the weightThe matrix calculation is unstable due to overlarge, and the stability of the algorithm is improved.
Fig. 8a discloses a diagram of an original spectrum and a fitted spectrum baseline according to a third embodiment of the present invention, and fig. 8b discloses a diagram of a corrected spectrum according to the third embodiment of the present invention, and the optimized spectrum peak and background region definitions and weight matrix definitions proposed by the present invention are adopted in the third embodiment shown in fig. 8a and fig. 8 b.
In the third embodiment, the determination condition of the spectral peak and the background region is a4=c4=d4=e4=0,b 41 is ═ 1, i.eWeight matrix passingAnddefinition, which defines the range of weights
Fig. 8a is a fitted spectral baseline of the original spectrum with different iterations, and fig. 8b is a corrected spectrum with different iterations. As the number of iterations increases, the fitted baseline in fig. 8a overlaps the original spectrum in the background region, and the intensity of the corrected spectrum in fig. 8b approaches 0 in the background region.
The third embodiment avoids the problems of overestimating the spectral peak region and generating spectral peaks which do not exist in the original spectrum in the existing method shown in fig. 5a and 5b, and simultaneously can change the fitted spectral baseline in the iterative process from the divergence state of the existing method to the convergence state; further, the third embodiment defines the range of the weight matrixThe problem of unstable matrix calculation caused by overlarge weight is avoided, and the stability of the algorithm is improved.
FIG. 9 discloses a block diagram of an apparatus for automatically converging spectrum correction for spectral analysis according to an embodiment of the present invention. The automatically converging spectrum correction apparatus for spectrum analysis may include an internal communication bus 701, a processor (processor)702, a Read Only Memory (ROM)703, a Random Access Memory (RAM)704, a communication port 705, and a hard disk 707. The internal communication bus 701 may enable data communication between components of the auto-convergent spectrum correction device for spectral analysis. The processor 702 may make the determination and issue the prompt. In some embodiments, the processor 702 may be comprised of one or more processors.
The communication port 705 may enable data transmission and communication between the automatically converging spectral correction apparatus for spectral analysis and an external input/output device. In some embodiments, an automatically converging spectrum correction device for spectral analysis may send and receive information and data from a network through communication port 705. In some embodiments, the automatically converging spectral correction apparatus for spectral analysis may be in wired form for data transfer and communication with an external input/output device via input/output 706.
The self-converging spectrum correction device for spectral analysis may also include various forms of program storage units and data storage units, such as a hard disk 707, Read Only Memory (ROM)703 and Random Access Memory (RAM)704, capable of storing various data files for computer processing and/or communication, and possibly program instructions for execution by the processor 702. The processor 702 executes these instructions to implement the main parts of the method. The results of the processing by the processor 702 are communicated to an external output device via the communication port 705 for display on a user interface of the output device.
For example, the implementation process file of the above-mentioned automatic convergence spectrum correction method for spectrum analysis may be a computer program, stored in the hard disk 707, and recorded in the processor 702 for execution, so as to implement the method of the present application.
When the implementation process file of the automatic convergence spectrum correction method for spectrum analysis is a computer program, the implementation process file can also be stored in a computer readable storage medium as an article of manufacture. For example, computer-readable storage media can include but are not limited to magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD)), smart cards, and flash memory devices (e.g., electrically Erasable Programmable Read Only Memory (EPROM), card, stick, key drive). In addition, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" can include, without being limited to, wireless channels and various other media (and/or storage media) capable of storing, containing, and/or carrying code and/or instructions and/or data.
The invention provides an automatic convergence spectrum correction method and device for spectrum analysis, which have the following beneficial effects:
1) correcting the spectrum d by fittingtThe statistical indexes define the spectral peak and the background area, so that the problems that the intensity of the spectral peak area is overestimated and the spectral peak which does not exist in the original spectrum is generated in the conventional method are effectively avoided, the effectiveness of spectral baseline fitting is improved, and the reliability of spectral data analysis and interpretation is improved;
2) correcting the spectrum d by fittingtThe statistical indexes define a spectrum peak and a background area, so that the iterative process of spectrum baseline fitting is changed from a divergence state to a convergence state of the existing method, and the stability of fitting the spectrum baseline can be improved;
3) optimizes the definition of the spectrum peak and the background weight matrix, obtains the similar spectrum baseline fitting effect with the prior method, and limits the range of the weight matrixThe problem of unstable matrix calculation caused by overlarge weight is avoided, and the stability of the algorithm is improved;
4) based on the convergence characteristic of the algorithm, the cut-off condition is defined through the characteristic function of adjacent iteration results, the dependence of the cut-off condition on the original spectrum is avoided, the cut-off condition standard is defined by the fitting result, the effectiveness and consistency of the cut-off condition of the fitting baseline are controlled, and the quality of the fitting spectral baseline is further ensured.
While, for purposes of simplicity of explanation, the methodologies are shown and described as a series of acts, it is to be understood and appreciated that the methodologies are not limited by the order of acts, as some acts may, in accordance with one or more embodiments, occur in different orders and/or concurrently with other acts from that shown and described herein or not shown and described herein, as would be understood by one skilled in the art.
As used in this application and the appended claims, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to be inclusive in the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements.
The embodiments described above are provided to enable persons skilled in the art to make or use the invention and that modifications or variations can be made to the embodiments described above by persons skilled in the art without departing from the inventive concept of the present invention, so that the scope of protection of the present invention is not limited by the embodiments described above but should be accorded the widest scope consistent with the innovative features set forth in the claims.
Claims (20)
1. A method for automatically converging spectra for spectral analysis, comprising the steps of:
step S1, acquiring an original spectrum y and setting a smooth parameter lambda;
Step S3, calculating a fitting spectrum baseline z according to a Whitchman algorithmt;
Step S4, judging whether a cutoff condition is met, if the cutoff condition is not met, entering step S5, and if the cutoff condition is met, entering step S6;
step S5, calculating and updating the weight matrix WtIn step S3, the process proceeds to the weight matrix WtThe expression of (a) is:
wherein, WtIs the weight matrix for the t-th iteration,is WtMain diagonal line w oftThe ith element of (1);fitting spectral baseline z for the t-1 st timet-1The (i) th element of (a),correcting the spectrum d for the t-1 th fitt-1The ith element of (1), yiFor the i-th element of the original spectrum y,is a criterion for spectral peak and background region,andrespectively as a weighting function of a spectral peak region and a background region;
and step S6, outputting the spectrum baseline, and obtaining final spectrum correction data according to the spectrum baseline correction.
2. The method for automatically converging spectrum of claim 1, wherein in step S3, the spectrum baseline ztThe expression of (a) is:
zt=(Wt+λDn'Dn)-1Wty;
wherein, WtThe coefficient is a weight matrix of the t iteration, the smooth parameter lambda is a weight coefficient for controlling the fitting degree and the smooth degree, D is a difference matrix, n is the order number of the difference matrix, and y is an original spectrum.
3. The method for automatically converging spectrum of claim 1, wherein the cut-off condition of step S4 is determined by comparing h (w)t,y,zt) And h (w)t-1,y,zt-1) Wherein h (w)t-1,y,zt-1) As a characteristic function of the result of the t-1 th iteration, h (w)t,y,zt) Is a characteristic function of the result of the t-th iteration.
4. The method for automatically converging spectrum correction for spectral analysis of claim 3, wherein the cutoff conditions of step S4 are:
||h(wt,y,zt)-h(wt-1,y,zt-1)||≤a2;
wherein, a2To calculate the accuracy parameter.
6. The method for automatically converging spectrum correction for spectral analysis of claim 3, wherein the cutoff conditions of step S4 are:
||h(wt,y,zt)||≤b2||h(wt-1,y,zt-1)||;
wherein, b2To calculate the accuracy parameter.
8. the method for automatically converging spectrum correction for spectral analysis of claim 3, wherein the characteristic function h (w) of the result of the t-th iteration of step S4t,y,zt) Is defined as h (w)t,y,zt)=a3wt+b3y+c3zt+d3Wherein a is3、b3、c3And d3Is a constant value, wtThe main diagonal elements of the weight matrix for the t-th iteration, y the original spectrum, ztFitting spectral baseline for the t-th time.
9. The method for automatically converging spectrum correction for spectral analysis of claim 8, wherein in said step S4:
a3=1,b3=d3=c30 or
a3=b3=d3=0,c31 or
a3=d3=0,b3=1,c3=-1。
10. The method for automatically converging spectrum correction for spectral analysis according to claim 1, wherein the determination condition of the spectral peak and background region of step S5Is defined asWherein j (d)t) Correcting the spectrum d according to the t-th fittDefining the statistical indexes;
fitting correction spectrum d for the t timetThe statistical index of (1) includes dtAverage value of (2)Standard deviation ofMedian numberAnd quantile
Wherein, a4,b4,c4,d4And e4Is a constant.
13. The method for automatically converging spectrum correction for spectral analysis of claim 12, wherein in step S5, a50 and b5=1。
17. The method of automatically converging spectrum correction for spectral analysis of claim 16, wherein the constant a is7And c7The following expression is satisfied: a is7>0 and c7>1。
18. The method of automatically converging spectrum correction for spectral analysis of claim 16, wherein the constant a is7、b7And c7The following expression is satisfied: a is7=1,b7=0,c7=2。
19. An automatically converging spectrum correction apparatus for spectral analysis, comprising:
a memory for storing instructions executable by the processor;
a processor for executing the instructions to implement the method of any one of claims 1-18.
20. A computer storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, perform the method of any of claims 1-18.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110939238.0A CN113673409A (en) | 2021-08-16 | 2021-08-16 | Automatic convergence spectrum correction method and device for spectrum analysis |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110939238.0A CN113673409A (en) | 2021-08-16 | 2021-08-16 | Automatic convergence spectrum correction method and device for spectrum analysis |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113673409A true CN113673409A (en) | 2021-11-19 |
Family
ID=78543101
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110939238.0A Pending CN113673409A (en) | 2021-08-16 | 2021-08-16 | Automatic convergence spectrum correction method and device for spectrum analysis |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113673409A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408912A (en) * | 2008-11-21 | 2009-04-15 | 天津师范大学 | Method for automatically extracting characteristic function of traditional Chinese medicine pulse manifestation |
US20160259792A1 (en) * | 2015-03-05 | 2016-09-08 | Bio-Rad Laboratories, Inc. | Optimized spectral matching and display |
CN108844939A (en) * | 2018-03-14 | 2018-11-20 | 西安电子科技大学 | Raman spectrum based on asymmetric weighted least-squares detects baseline correction method |
CN111125625A (en) * | 2019-11-29 | 2020-05-08 | 北京遥测技术研究所 | Spectrum baseline calculation method based on embedded system |
CN111307751A (en) * | 2020-03-18 | 2020-06-19 | 安徽大学 | Spectrogram baseline correction method, system and detection method in tea near infrared spectrum analysis |
CN112102898A (en) * | 2020-09-22 | 2020-12-18 | 安徽大学 | Method and system for identifying mode of spectrogram in solid fermentation process of vinegar grains |
-
2021
- 2021-08-16 CN CN202110939238.0A patent/CN113673409A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408912A (en) * | 2008-11-21 | 2009-04-15 | 天津师范大学 | Method for automatically extracting characteristic function of traditional Chinese medicine pulse manifestation |
US20160259792A1 (en) * | 2015-03-05 | 2016-09-08 | Bio-Rad Laboratories, Inc. | Optimized spectral matching and display |
CN108844939A (en) * | 2018-03-14 | 2018-11-20 | 西安电子科技大学 | Raman spectrum based on asymmetric weighted least-squares detects baseline correction method |
CN111125625A (en) * | 2019-11-29 | 2020-05-08 | 北京遥测技术研究所 | Spectrum baseline calculation method based on embedded system |
CN111307751A (en) * | 2020-03-18 | 2020-06-19 | 安徽大学 | Spectrogram baseline correction method, system and detection method in tea near infrared spectrum analysis |
CN112102898A (en) * | 2020-09-22 | 2020-12-18 | 安徽大学 | Method and system for identifying mode of spectrogram in solid fermentation process of vinegar grains |
Non-Patent Citations (2)
Title |
---|
杨桂燕;李路;陈和;陈思颖;张寅超;郭磐;: "基于广义Whittaker平滑器的拉曼光谱基线校正方法", 中国激光, no. 09, 10 September 2015 (2015-09-10) * |
马真;马恩;熊飞兵;许国澎;李冲;: "动态移动最小二乘多项式平滑的拉曼全自动基线校正算法", 应用激光, no. 04, 15 August 2017 (2017-08-15) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Pitt et al. | On some properties of Markov chain Monte Carlo simulation methods based on the particle filter | |
Battaglia et al. | Practical considerations in raking survey data | |
Gordy | Saddlepoint approximation of CreditRisk+ | |
US9609180B2 (en) | Radiometric calibration from noise distributions | |
Fengler et al. | Semi-nonparametric estimation of the call-option price surface under strike and time-to-expiry no-arbitrage constraints | |
Xing et al. | Robust minimum variance portfolio with L-infinity constraints | |
Hausman et al. | Errors in the dependent variable of quantile regression models | |
Tsaig et al. | Analyzing the impact of credit migration in a portfolio setting | |
Engelmann et al. | Calibration of the Heston stochastic local volatility model: A finite volume scheme | |
Zhan et al. | Kernel approaches for differential expression analysis of mass spectrometry-based metabolomics data | |
Chockalingam et al. | An approximate moving boundary method for American option pricing | |
Meyer et al. | Adaptive rejection Metropolis sampling using Lagrange interpolation polynomials of degree 2 | |
Düring et al. | High-order compact finite difference scheme for option pricing in stochastic volatility jump models | |
Charmpi et al. | Optimizing network propagation for multi-omics data integration | |
Huang et al. | Estimating precipitation extremes using the log‐histospline | |
Chernyavskiy et al. | Correlated Poisson models for age‐period‐cohort analysis | |
CN113673409A (en) | Automatic convergence spectrum correction method and device for spectrum analysis | |
Forneron | A Sieve‐SMM Estimator for Dynamic Models | |
Wei et al. | Two-stage iteratively reweighted smoothing splines for baseline correction | |
Giribone et al. | Option pricing via radial basis functions: Performance comparison with traditional numerical integration scheme and parameters choice for a reliable pricing | |
Tocino et al. | Asymptotic mean-square stability of two-step Maruyama schemes for stochastic differential equations | |
Ďuriš et al. | Comparison of the analytical approximation formula and newton's method for solving a class of nonlinear Black–Scholes parabolic equations | |
CN115546157A (en) | Method, device and storage medium for evaluating radiation quality of satellite image | |
Tong et al. | Computing equilibrium prices for a capital asset pricing model with heterogeneous beliefs and margin-requirement constraints | |
CN115631497A (en) | Industrial and commercial management system and method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |