Background technique
Raman spectrum (Raman spectroscopy) is a kind of scattering spectrum based on Raman scattering effect, by India's object
Neo-confucian Raman had found, has many advantages, such as non-intruding, not damaged and radiationless.As the introducing of laser light source, signal are examined
The raising of survey technology and popularizing for computer technology, Raman spectroscopy are just increasingly being applied to chemical, biomedical inspection
It surveys and the fields such as material production.
However influenced by instrument system, the detection factors such as environment and sample, the Raman spectrum of acquisition detects letter
Number there is always different degrees of noise and background interferences.The phenomenon that increasing Raman spectrum baseline by factors such as fluorescence backgrounds, is known as
Baseline drift.When baseline drift is larger, the extraction of raman characteristic peak and the identification of measured matter will seriously affect, it is fixed to reduce
The accuracy of property quantitative analysis.Therefore, baseline correction is directly related to the quality of spectrum analysis quality, the research one to this respect
Directly by vast focus of attention.The method for reducing baseline drift at present is mainly two aspects, the improvement of Raman spectrum analysis instrument
And data processing method.Raman spectrum analysis instrument improvement higher cost and the influence that cannot be completely eliminated fluorescent material, and count
According to processing method, then cost is relatively low and effect is preferable.Existing fitting of a polynomial and piecewise polynomial fitting algorithm are most common
Baseline correction method, but it is more all to there is a problem of that fluorescence background remains, it is poor so as to cause baseline correction accuracy, it is unfavorable for
Improve the accuracy of gas Raman spectral detection.And wavelet transformation baseline correction is that Raman signal is decomposed into a series of sine waves
Superposition, the low frequency of signal and high frequency can be separated, it is quick, accurate to have many advantages, such as, but decomposition scale rely on experience, for
Different practical problems is difficult to reach optimization process effect, and baseline correction is easily distorted or insufficient, calculation amount and calculates multiple
Miscellaneous degree is also relatively high.
Summary of the invention
Problem to be solved by this invention is to propose one kind for deficiency existing for existing Raman spectrum baseline correction method
Minimum gas Raman spectrum detect baseline correction envelope alternative manner, this method be based on spline interpolation algorithm and
Envelope line interation thought can more accurately indicate the baseline of gas Raman spectrum, reduce gas Raman spectrum fluorescence background
Residual, improve the quantitative analysis accuracy in detection of gas concentration.
In order to achieve the above objectives, The technical solution adopted by the invention is as follows:
A kind of envelope alternative manner of minimum gas Raman spectrum detection baseline correction, steps are as follows:
Step 1: denoising is carried out to the gas Raman spectrum of acquisition, the gas Raman spectrum after definition denoising is W;
Step 2: seeking numerical differentiation to W with diff function, if W shares N+1 point, then after numerical differentiation
It is worth to N, will wherein the 1st be stored in matrix d1 to N-1 value, the 2nd into N value deposit matrix d2;
Step 3: with the slope of find function and minimum point left-most curve less than 0 and the right slope of a curve is big
Condition in 0 acquires minimum point indmin, i.e. indmin=find (d1 < 0 the & of d1.*d2 < 0)+1;
Step 4: the minimum point indmin acquired with spline interpolation function spline and step 3 is asked
Obtain first enveloped line L1;
Step 5: judging W spectral peak density, if spectral peak closeness is consistent before and after W, repeats step 2 to step 4, right
L 1It carries out m iteration and acquires envelope L2;If spectral peak closeness is different before and after W, L is separated1 The condensed section of spectral peak with
Sparse section, respectively with step 2 to step 4 to L1 Sparse section iteration m times, to condensed section iteration m+1 times, obtain envelope
Line L2, as gas Raman spectral detection baseline.Wherein the number of iterations m can be increased and decreased according to W situation, and m is usually
2~4。
Step 6: W subtracts baseline L 2, that is, uses the envelope of iteration as baseline, and original spectrum subtracts envelope method
The baseline of formation completes the baseline correction to W.
In step one of the invention, denoising is carried out to resulting gas Raman spectrum is measured, keeps spectral line smooth, it can
To guarantee minimum point is sought in step 3 accuracy, reality of the envelope for seeking step 5 closer to gas Raman spectrum
Border baseline reduces the residual of fluorescence background to a certain extent.
In the step of inventing two, since computer can only handle discrete data, therefore introduces diff function and ask numerical value micro-
Point, to obtain the Δ y of discrete data under unit abscissa Δ x, and replace with this slope of gas Raman curve of spectrum.
In step three of the invention, using minimum point left-most curve slope less than 0 and the right slope of curve is greater than
0 property can accurately acquire minimum point abscissa all in gas Raman spectrum in conjunction with find function.In addition, examining
The missing for considering data total number after numerical differentiation in step 2, has carried out the abscissa of minimum point plus 1 compensates, and guarantees
The accuracy of baseline correction.
In step four of the invention, five, the gas Raman spectrum inconsistent to front and back spectral peak closeness is carried out at segmentation
Reason, and envelope line interation thought is introduced, using the mode of the extra sparse section of the number of iterations of condensed section the number of iterations, gas is considered comprehensively
The characteristics of body Raman spectrum, embodies the versatility of the envelope alternative manner of minimum gas Raman spectrum detection baseline correction.
The method of the present invention processing result can relatively accurately correct the baseline of minimum gas Raman spectrum, after reducing correction
Spectrum fluorescence background residual, improve the accuracy of gas Raman spectral detection, quantitative analysis for gas Raman spectrum and answer
With with very important practical significance.The advantages of this method is specific as follows:
1, after using the envelope alternative manner of minimum gas Raman spectrum detection baseline correction, it is glimmering spectrum can be effectively reduced
Light background residual, improves the accuracy of gas Raman spectral detection.
, comprehensively consider gas Raman spectrum the characteristics of, to gas Raman spectrum carry out segment processing, condensed section the number of iterations
More, sparse section of the number of iterations is few, embodies the general of the envelope alternative manner of minimum gas Raman spectrum detection baseline correction
Property.
Specific embodiment
For a better understanding of the present invention, below with reference to the embodiment content that the present invention is further explained.
If Fig. 1 show the envelope alternative manner flow chart of minimum gas Raman spectrum detection baseline correction, with micro-
Measure gas H 2For, in this way to H2Raman spectrum carries out baseline correction processing, is realized with MATLAB software programming,
Specific embodiment is as follows:
1. is using Raman spectrum analysis system to micro H 2 Raman spectroscopy measurement is carried out, with Wavelet Modulus Maxima Algorithm
Denoising is carried out to 2 Raman spectrum of H of acquisition, the H after definition denoising2Raman spectrum data is W, and result is as schemed
Shown in 2.
2. is based on diff function and seeks numerical differentiation to W, W shares 2000 points, obtains after numerical differentiation
1999 values, the 1st to 1998 value is stored in matrix d1, and the 2nd to 1999 value is stored in matrix d2.
3. is based on find function minimizing point indmin and carries out adding 1 to compensate to it, i.e. and indmin=
Find (d1 < 0 the & of d1.*d2 < 0)+1 minimum point acquired.
4. acquires first enveloped line L with spline interpolation function spline and minimum point indmin 1;
5. is in H2 The 1000th point of Raman spectrum data punishes section, to the right and left respectively repeat steps 3. and 4., into
Capable iteration twice, obtains the envelope L of iteration 2 As shown in Fig. 3.
6. the envelope L of iteration2Instead of baseline, the ordinate that original spectrum W and baseline should be put subtracts each other completion
Baseline correction, comparative analysis result is as shown in Fig. 4 before and after baseline correction.