A gas concentration calculation method based on priority interpolation matching algorithm
Through the priority interpolation matching algorithm, the gas absorption spectrum is calibrated and interpolated, and the gas concentration with the greatest interference is calculated first, which solves the problem of large error in gas concentration calculation in the prior art, and achieves the accuracy and accuracy of high-concentration gas calculation.
Patent Information
- Application Number
- CN202211675601.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-12-26
AI Technical Summary
In the existing gas concentration calculation methods, the direct introduction of a single scale for calculation results in a large error in the result, especially when the gas with higher concentrations exists.
The priority interpolation matching algorithm is used to calibrate the gas absorption spectrum, determine the cross-interference gas, perform interpolation processing, and calculate the maximum interference gas concentration first, and perform least squares matching and quadratic calculations to obtain the final gas concentration.
The error in gas concentration calculation is reduced, especially when high concentration gases are present, and the accuracy and accuracy of calculations are improved.
Smart Images

Figure CN116124725B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field, and in particular to a gas concentration calculation method based on a priority interpolation matching algorithm. Background Art
[0002] Industrial development has led to serious gas pollution, which seriously endangers people's health. Therefore, detecting gas concentration has important environmental significance. In the existing technology, Fourier transform infrared spectrometer is often used to detect gas concentration, which can measure many types of gases and a wide range of gases.
[0003] When using a Fourier transform infrared spectrometer to detect multiple gas concentrations, cross-interference often occurs between the gases within a certain interval. In this case, the least squares method is used to calculate the concentration of the gas in each interval by incorporating the cross-interference gas. However, this method typically uses a single standard spectrum to calculate the result. This calculation often results in large errors, especially when high-concentration gases are present. Therefore, a gas concentration calculation method based on a priority interpolation matching algorithm is proposed. Summary of the Invention
[0004] The technical problem to be solved by the present invention is: how to solve the problem that the existing gas concentration calculation method directly inputs a single standard spectrum and performs calculation once to obtain the result, resulting in generally large errors in the calculation results, especially when there is a gas with a high concentration, the calculation error will increase. A gas concentration calculation method based on a priority interpolation matching algorithm is provided.
[0005] The present invention solves the above technical problems through the following technical solutions, which include the following steps:
[0006] S1: Calibrate all gases to be calculated, obtain the absorption spectrum of each gas, and determine the cross-interference gases in each gas interval;
[0007] S2: interpolate the absorption spectrum of each gas to obtain an interpolated calibration spectrum;
[0008] S3: Perform baseline removal, intensity point selection, and absorbance point selection operations on the current gas spectrum;
[0009] S4: Determine the gas with the highest cross-interference priority in the current gas interval, perform least square matching between the measured absorbance spectrum and the interpolated calibration spectrum in the gas interval with the highest priority, and obtain the regression coefficient K through least square calculation. When the absolute value of the regression coefficient K is less than 1, calculate the inverse of the regression coefficient K and then subtract 1 to obtain the calculated value. When the absolute value of the regression coefficient K is greater than or equal to 1, directly subtract 1 from the regression coefficient K to obtain the calculated value. Then, select the interpolated calibration spectrum with the calculated value closest to 0 as the standard spectrum. If it exceeds the limit, directly select the interpolated calibration spectrum with the maximum or minimum value as the standard spectrum.
[0010] S5: The standard spectrum obtained by matching and calculating in step S4 is brought into the gas interval currently to be calculated, and the initial values of the current gas and each interfering component gas are selected to perform least squares calculation to obtain the concentration of each interfering component gas. Then, the matching process in step S4 is performed to obtain the standard spectrum of each interfering component gas.
[0011] S6: Using the standard spectrum obtained in step S5, re-calculate the least squares to obtain the current gas concentration and return it.
[0012] Furthermore, in step S1 , the gas is calibrated under standard concentration conditions to obtain the absorption spectrum of each gas, ie, the calibration spectrum.
[0013] Furthermore, in step S2, when performing interpolation, the higher the gas concentration is, the denser the interpolation is.
[0014] Furthermore, in step S3, baseline removal is to process the coordinates of the current spectrum into coordinates based on point 0; light intensity point selection is to select points by obtaining the current light intensity spectrum according to the light intensity of each point; absorbance point selection is to screen points according to the size of absorbance through the absorbance spectrum.
[0015] Furthermore, in step S4, the gas with the highest cross-interference priority in the current gas interval is the gas with the widest absorption interval distribution or the highest concentration in the field situation.
[0016] Furthermore, in step S5, the initial concentration value of each interfering component gas is selected as the calibrated minimum concentration.
[0017] Compared with the existing technology, the present invention has the following advantages: the gas concentration calculation method based on the priority interpolation matching algorithm determines the calculation priority of the gas, first calculates the concentration of the gas with the greatest interference, and then performs a least squares calculation to obtain the concentration of each interfering component gas, matches the standard spectrum that participates in the calculation last, and performs a secondary calculation to obtain the concentration of the current gas. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 4 is a flow chart of a gas concentration calculation method based on a priority interpolation matching algorithm in the first embodiment of the present invention. DETAILED DESCRIPTION
[0019] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process. However, the protection scope of the present invention is not limited to the following embodiment.
[0020] Example 1
[0021] like Figure 1 As shown, this embodiment provides a technical solution: a gas concentration calculation method based on a priority interpolation matching algorithm, comprising the following steps:
[0022] 1. First, calibrate all gases to be calculated, obtain the absorption spectrum of each gas, and determine the cross-interference gases in each gas interval. Gas calibration mainly involves obtaining the absorption spectrum of each gas under standard concentration conditions, which is also called the calibration spectrum.
[0023] 2. Interpolate the absorption spectrum of each gas to obtain the interpolated calibration spectrum. At this time, different interpolation densities need to be set according to the different gases. Generally, it is determined according to the on-site conditions. A basic principle is that in actual working conditions, the higher the gas concentration, the denser the interpolation.
[0024] 3. Perform baseline removal, intensity point selection and absorbance point selection on the current gas spectrum;
[0025] You can choose whether to perform these operations. Generally, the calculation effect will be better after performing this operation. Among them, the light intensity point selection is to select points by obtaining the current light intensity spectrum according to the light intensity of each point; the absorbance point selection is to select points according to the size of the absorbance through the absorbance spectrum; the baseline removal is to change the coordinates of the current spectrum into the base coordinates based on point 0.
[0026] 4. Determine the gas with the greatest current cross-interference (that is, the gas with the highest priority, generally the gas with the highest concentration or the widest absorption range distribution in the on-site situation), and perform least squares matching between the measured absorbance spectrum of the gas with the greatest current cross-interference priority and the interpolated calibration spectrum. Calculate the regression coefficient K through least squares. If the regression coefficient K (abs(K) < 1), take the inverse and subtract 1; otherwise, directly subtract 1 (that is, through least squares calculation, if the absolute value of the regression coefficient K between the measured absorbance spectrum and the interpolated calibration spectrum is less than 1, take the inverse (1 / K)-1; if the absolute value is greater than or equal to 1, directly use (K-1) without taking the inverse to obtain the calculated value). Then select the interpolated calibration spectrum with the calculated value closest to 0 as the standard spectrum. If it exceeds the limit, directly select the interpolated calibration spectrum with the maximum value or the minimum value as the standard spectrum. Therefore, in the actual detection process, it is necessary to ensure that there is no other high-concentration gas interference in the detection interval of the gas with the greatest priority.
[0027] 5. Bring the standard spectrum obtained by matching calculation in step 4 into the gas interval currently to be calculated, and select the initial concentration values of the current gas and each interfering component gas, perform least squares calculation, and obtain the concentration of each interfering component gas (then match. The matching method refers to step 4. The initial concentration of each interfering component gas is generally directly selected as the calibrated minimum concentration.
[0028] 6. The final data involved in the calculation is obtained through step 5, that is, the standard spectrum of each gas involved in the second calculation.
[0029] 7. By once again performing a least squares calculation on the standard spectrum data obtained in step 6, the current gas concentration is calculated and returned.
[0030] In this embodiment, the least squares calculation process is as follows:
[0031] 1. Assume there are two spectra x1 and x2, and assume the two data are linearly related, then establish a linear model x2 = k*x1 + b.
[0032] 2. Then define the objective function as minimizing the mean square error;
[0033] 3. Since x1 and x2 are two matrices, an overdetermined system of equations can be established at this time;
[0034] 4. Use some methods such as Gaussian elimination to solve the overdetermined equations in step 3. This is linear fitting. When there are multiple spectra, it is also multivariate linear fitting.
[0035] Example 2
[0036] Assume that the concentrations of two gases need to be calculated, one is SO2 (sulfur dioxide gas) and the other is H2O (water vapor). The gas concentration calculation method based on the priority interpolation matching algorithm is as follows:
[0037] 1. First, calibrate SO2 and H2O to obtain calibration spectra. Assume that SO2 is calibrated to 20ppm, 50ppm, and 100ppm, and H2O is calibrated to 1%, 2%, 4%, and 6%.
[0038] 2. Then, SO2 and H2O are interpolated according to the standard step size. Here, assuming that only water is interpolated and the step size is 1%, the calibration spectra obtained after interpolation are 1%, 2%, 3%, 4%, 5%, and 6%. The smaller the step size, the denser the interpolation.
[0039] 3. At this time, 4.1% H2O and 40ppm SO2 are passed through to obtain the spectrum of the two gases mixed together. The current real-time light intensity spectrum and absorbance spectrum are selected according to the threshold value and the baseline of the spectrum is removed.
[0040] 4. At this point, only H2O and sulfur dioxide are present. Generally speaking, when H2O and sulfur dioxide are present together, H2O will have a significant cross-interference with sulfur dioxide. At this point, H2O is the gas with the highest priority. Then, using the least squares method, within the H2O calculation range (assuming it is [3000, 4000]), the coefficient K is calculated using least squares. After calculation, six K values are obtained. At this point, the calculation is performed according to the method in step 4 of Example 1. 4% of the spectra will be matched because its calculation result is always closest to 0.
[0041] 5. At this time, the concentration of SO2 needs to be calculated. H2O is a cross-interference gas. Select the concentration spectrum of the minimum initial value of SO2 of 20ppm. Use the least squares method to calculate the coefficient K. Assuming it is a standard linear relationship, the calculated coefficient must be 2. Then the calculated result can be calculated with the initial value of 20ppm to obtain a new spectrum. Use the current spectrum and 20ppm, 50ppm, and 100ppm to perform least squares calculation to obtain the matching spectrum as the new standard spectrum.
[0042] 6. Perform a final least squares calculation using the new standard spectrum and the previous 4% H2O spectrum to obtain the final calculation result. When there are more gases, the operation is the same. For simplicity of explanation, this example only lists two gases.
[0043] To summarize, the gas concentration calculation method based on the priority interpolation matching algorithm in the above embodiment determines the calculation priority of the gas, first calculates the concentration of the gas with the greatest interference, and then performs a least squares calculation to obtain the concentration of each interfering component gas, matches the standard spectrum that is finally calculated, and performs a secondary calculation to obtain the concentration of the current gas.
[0044] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A gas concentration calculation method based on priority interpolation matching algorithm, characterized in that: The following steps are involved: S1: Calibrate all gases to be calculated, obtain the absorption spectrum of each gas, and determine the cross-interference gases in each gas interval; S2: interpolate the absorption spectrum of each gas to obtain an interpolated calibration spectrum; S3: Perform baseline removal, intensity point selection, and absorbance point selection operations on the current gas spectrum; S4: Determine the gas with the highest cross-interference priority in the current gas interval, perform least square matching between the measured absorbance spectrum and the interpolated calibration spectrum in the gas interval with the highest priority, and obtain the regression coefficient K through least square calculation. When the absolute value of the regression coefficient K is less than 1, calculate the inverse of the regression coefficient K and then subtract 1 to obtain the calculated value. When the absolute value of the regression coefficient K is greater than or equal to 1, directly subtract 1 from the regression coefficient K to obtain the calculated value. Then, select the interpolated calibration spectrum with the calculated value closest to 0 as the standard spectrum. If it exceeds the limit, directly select the interpolated calibration spectrum with the maximum or minimum value as the standard spectrum. S5: The standard spectrum obtained by matching and calculating in step S4 is brought into the gas interval currently to be calculated, and the initial values of the current gas and each interfering component gas are selected to perform least squares calculation to obtain the concentration of each interfering component gas. Then, the matching process in step S4 is performed to obtain the standard spectrum of each interfering component gas. S6: Using the standard spectrum obtained in step S5, re-calculate the least squares to obtain the current gas concentration and return it.
2. The gas concentration calculation method based on the priority interpolation matching algorithm according to claim 1 is characterized in that: In step S1 , the gas is calibrated under standard concentration conditions to obtain the absorption spectrum of each gas, ie, the calibration spectrum.
3. The gas concentration calculation method based on the priority interpolation matching algorithm according to claim 1 is characterized in that: In step S2, when performing interpolation, the higher the gas concentration is, the denser the interpolation is.
4. The gas concentration calculation method based on the priority interpolation matching algorithm according to claim 3 is characterized in that: In step S3, baseline removal is to process the coordinates of the current spectrum into coordinates based on point 0; light intensity point selection is to select points according to the light intensity of each point by obtaining the current light intensity spectrum; absorbance point selection is to screen points according to the size of absorbance through the absorbance spectrum.
5. The gas concentration calculation method based on the priority interpolation matching algorithm according to claim 4 is characterized in that: In step S4, the gas with the highest cross-interference priority in the current gas interval is the gas with the widest absorption interval distribution or the highest concentration in the field situation.
6. The gas concentration calculation method based on the priority interpolation matching algorithm according to claim 5 is characterized in that: In step S5, the initial concentration value of each interfering component gas is selected as the calibrated minimum concentration.
Citation Information
Patent Citations
Concentration analysis method
CN103868871A
Measurement method for ultralow smoke discharging
CN106323888A