Spectral wavelength sliding correction system and method
By adding NO standard gas tanks to the optical path of the spectral analyzer and calculating the wavelength drift using the correlation coefficient method or the least squares method, the problem that deuterium lamp spectral analyzer cannot accurately correct the wavelength drift is solved, and the correction accuracy and Equipment reliability.
Patent Information
- Application Number
- CN202411540363.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-07
AI Technical Summary
The spectral analyzer with deuterium lamp as a light source cannot accurately calculate the wavelength drift compared to the reference background spectrum under the background spectrum to be corrected, resulting in the inability to accurately realize the calibration of the spectral analyzer.
By adding NO standard gas tanks to the optical path, three notches are created in the background gas, which facilitates the calibration of the spectroscopy analyzer. Use the correlation coefficient method or least squares method to calculate the wavelength drift between the background spectrum to be corrected and the reference background spectrum, and improve the correction accuracy through interpolation and polynomial fitting.
The calibration accuracy of the spectrometer under wavelength drift is improved, the online concentration inversion process is simplified, and the reliability of the spectrometer is ensured.
Smart Images

Figure CN119394941A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a spectrum analyzer, in particular to a spectrum wavelength sliding correction system and method, belonging to the technical field of environmental detection. Background Art
[0002] A spectrometer is a device that identifies the type and concentration of a gas by detecting the wavelength position and intensity corresponding to the spectral curve. It is mainly used to monitor the concentration of the gas to be measured. Its principle is to use the absorption cross section of the spectral curve of the gas to be measured to identify the gas, and to invert the concentration of the gas based on the absorption intensity. However, the spectrometer often has wavelength drift after running for a period of time, so it is necessary to calibrate the spectrometer regularly to ensure the measurement accuracy. At present, the method of calibrating the spectrometer is mostly to determine the drift of the current system by comparing the reference background spectrum curve measured at the factory with the background spectrum curve to be calibrated measured at regular intervals. However, this method is not applicable to the spectrometer with a deuterium lamp as the light source. Since the background gas spectrum formed by the deuterium lamp is almost a smooth monotonic curve in the absorption band of the commonly used gas to be measured, there is no obvious peak and trough. Therefore, it is impossible to accurately compare the drift between the reference background spectrum and the background spectrum to be calibrated measured at regular intervals, and thus it is impossible to accurately calibrate the spectrometer. Summary of the invention
[0003] In order to overcome the deficiencies of the prior art, the present invention provides a spectrum wavelength sliding correction system and method, which can perform spectrum wavelength sliding correction on a spectrum analyzer using a deuterium lamp as a light source, thereby improving the measurement accuracy of the spectrum analyzer.
[0004] A spectrum wavelength sliding correction system comprises a deuterium lamp, a measuring cell and a spectrum analyzer, wherein a storage module, a calculation module and a correction module are arranged in the spectrum analyzer, a light source signal emitted by the deuterium lamp passes through the measuring cell and is received by a detector in the spectrum analyzer, and further comprises an NO standard gas tank arranged at any position of the optical path between the deuterium lamp and the detector of the spectrum analyzer, the storage module is configured to store spectrum data, the calculation module is configured to calculate the wavelength offset of the spectrum analyzer, and the correction module is configured to correct the spectrum analyzer according to the wavelength offset; NO gas is sealed in the NO standard gas tank, and both ends of the NO standard gas tank are made of transparent materials to allow light to pass through.
[0005] Furthermore, the transparent material at both ends of the NO standard gas tank is high-purity quartz; a timing module is also provided in the spectrometer, and the timing module is configured to regularly collect the spectral data to be corrected and send it to the storage module.
[0006] A spectrum wavelength sliding correction method comprises the following steps:
[0007] S1, when the spectrum analyzer leaves the factory or is used for the first time, background gas is introduced into the measuring cell, and a deuterium lamp spectrum with NO standard gas characteristics is collected and stored in the spectrum analyzer as a reference background spectrum;
[0008] S2, regularly introduce background gas into the measuring cell, and collect the deuterium lamp spectrum with NO standard gas characteristics as the background spectrum to be corrected;
[0009] S3, normalizing and self-differentiating the background spectrum to be corrected and the reference background spectrum to obtain the pre-processed background spectrum to be corrected and the reference background spectrum;
[0010] S4, determining a coarse drift amount of the background spectrum to be corrected in units of one pixel, and translating the background spectrum to be corrected according to the coarse drift amount to obtain a coarsely corrected background spectrum to be corrected;
[0011] S5, interpolating the background spectrum to be corrected after the rough correction to obtain an interpolated background spectrum to be corrected, and normalizing and self-differentiating the interpolated background spectrum to be corrected to obtain an interpolated pre-processed background spectrum to be corrected.
[0012] S6, calculating the fine drift between the interpolated background spectrum to be corrected and the reference background spectrum in units of one interpolation point, and translating the roughly corrected background spectrum to be corrected according to the fine drift to obtain a finely corrected background spectrum.
[0013] Furthermore, the fine drift amount in step S6 is the sum of the integer fine drift amount and the decimal fine drift amount.
[0014] Furthermore, in step S4, the rough wavelength drift between the background spectrum to be corrected and the reference background spectrum is determined by a correlation coefficient method or a least square method, with an accuracy of 1 pixel.
[0015] Furthermore, the wavelength coarse drift between the background spectrum curve to be corrected and the reference background spectrum is calculated by the correlation coefficient method, and the steps are as follows:
[0016] S411, determining a maximum coarse drift amount s in units of one pixel, and extending s pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured to obtain a coarse wavelength sliding window;
[0017] S412, starting from the leftmost pixel point of the wavelength coarse sliding window and ending at the rightmost pixel point of the wavelength coarse sliding window, intercepting the spectrum with the same length as the absorption band of the gas to be measured from the preprocessed background spectrum to be corrected according to the pixel points, until a 2s+1 frame background spectrum to be corrected is obtained;
[0018] S413, selecting a pair of spectra with the largest correlation coefficient with the preprocessed reference background spectrum from the background spectrum to be corrected, and the drift amount of this spectrum is the rough drift amount of the background spectrum to be corrected.
[0019] Furthermore, the wavelength coarse drift between the background spectrum curve to be corrected and the reference background spectrum is calculated by the least square method, and the steps are as follows:
[0020] S411, determining a maximum coarse drift amount s in units of one pixel, and extending s pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured to obtain a coarse wavelength sliding window;
[0021] S412, starting from the leftmost pixel point of the wavelength coarse sliding window and ending at the rightmost pixel point of the wavelength coarse sliding window, intercepting the spectrum with the same length as the absorption band of the gas to be measured from the preprocessed background spectrum to be corrected according to the pixel points, until a 2s+1 frame background spectrum to be corrected is obtained;
[0022] S413, selecting a pair of spectra with the smallest residual value between the background spectrum to be corrected and the preprocessed reference background spectrum, and the drift amount of this spectrum is the rough drift amount of the background spectrum to be corrected.
[0023] Further, in S5, all pixel points of the background spectrum to be corrected after the rough correction are interpolated and normalized and self-differentiated to obtain the background spectrum to be corrected after interpolation preprocessing, including the following steps:
[0024] S51, the maximum precision drift is 1 pixel, and redundant u pixels are reserved for interpolation boundary errors. After extending u+1 pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured, the wavelength precision sliding window is obtained;
[0025] S52, interpolating all pixel points of the roughly corrected background spectrum in the wavelength precision sliding window to obtain an interpolated background spectrum to be corrected;
[0026] S53, normalizing and self-differentiating the interpolated background spectrum to be corrected to obtain an interpolated and pre-processed background spectrum to be corrected;
[0027] S54, starting from the leftmost pixel point of the wavelength precision sliding window and ending at the rightmost pixel point of the wavelength precision sliding window, extract one interpolation point every r pixels of the interpolated and preprocessed background spectrum to be corrected, and obtain 2t+1 new background spectra to be corrected.
[0028] Furthermore, the correlation coefficient method or the least square method is used to calculate the integer precise drift between the new background spectrum to be corrected and the reference background spectrum after interpolation, with an accuracy of 1 interpolation point.
[0029] Further, a polynomial fitting method is used to calculate the decimal precision drift between the new background spectrum to be corrected and the reference background spectrum after interpolation, with an accuracy of 0.0001 interpolation point, including the following steps:
[0030] Take the origin and the symmetrical points on the left and right of the origin as the X value;
[0031] The maximum correlation coefficient between the new background spectrum curve to be corrected after interpolation and the reference background spectrum after preprocessing and the correlation coefficients adjacent to the maximum correlation coefficient are taken as the Y value, or the minimum residual between the new background spectrum curve to be corrected after interpolation and the reference background spectrum after preprocessing and the residuals adjacent to the maximum correlation coefficient are taken as the Y value;
[0032] Perform polynomial fitting on X and Y, and the abscissa value of the extreme point of the polynomial fitting curve is used as the decimal precision drift.
[0033] The method and system provided by the present invention can make three notches in the background gas by adding a NO standard gas tank in the optical path, so that it is more convenient to correct the drift of the spectrum analyzer and improve the correction accuracy; the absorption notch of NO is clear and easy to distinguish, and the NO property is stable, so it can be used for a long time as a standard gas tank; in the correction calculation process, the influence of the longitudinal amplitude stretching of the background spectrum to be corrected on the calculated lateral wavelength drift is reduced by normalizing and self-differential processing the spectrum in advance, so as to improve the calculation accuracy; when calculating the drift amount, the coarse drift amount, the integer fine drift amount and the decimal fine drift amount are calculated in sequence, so that the calculation steps are simplified and the calculation accuracy is guaranteed; redundancy is reserved for the interpolation error at both ends of the pixel point interval, that is, only the spectrum in the pixel point interval with sufficiently high interpolation accuracy is used to calculate the correlation coefficient or residual, so as to effectively improve the correction accuracy; the present invention effectively solves the problem that the spectrum analyzer with a deuterium lamp as a light source cannot accurately calculate the wavelength drift of the background spectrum to be corrected compared with the reference background spectrum when the wavelength drifts, improves the correction accuracy of the wavelength drift, simplifies the process of online concentration inversion, and ensures the reliability of the spectrum analyzer. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the structure of the system device provided by the present invention;
[0035] Figure 2 A schematic diagram of the structure of a system device in another embodiment provided by the present invention;
[0036] Figure 3 A schematic diagram of the system provided by the present invention;
[0037] Figure 4 A schematic diagram of the method provided by the present invention;
[0038] Figure 5 This is a comparison diagram of the deuterium lamp reference background spectrum before and after adding the NO standard gas tank in a specific embodiment of the present invention;
[0039] Figure 6 A comparison diagram of the reference background spectrum and the background spectrum to be corrected in a specific embodiment of the present invention;
[0040] Figure 7 A comparison diagram of a reference background spectrum and a background spectrum after wavelength drift correction in a specific embodiment of the present invention;
[0041] In the figure: 1. Deuterium lamp; 2. Measuring cell; 3. Spectrum analyzer; 4. Detector; 5. NO standard gas tank. DETAILED DESCRIPTION
[0042] In order to explain the present invention more clearly, the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0043] Embodiment 1
[0044] like Figures 1 to 3 As shown, a spectrum wavelength sliding correction system includes a deuterium lamp, a measuring cell and a spectrum analyzer, wherein a storage module, a calculation module and a correction module are arranged in the spectrum analyzer, a light source signal emitted by the deuterium lamp passes through the measuring cell and is received by a detector in the spectrum analyzer, and further includes a NO standard gas tank arranged at any position of the optical path between the deuterium lamp and the detector of the spectrum analyzer, the storage module is configured to store spectrum data, the calculation module is configured to calculate the wavelength offset of the spectrum analyzer, and the correction module is configured to correct the spectrum analyzer according to the wavelength offset; NO gas is sealed in the NO standard gas tank, and both ends of the NO standard gas tank are made of transparent material to allow light to pass through.
[0045] In this embodiment, Figure 1 As shown in the figure, the NO standard gas tank is set on the inner wall of the shell of the spectrum analyzer, and a through hole is correspondingly set on the inner wall of the fixed NO standard gas tank to allow light to pass through. For the NO gas sealed in the sealed tank, its concentration range depends on the length of the NO standard gas tank. For example, when the length of the standard gas tank is 5mm, the NO concentration is 15000mg / m 3 To 30000mg / m 3 It is more convenient to calibrate the notch on the spectrum when within the range.
[0046] like Figure 2 As shown, the NO standard gas tank can also measure the light outlet outside the pool.
[0047] NO is stable in nature and does not have much effect on lowering the overall spectrum. Therefore, it directly acts on the gas band to be tested and does not affect the detection quality of other gases. The test results are representative. Since the drift amounts of different bands of the spectrometer are inconsistent, the greater the difference between the bands, the greater the difference. The common use of filters to make notches has a large effect on lowering the overall spectrum. In order not to affect the detection quality of the gas to be tested, the filter can only make notches near the gas band to be tested and cannot act directly on the gas band to be tested. Therefore, compared with NO acting directly on the gas band to be tested, the accuracy of using filters to make notches to calculate the wavelength drift amount is poor.
[0048] The light emitted by the deuterium lamp passes through the measuring cell and NO standard gas tank in turn, and then is reflected by the optical path in the spectrum analyzer and received by the detector.
[0049] The spectrum analyzer is also provided with a timing module, which is configured to regularly collect the spectrum data to be corrected and send it to the storage module. The timing module can regularly collect the background spectrum and compare it with the reference background spectrum for regular correction.
[0050] like Figure 4 As shown, a spectrum wavelength sliding correction method comprises the following steps:
[0051] S1, when the spectrum analyzer leaves the factory or is used for the first time, background gas is introduced into the measuring cell, and a deuterium lamp spectrum with NO standard gas characteristics is collected and stored in the spectrum analyzer as a reference background spectrum;
[0052] The wavelength band of the commonly used gas to be measured is 190-296nm. In this embodiment, the background gas is air. By adding a NO standard gas tank between the deuterium lamp and the measuring cell, the reference background spectrum has three obvious notches in the wavelength band of 195-226nm, such as Figure 5 As shown, in order to facilitate more accurate correction of the spectral curve.
[0053] S2, regularly introduce background gas into the measuring cell, and collect the deuterium lamp spectrum with NO standard gas characteristics as the background spectrum to be corrected;
[0054] S3, normalizing and self-differentiating the background spectrum to be corrected and the reference background spectrum to obtain the pre-processed background spectrum to be corrected and the reference background spectrum;
[0055] like Figure 6 As shown, compared with the reference background spectrum, the background spectrum to be corrected has both lateral wavelength drift and longitudinal amplitude stretching. In order to reduce the influence of longitudinal amplitude stretching on the calculation of lateral wavelength drift and improve the calculation accuracy, the background spectrum to be corrected and the reference background spectrum are normalized and self-differentiated.
[0056] S4, determining a coarse drift amount of the background spectrum to be corrected in units of one pixel, and translating the background spectrum to be corrected according to the coarse drift amount to obtain a coarsely corrected background spectrum to be corrected;
[0057] S5, interpolating the background spectrum to be corrected after the rough correction to obtain an interpolated background spectrum to be corrected, and normalizing and self-differentiating the interpolated background spectrum to be corrected to obtain an interpolated pre-processed background spectrum to be corrected;
[0058] S6, calculating the fine drift between the interpolated background spectrum to be corrected and the reference background spectrum in units of one interpolation point, and translating the roughly corrected background spectrum to be corrected according to the fine drift to obtain a finely corrected background spectrum.
[0059] like Figure 7 As shown, the wavelength drift between the corrected background spectrum and the reference background spectrum has been corrected, thereby ensuring the detection accuracy of the subsequent gas to be tested.
[0060] Specifically, in step S4, the rough wavelength drift between the background spectrum to be corrected and the reference background spectrum is determined by the correlation coefficient method or the least square method, with an accuracy of 1 pixel.
[0061] The wavelength coarse drift between the background spectrum curve to be corrected and the reference background spectrum is calculated by the correlation coefficient method. The specific steps are as follows:
[0062] S411, determining a maximum coarse drift amount s in units of one pixel, and extending s pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured to obtain a coarse wavelength sliding window;
[0063] In this embodiment, the absorption band of the gas to be measured is 190-296nm, and the interval of all pixels corresponding to the above band in the background spectrum to be corrected is 72-820. Since the background spectrum to be corrected has a wavelength drift, it needs to be translated left and right according to the drift amount and compared with the reference background spectrum for correction. In order to facilitate comparison and make the calculation more accurate, the maximum coarse drift amount needs to be extended at both ends of the interval of all pixels in the absorption band of the gas to be measured. In this embodiment, the maximum coarse drift amount is 6 pixels. Therefore, the pixel interval of the wavelength coarse sliding window is selected according to the maximum coarse drift amount to be 66-826;
[0064] S412, starting from the leftmost pixel point of the wavelength coarse sliding window and ending at the rightmost pixel point of the wavelength coarse sliding window, intercepting the spectrum with the same length as the absorption band of the gas to be measured from the preprocessed background spectrum to be corrected according to the pixel points, until a 2s+1 frame background spectrum to be corrected is obtained;
[0065] In this embodiment, s is 6, so 13 background spectra to be corrected are selected;
[0066] S413, selecting a pair of spectra with the largest correlation coefficient with the preprocessed reference background spectrum from the background spectrum to be corrected, and the drift amount of this spectrum is the rough drift amount of the background spectrum to be corrected.
[0067] Specifically, the correlation coefficient coeff between the sth and s+2th background spectra to be corrected and the preprocessed reference background spectra is calculated respectively. s 、coeff s+2 ;
[0068] If coeff s =coeff s+2 , then the wavelength coarse drift is 0 pixels; if coeff s >coeff s+2 , then calculate the correlation coefficients of the sth to 1st background spectra to be corrected and the preprocessed reference background spectrum in sequence, and the inflection point value where the correlation coefficient change trend changes from increasing to decreasing is determined as the mth background spectrum to be corrected with the largest correlation coefficient, then the wavelength coarse drift is m-(s+1) pixels, -s≤m-(s+1)≤s; if coeff s <coeff s+2 , then the correlation coefficients of the background spectra to be corrected from the s+2th to the 2s+1th and the preprocessed reference background spectra are calculated in sequence, and the inflection point value where the correlation coefficient change trend changes from increasing to decreasing is determined as the m′th background spectrum to be corrected with the largest correlation coefficient, and the rough wavelength drift is m′-(s+1) pixels, -s≤m′-(s+1)≤s;
[0069] Drifting to the right is defined as a positive direction, and drifting to the left is defined as a negative direction. In this embodiment, two correlation coefficients coeff between the background spectrum to be corrected after the selected band in the sixth and eighth frames and the reference background spectrum after preprocessing are calculated respectively. 6 、coeff 8 , where coeff 6 =0.3820, coeff 8 =-0.0522, coeff 6 >coeff 8 , the correlation coefficients of the background spectra to be corrected after the 6th to the 1st selected band and the preprocessed reference background spectrum are calculated in sequence, until the background spectrum to be corrected after the 2nd selected band, the corresponding correlation coefficient is 0.9978, and the correlation coefficient corresponding to the background spectrum to be corrected after the 1st selected band is 0.9721, that is, the trend of the correlation coefficient changes from increasing to decreasing, so the rough wavelength drift is -5 pixels.
[0070] In S5, the background spectrum to be corrected after the rough correction is interpolated to obtain the background spectrum to be corrected after interpolation, and the background spectrum to be corrected after interpolation is normalized and self-differentiated to obtain the background spectrum to be corrected after interpolation preprocessing, as follows:
[0071] S51, the maximum precision drift is 1 pixel, and redundant u pixels are reserved for interpolation boundary errors. After extending u+1 pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured, the wavelength precision sliding window is obtained;
[0072] In this embodiment, the interval of all pixels in the absorption band of the gas to be measured is 72-820. Since the background spectrum is roughly corrected in units of pixels, the maximum fine drift is 1 pixel, and the redundancy u=20 reserved for the interpolation boundary error is extended by 21 pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured, and the pixel interval of 51-841 is obtained as the wavelength fine sliding window;
[0073] S52, interpolating all pixel points of the roughly corrected background spectrum in the wavelength precision sliding window to obtain an interpolated background spectrum to be corrected;
[0074] In this embodiment, 16-fold FFT (Fast Fourier Transform) interpolation is adopted.
[0075] S53, normalizing and self-differentiating the interpolated background spectrum to be corrected to obtain the interpolated and pre-processed background spectrum to be corrected.
[0076] S54, starting from the leftmost pixel point of the wavelength precision sliding window and ending at the rightmost pixel point of the wavelength precision sliding window, extract one interpolation point every r pixels of the interpolated and preprocessed background spectrum to be corrected, and obtain 2t+1 new background spectra to be corrected.
[0077] In this embodiment, one interpolation point is sequentially extracted for every 16 pixels of the interpolated background spectrum to be corrected, to obtain 33 new background spectrum curves;
[0078] Furthermore, the wavelength fine drift amount in step S6 is the sum of the integer fine drift amount and the decimal fine drift amount.
[0079] Furthermore, the correlation coefficient method or the least squares method is used to calculate the integer precise drift between the new background spectrum to be corrected after interpolation and the reference background spectrum, with an accuracy of 1 interpolation point; the polynomial fitting method is used to calculate the decimal precise drift between the new background spectrum to be corrected after interpolation and the reference background spectrum, with an accuracy of 0.0001 interpolation point.
[0080] The correlation coefficient method is used to calculate the integer fine drift between the new background spectrum to be corrected after interpolation and the reference background spectrum. The specific method is similar to the calculation of the rough drift, that is, a spectrum with the largest correlation coefficient between the new background spectrum to be corrected after interpolation preprocessing and the preprocessed reference background spectrum is selected. The drift of this spectrum is the integer fine drift of the background spectrum to be corrected.
[0081] Specifically, the correlation coefficients coeff of the new background spectra of the tth and t+2th frames and the preprocessed reference background spectra are calculated respectively. t 、coeff t+2 , if coeff t =coeff t+2, then the integer precision drift is 0 interpolation point; if coeff t >coeff t+2 , then calculate the correlation coefficients of the new background spectra from the tth to the first frame and the preprocessed reference background spectrum in sequence. The inflection point value where the correlation coefficient changes from increasing to decreasing is determined as the nth new background spectrum to be corrected with the largest correlation coefficient. The integer precision drift is n-(t+1) interpolation points, -t≤n-(t+1)≤t; if coeff a <coeff a+2 , then calculate the correlation coefficients of the new background spectra from the t+2th to the 2t+1th and the preprocessed reference background spectra in sequence. The inflection point value where the correlation coefficient trend changes from increasing to decreasing is determined as the n′th new background spectrum to be corrected with the largest correlation coefficient. The integer fine drift amount is n′-(t+1) interpolation points, -t≤n′-(t+1)≤t.
[0082] Drifting to the right is defined as a positive direction, and drifting to the left is defined as a negative direction. In this embodiment, two correlation coefficients coeff between the background spectrum to be corrected after the selected band in the 16th and 18th frames and the reference background spectrum after preprocessing are calculated respectively. 16 、coeff 18 , where coeff 16 =0.9988, coeff 18 =0.9965,coeff 16 >coeff 18 , the correlation coefficients of the to-be-corrected background spectra after the 16th to the 1st selected band and the preprocessed reference background spectra are calculated in sequence, until the to-be-corrected background spectrum after the 14th selected band, the corresponding correlation coefficient is 0.9997, and the corresponding correlation coefficient of the to-be-corrected background spectrum after the 13th selected band is 0.9996, that is, the trend of the correlation coefficient changes from increasing to decreasing, and the integer fine drift amount is -3 interpolation points.
[0083] The polynomial fitting method is used to calculate the decimal precision drift between the new background spectrum to be corrected after interpolation and the reference background spectrum, as follows:
[0084] Define the origin and the symmetrical points on the left and right of the origin as the X value, take the maximum correlation coefficient between the new background spectrum curve to be corrected after interpolation and the reference background spectrum after preprocessing and the correlation coefficients adjacent to the maximum correlation coefficient as the Y value, and perform polynomial fitting on X and Y;
[0085] In this embodiment, define X = {-1, 0, 1}, take the maximum correlation coefficient and the correlation coefficient of its left and right neighbors as the Y value, Y = {0.9996, 0.9997, 0.9994}, and perform quadratic polynomial fitting on X and Y.0 +a 1 x+a 2 x 2 , and get a 0 =0.9997,a 1 =-9.5308e-5,a 2 = -1.7301e-4;
[0086] In this embodiment, the horizontal coordinate of the extreme point of the quadratic curve is calculated Then the decimal precision drift is -0.2754 interpolation points;
[0087] The wavelength drift of the background spectrum to be corrected is: coarse drift × interpolation multiple + integer fine drift + decimal fine drift = -5 × 16-3 - 0.2754 = -83.2754 interpolation points, that is, the background spectrum to be corrected drifts to the left by 83.2754 interpolation points relative to the reference background spectrum.
[0088] Embodiment 2
[0089] The difference from Example 1 is that in step S4, the least squares method is used to determine the coarse wavelength drift between the background spectrum curve to be corrected and the reference background spectrum; correspondingly, in step S6, the least squares method is used to calculate the integer fine drift between the new background spectrum to be corrected and the reference background spectrum after interpolation, with an accuracy of 1 interpolation point; the polynomial fitting method is used to calculate the decimal fine drift between the new background spectrum to be corrected and the reference background spectrum after interpolation, with an accuracy of 0.0001 interpolation point.
[0090] The difference is that in S413, a pair of spectra with the smallest residual value between the background spectrum to be corrected and the preprocessed reference background spectrum is selected, and the drift amount of this spectrum is the rough drift amount of the background spectrum to be corrected.
[0091] Specifically, the residual value SSE between the sth and s+2th background spectra to be corrected and the preprocessed reference background spectrum is calculated respectively. s , SSE s+2 ,
[0092] If SSE s =SSE s+2 , then the wavelength coarse drift is 0 pixels; if SSE s <SSE s+2 , then the residuals between the sth to 1st background spectra to be corrected and the preprocessed reference background spectra are calculated in sequence, and the inflection point value where the residual value change trend changes from decreasing to increasing is determined as the m″th background spectrum to be corrected with the smallest residual value, then the wavelength coarse drift is m″-(s+1) pixels, -s≤m″-(s+1)≤s; if SSE s >SSEs+2 , then the residuals between the s+2th to 2s+1th background spectra to be corrected and the preprocessed reference background spectra are calculated in sequence, and the inflection point value where the trend of the residual value changes from decreasing to increasing is determined as the m″′th background spectrum to be corrected with the smallest residual value, and the coarse wavelength drift is m″′-(s+1) pixels, -s≤m″′-(s+1)≤s;
[0093] Drifting to the right is defined as a positive direction, and drifting to the left is defined as a negative direction. In this embodiment, the residual SSE of the background spectrum to be corrected and the reference spectrum after the selected bands in the 6th and 8th images are calculated respectively. 6 , SSE 8 , where SSE 6 =5.6342, SSE 8 =9.5913, SSE 6 <SSE 8 , the residuals of the background spectra to be corrected after the 6th to 1st waveband selection and the reference background spectrum after preprocessing are calculated in sequence, until the background spectrum to be corrected after the 2nd waveband selection, the corresponding residual is 0.0198, while the residual corresponding to the background spectrum to be corrected after the 1st waveband selection is 0.2553, that is, the residual change trend changes from decreasing to increasing, and the rough wavelength drift is -5 pixels.
[0094] In step S6, the integer precise drift between the new background spectrum to be corrected after interpolation and the reference background spectrum is calculated using the least square method.
[0095] That is, a spectrum with the smallest residual value between the new background spectrum to be corrected after interpolation preprocessing and the reference background spectrum after preprocessing is selected, and the drift amount of this spectrum is the integer precise drift amount of the background spectrum to be corrected.
[0096] Specifically, the residual SSE between the tth and t+2th new background spectra and the preprocessed reference background spectra is calculated respectively. t , SSE t+2 , if SSE t =SSE t+2 , then the integer fine drift is 0 interpolation point; if SSE t <SSE t+2 , then calculate the residuals between the t-th to the 1st new background spectra and the preprocessed reference background spectra in sequence. The inflection point value where the residual value changes from decreasing to increasing is determined as the nth new background spectrum to be corrected with the smallest residual value. The integer precision drift is n-(t+1) interpolation points, -t≤n-(t+1)≤t; if SSE t >SSE t+2, then calculate the residuals between the new background spectra from t+2 to 2t+1 and the preprocessed reference background spectrum in sequence. The inflection point value where the trend of the residual value changes from decreasing to increasing is determined as the n′th new background spectrum to be corrected with the smallest residual value. The integer fine drift amount is n′-(t+1) interpolation points, -t≤n′-(t+1)≤t.
[0097] Drifting to the right is defined as a positive direction, and drifting to the left is defined as a negative direction. In this embodiment, the residual SSE between the background spectrum to be corrected after the selected band in the 16th and 18th frames and the reference background spectrum after preprocessing is calculated respectively. 16 , SSE 18 , where SSE 16 =0.0110, SSE 18 =0.0317, SSE 16 <SSE 18 , the residuals of the to-be-corrected background spectrum after the 16th to the 1st selected band and the preprocessed reference background spectrum are calculated in sequence, until the to-be-corrected background spectrum after the 14th selected band, the corresponding residual is 0.0029, and the residual corresponding to the to-be-corrected background spectrum after the 13th selected band is 0.0037, that is, the residual change trend changes from decreasing to increasing, and the integer fine drift is -3 interpolation points.
[0098] The polynomial fitting method is used to calculate the decimal precision drift between the new background spectrum to be corrected after interpolation and the reference background spectrum, as follows:
[0099] Define the origin and the symmetrical points on the left and right of the origin as the X value, take the minimum residual between the new background spectrum curve to be corrected after interpolation and the reference background spectrum after preprocessing and the residuals adjacent to it on the left and right as the Y value, perform polynomial fitting on X and Y; calculate the horizontal coordinate value of the extreme point of the polynomial fitting curve as the decimal precision drift;
[0100] In this embodiment, define X = {-1, 0, 1}, take the minimum residual and its left and right adjacent residuals as the Y value, Y = {0.0037, 0.0029, 0.0054}, and perform quadratic polynomial fitting on X and Y. 0 +a 1 x+a 2 x 2 , and get a 0 =0.0029,a 1 =0.0009,a 2 =0.0016; calculate the horizontal coordinate of the extreme point of the quadratic curve Then the decimal precision drift is -0.2736 interpolation points;
[0101] The wavelength drift of the background spectrum to be corrected is: coarse drift×interpolation multiple+integer fine drift+decimal fine drift=-5×16-3-0.2736=-83.2736 interpolation points, that is, the background spectrum to be corrected drifts to the left by 83.2736 interpolation points.
[0102] The present invention also provides a non-transitory computer-readable storage medium, comprising instructions for executing a spectral wavelength sliding correction method described in any of the above embodiments.
[0103] The present invention also provides an electronic device, including a non-transitory computer-readable storage medium; and one or more processors capable of executing the instructions of the non-transitory computer-readable storage medium.
[0104] The method and system provided by the present invention add an NO standard gas tank in the optical path so that the background gas can produce three notches, thereby making it easier to correct the drift of the spectrum analyzer and improving the correction accuracy. In the correction calculation process, the spectrum is normalized and self-differentiated in advance to reduce the influence of the longitudinal amplitude stretching of the background spectrum to be corrected and the different dimensions on the calculated lateral wavelength drift, thereby improving the calculation accuracy. When calculating the drift amount, the rough drift amount in units of one pixel point is first calculated, and then the fine drift amount in units of one interpolation point is calculated, thereby reducing the number of interpolation points and the number of drift searches, thereby effectively reducing the calculation cost. When sliding to find two spectra with the largest correlation coefficient or the smallest residual, the sliding direction is first determined, and then the inflection point value is found along the sliding direction, thereby optimizing the search method and significantly reducing the calculation complexity. When the spectrum is interpolated, redundancy is reserved for the interpolation error at both ends of the pixel point interval in advance, that is, only the spectrum in the pixel point interval with sufficiently high interpolation accuracy is used to calculate the correlation coefficient or residual, thereby effectively improving the correction accuracy.
[0105] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product 7 implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0109] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A spectrum wavelength sliding correction system, comprising a deuterium lamp, a measuring cell and a spectrum analyzer, wherein the spectrum analyzer is provided with a storage module, a calculation module and a correction module, and the light source signal emitted by the deuterium lamp passes through the measuring cell and is received by a detector in the spectrum analyzer, characterized in that: It also includes a NO standard gas tank arranged at any position of the optical path between the deuterium lamp and the detector of the spectrum analyzer, the storage module is configured to store spectral data, the calculation module is configured to calculate the wavelength offset of the spectrum analyzer, and the correction module is configured to correct the spectrum analyzer according to the wavelength offset; NO gas is sealed in the NO standard gas tank, and both ends of the NO standard gas tank are made of transparent material to allow light to pass through.
2. The spectrum wavelength sliding correction system method according to claim 1, characterized in that: The transparent material at both ends of the NO standard gas tank is high-purity quartz; a timing module is also provided in the spectrum analyzer, and the timing module is configured to regularly collect the spectrum data to be corrected and send it to the storage module.
3. A spectrum wavelength sliding correction method, characterized in that: The following steps are involved: S1, when the spectrum analyzer leaves the factory or is used for the first time, background gas is introduced into the measuring cell, and a deuterium lamp spectrum with NO standard gas characteristics is collected and stored in the spectrum analyzer as a reference background spectrum; S2, regularly introduce background gas into the measuring cell, and collect the deuterium lamp spectrum with NO standard gas characteristics as the background spectrum to be corrected; S3, normalizing and self-differentiating the background spectrum to be corrected and the reference background spectrum to obtain the pre-processed background spectrum to be corrected and the reference background spectrum; S4, determining a coarse drift amount of the background spectrum to be corrected in units of one pixel, and translating the background spectrum to be corrected according to the coarse drift amount to obtain a coarsely corrected background spectrum to be corrected; S5, interpolating the background spectrum to be corrected after the rough correction to obtain an interpolated background spectrum to be corrected, and performing normalization and self-differentiation processing on the background spectrum to be corrected after the interpolation to obtain an interpolated pre-processed background spectrum to be corrected; S6, calculating the fine drift between the interpolated background spectrum to be corrected and the reference background spectrum in units of one interpolation point, and translating the roughly corrected background spectrum to be corrected according to the fine drift to obtain a finely corrected background spectrum.
4. The spectrum wavelength sliding correction system method according to claim 3, characterized in that: The fine drift amount in step S6 is the sum of the integer fine drift amount and the decimal fine drift amount.
5. The spectrum wavelength sliding correction system method according to claim 3, characterized in that: In step S4, the rough wavelength drift between the background spectrum to be corrected and the reference background spectrum is determined by correlation coefficient method or least square method, with an accuracy of 1 pixel.
6. The spectrum wavelength sliding correction system method according to claim 5, characterized in that: The rough wavelength drift between the background spectrum curve to be corrected and the reference background spectrum is calculated by the correlation coefficient method. The steps are as follows: S411, determining a maximum coarse drift amount s in units of one pixel, and extending s pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured to obtain a coarse wavelength sliding window; S412, starting from the leftmost pixel point of the wavelength coarse sliding window and ending at the rightmost pixel point of the wavelength coarse sliding window, intercepting the spectrum with the same length as the absorption band of the gas to be measured from the preprocessed background spectrum to be corrected according to the pixel points, until a 2s+1 frame background spectrum to be corrected is obtained; S413, selecting a pair of spectra with the largest correlation coefficient with the preprocessed reference background spectrum from the background spectrum to be corrected, and the drift amount of this spectrum is the rough drift amount of the background spectrum to be corrected.
7. The spectrum wavelength sliding correction system method according to claim 5, characterized in that: The wavelength coarse drift between the background spectrum curve to be corrected and the reference background spectrum is calculated by the least squares method. The steps are as follows: S411, determining a maximum coarse drift amount s in units of one pixel, and extending s pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured to obtain a coarse wavelength sliding window; S412, starting from the leftmost pixel point of the wavelength coarse sliding window and ending at the rightmost pixel point of the wavelength coarse sliding window, intercepting the spectrum with the same length as the absorption band of the gas to be measured from the preprocessed background spectrum to be corrected according to the pixel points, until a 2s+1 frame background spectrum to be corrected is obtained; S413, selecting a pair of spectra with the smallest residual value between the background spectrum to be corrected and the preprocessed reference background spectrum, and the drift amount of this spectrum is the rough drift amount of the background spectrum to be corrected.
8. The spectrum wavelength sliding correction system method according to claim 3, characterized in that: In S5, all pixel points of the background spectrum to be corrected after the rough correction are interpolated and normalized and self-differentiated to obtain the background spectrum to be corrected after the interpolation preprocessing, including the following steps: S51, the maximum precision drift is 1 pixel, and redundant u pixels are reserved for interpolation boundary errors. After extending u+1 pixels at both ends of the interval of all pixels in the absorption band of the gas to be measured, the wavelength precision sliding window is obtained; S52, interpolating all pixel points of the roughly corrected background spectrum in the wavelength precision sliding window to obtain an interpolated background spectrum to be corrected; S53, normalizing and self-differentiating the interpolated background spectrum to be corrected to obtain an interpolated and pre-processed background spectrum to be corrected; S54, starting from the leftmost pixel point of the wavelength precision sliding window and ending at the rightmost pixel point of the wavelength precision sliding window, extract one interpolation point every r pixels of the interpolated and preprocessed background spectrum to be corrected, and obtain 2t+1 new background spectra to be corrected.
9. The spectrum wavelength sliding correction system method according to any one of claims 4 to 8, characterized in that: The correlation coefficient method or the least square method is used to calculate the integer precise drift between the new background spectrum to be corrected after interpolation and the reference background spectrum, with an accuracy of 1 interpolation point.
10. The spectrum wavelength sliding correction system method according to claim 9, characterized in that: The polynomial fitting method is used to calculate the decimal drift between the new background spectrum to be corrected and the reference background spectrum after interpolation, with an accuracy of 0.0001 interpolation point, including the following steps: Take the origin and the symmetrical points on the left and right of the origin as the X value; The maximum correlation coefficient between the new background spectrum curve to be corrected after interpolation and the reference background spectrum after preprocessing and the correlation coefficients adjacent to the maximum correlation coefficient are taken as the Y value, or the minimum residual between the new background spectrum curve to be corrected after interpolation and the reference background spectrum after preprocessing and the residuals adjacent to the maximum correlation coefficient are taken as the Y value; Perform polynomial fitting on X and Y, and the abscissa value of the extreme point of the polynomial fitting curve is used as the decimal precision drift.