Gas identification method and system based on Fourier transform infrared spectrometer

By applying Fourier transform infrared spectrometer and singular value decomposition technology in gas recognition, combined with the MCR-ALS algorithm, the problem of insufficient accuracy in traditional gas sensors when identifying complex gas mixtures is solved, achieving higher recognition accuracy and reliability.

CN120009218AActive Publication Date: 2025-05-16JIANGSU SHENGCHENG INSTR TECH CO LTD

Patent Information

Application Number
CN202510159626.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-05-16
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

Existing gas sensors have problems such as insufficient accuracy, difficulty in identifying complex multi-component gas mixtures, especially when target gas concentration is low or multiple similar gases are present, misjudgment is prone to occur.

Method used

The gas recognition method based on Fourier transform infrared spectrometer is adopted, and the infrared spectral signal is converted into spectrum through Fourier transform, and the singular value decomposition is carried out, and the discriminant model is constructed. It is iteratively calculated in combination with the MCR-ALS algorithm to determine the gas type and relative content.

Benefits of technology

It improves the accuracy and reliability of gas recognition, can more accurately reflect the composition characteristics of gas samples, and is suitable for the identification and content determination of complex gas mixtures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120009218A_ABST
    Figure CN120009218A_ABST
Patent Text Reader

Abstract

The invention provides a gas recognition method and system based on a Fourier transform infrared spectrometer, and relates to the technical field of analytical instruments and environment monitoring. The method comprises the following steps: irradiating a central region of a gas sample with infrared light of a specific wave band by adopting a Fourier transform infrared spectrometer, scanning each time to obtain an interference pattern, converting the interference pattern into an absorption spectrum matrix of a frequency domain through a Fourier transform function, and constructing a discrimination model through singular value decomposition and difference calculation to determine a component number; respectively constructing an initial concentration matrix and an initial absorption spectrum matrix by using a random number generator, iteratively optimizing the two matrixes by using an MCR-ALS algorithm, judging iteration stopping conditions according to norm change, and finally determining the gas type by calculating a correlation coefficient between the absorption spectrum matrix and a spectrum in a standard spectrum library. The accuracy and efficiency of gas recognition are improved, and then the relative content of the gas is determined through a method of calculating the average value of each column of the concentration matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of wind-induced vibration performance of segmental bridges, and in particular to a gas identification method and system based on a Fourier transform infrared spectrometer. Background Art

[0002] Gas identification is of vital importance in many fields such as scientific research and industrial production today. For example, in environmental monitoring, accurate identification of various gas components and their contents in the atmosphere is essential for assessing air quality, studying climate change, and monitoring pollution sources; in industrial production, real-time monitoring of the gas composition in the production environment can effectively ensure production safety and prevent accidents caused by toxic and harmful gas leaks. It also helps to optimize production processes and improve product quality.

[0003] Although the gas analysis method based on chromatography technology can achieve higher separation efficiency and more accurate quantitative analysis in theory, it faces many problems in practical applications. First of all, the equipment purchase cost is high, and it needs to be equipped with complex injection systems, chromatographic columns, high-precision detectors and other components, which makes many small enterprises or research institutions discouraged. Secondly, the operation process is extremely complicated and cumbersome, which not only requires operators to have professional knowledge and skills of chromatography analysis, but also requires fine debugging and maintenance of the equipment. Furthermore, the entire analysis cycle is long, from sample collection, injection, separation to detection and data processing, each link takes a lot of time, which cannot meet the urgent needs of rapid on-site detection and real-time monitoring. For example, when a gas leak occurs at an industrial production site, chromatography technology cannot provide accurate gas composition information in a timely manner, thereby delaying the best time to deal with the accident.

[0004] The existing technology has the following shortcomings: Traditional gas sensors are often only responsive to one or several specific gases, and have limited recognition capabilities for complex multi-component gas mixtures. For example, when some electrochemical sensors detect mixed gases, there may be cross-interference between different gases, resulting in inaccurate detection results. In addition, it is difficult to take both the selectivity and sensitivity of such sensors into account at the same time. When the concentration of the target gas is low, it may not be accurately detected, and when there are multiple similar gases, it is easy to make misjudgments.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The object of the present invention is to provide a gas identification method and system based on Fourier transform infrared spectrometer to solve the problems raised in the above background technology.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] A gas identification method based on Fourier transform infrared spectrometer, the specific steps include:

[0009] Step 1: Use a Fourier transform infrared spectrometer to detect the gas sample to be detected, obtain the signal of the output light intensity changing with the optical path difference, and calibrate it as an interference signal. Convert the interference signal into a spectrum through Fourier transform, and calculate the number of wavelength points based on the wavelength range and resolution;

[0010] Step 2: Perform singular value decomposition on the spectrum to obtain eigenvalues, construct a singular value diagonal matrix from the obtained eigenvalues ​​in descending order, and mark the diagonal elements of the singular value diagonal matrix as singular values;

[0011] Step 3: Calculate the difference between adjacent elements of singular values, form a difference sequence and calibrate the sequence number, calculate the mean and standard deviation of the difference sequence, build a discriminant model based on the mean and standard deviation, mark the difference higher than the output result of the discriminant model as a mutation point, and select the sequence number corresponding to the largest mutation point as the component number;

[0012] Step 4: The discriminant model uses the number of components as columns and a random number generator to generate an initial concentration matrix; uses the number of components as rows and the number of wavelength points as columns and a random number generator to generate an initial absorption spectrum matrix;

[0013] Step 5: Use the MCR-ALS algorithm to first fix the concentration matrix to update the absorption spectrum matrix, then fix the absorption spectrum matrix to update the concentration matrix, and repeat this process. In each iteration, calculate the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration. When the norm change is less than the set norm change threshold, stop the iteration and obtain the absorption spectrum matrix after iteration.

[0014] Step 6: Pre-set a correlation coefficient threshold, calculate the correlation coefficient between the absorption spectrum matrix and each spectrum in the standard spectrum library, and the gas type represented by the standard spectrum exceeding the correlation coefficient threshold is one of the gas types contained in the test sample. The relative content of each gas is determined by calculating the average value of each column of the concentration matrix.

[0015] Furthermore, the Fourier transform infrared spectrometer uses 4000cm -1 Up to 400cm -1 The infrared light is used to irradiate the gas sample for detection. The number of measurement scans is set to n, and the number of wavelength points is set to p, where n is a positive integer ≥ 5. The interference pattern obtained from each scan is converted into an absorption spectrum matrix in the frequency domain through the built-in Fourier transform function:

[0016]

[0017] Where A is the absorption spectrum matrix, a ij Represented as an element in a matrix, where i represents the row index and j represents the column index, where the dimension of the absorption spectrum matrix is ​​m*n, where m is the number of frequency points and n is the number of measurement scans;

[0018] Further, calculate the transpose A of the absorption spectrum matrix A T :

[0019]

[0020] Calculate A using matrix multiplication T A:

[0021]

[0022] In the formula, (A T A) ij Represented as matrix A T The element in row i and column j of A, a ki Represented as the transposed matrix A t The Kth row and ith column element in a kj Represented as the transposed matrix A T The Kth row and jth column element in A T A performs eigenvalue decomposition to obtain the value that satisfies A T A=VDV T The orthogonal matrix V and diagonal matrix D are used to construct the characteristic equation:

[0023] det(A T A-λI)=0

[0024] In the formula, λ is represented as the eigenvalue, I is the n*n unit matrix, and the n eigenvalues ​​can be obtained by solving the characteristic equation. These eigenvalues ​​are organized into a diagonal matrix from large to small, that is,

[0025]

[0026] Furthermore, by calculating the eigenvalue λ on the diagonal of the diagonal matrix D i Perform a square root operation:

[0027]

[0028] In the formula, σ i Expressed as with the eigenvalue λ i One-to-one correspondence of singular values, where the matrix V is composed of A T The orthogonal matrix composed of the eigenvectors of A has a dimension of n*n. The matrix D is a diagonal matrix. The elements on the diagonal are the eigenvalues ​​of the matrix, and all the off-diagonal elements are 0. The matrix VT is the transposed matrix of V, and V and V T are inverse matrices of each other,

[0029] Place the calculated singular values ​​on the diagonal of the matrix with dimension m*n in descending order to form a singular value diagonal matrix:

[0030]

[0031] Furthermore, setting d i is the difference between adjacent elements of the singular value array, then the difference sequence is:

[0032] d=[d1,d2,…,d n-1 ]

[0033] In the formula, d represents the difference sequence, d i =σ i+1 -σ i ;

[0034] Calculate the mean of the difference sequence d

[0035]

[0036] Calculate the standard deviation σ of the difference sequence d d :

[0037]

[0038] Constructed discriminant model:

[0039]

[0040] Will satisfy The index record corresponding to the element is recorded and the position is marked as the mutation point.

[0041] Furthermore, the dimension of the initial concentration matrix is ​​determined to be g*1 according to the number of components, and the range of concentration values ​​is set to [0, 1]. Then, random numbers are generated in the interval in a uniformly distributed manner to fill the matrix, row by row and column by column, to obtain the initial concentration matrix.

[0042] The dimension of the initial absorption spectrum matrix is ​​determined to be g*p according to the number of components and wavelength points. The value range of the spectrum data is set to [0, 1]. Random numbers are generated in this interval in a uniformly distributed manner to fill the matrix. Starting from the first row and first column of the matrix, the generated random number is placed in this position, and then the elements of the remaining columns of the row are filled one by one to the right. This rule is followed row by row until all elements of the entire matrix are filled, and the initial absorption spectrum matrix is ​​obtained.

[0043] Furthermore, the norm change threshold is set to μ, and the objective function is constructed:

[0044]

[0045] For the objective function with respect to s lj Find partial derivatives:

[0046]

[0047] Let the partial derivative Record the results in matrix form: T C)S T =C T A, solve for S T :

[0048] S T =(C T C) -1 C T A

[0049] For S T After transposing to obtain the new absorption spectrum matrix S, the Frobenius norm is used to measure the degree of change. The calculation formula is:

[0050]

[0051] In the formula, s lj is the element in the absorption spectrum matrix S obtained in this iteration, is the absorption spectrum matrix S of the previous iteration prew The corresponding element in the calculation will change the norm of the absorption spectrum matrix ‖ΔS‖ F Compare with the norm change threshold μ:

[0052] When ‖ΔS‖ F <μ, the iteration stops, and the current concentration matrix C and absorption spectrum matrix S are the final results;

[0053] When ‖ΔS‖ F >μ, enter the steps of fixing the absorption spectrum matrix and updating the concentration matrix:

[0054] Fix the absorption spectrum matrix S and construct the objective function about the concentration matrix C:

[0055]

[0056] For the objective function with respect to c lj Find the partial derivative, set the partial derivative equal to 0, and organize it into a matrix form: (SS T )C T =SA T , and then solve the concentration matrix C:

[0057] C T =(SS T ) -1 SA T

[0058] C T Transpose to get a new concentration matrix C, and then calculate the updated concentration matrix C and the concentration matrix C obtained in the previous iteration prev The change norm between , that is, calculate the Frobenius norm:

[0059]

[0060] The concentration matrix change norm ‖ΔC‖ F Compared with the set threshold μ,

[0061] When ‖ΔC‖ F <μ, stop the iteration and output the current concentration matrix C and absorption spectrum matrix S;

[0062] When ‖ΔC‖ F >μ, the number of iterations is increased, and then the step of fixing the concentration matrix to update the absorption spectrum matrix is ​​returned again, and the iteration is continued until the change norms of the concentration matrix C and the absorption spectrum matrix S respectively corresponding to the matrices of the previous iteration are less than the set norm change threshold μ.

[0063] Furthermore, define s stdi′ It is represented as the i′th standard absorption spectrum matrix in the standard spectrum library. For the resolved absorption spectrum matrix S, the Pearson correlation coefficient is calculated between it and each standard spectrum in the standard spectrum library:

[0064]

[0065] In the formula, r i′ Expressed as the absorption spectrum matrix S and each standard spectrum s stdi′ The correlation coefficient, s stdi′j′ represents the j′th column element in the standard absorption spectrum matrix, s lj It is represented by the elements in the absorption spectrum matrix S finally resolved after iterative use of the MCR-ALS algorithm. It is expressed as the average value of the elements in the lth row of the absorption spectrum matrix S, Denoted as the i′th standard spectrum s stdi′ The average value of the elements;

[0066] Set the correlation coefficient threshold to r th , and compare the calculated correlation coefficient r i′ With threshold r th , when ri′ >r th When , it is determined that the gas type represented by the corresponding i'th spectrum in the standard spectrum library is one of the gas types contained in the detection sample.

[0067] Furthermore, for the gas species that have been confirmed to exist, a relative content formula is constructed:

[0068]

[0069] In the formula, c ij Represented as an element in the concentration matrix C, c l Expressed as the relative content of the first determined gas.

[0070] The present invention further provides a gas identification system based on Fourier transform infrared spectrometer, the system is used to execute the above-mentioned gas identification method based on Fourier transform infrared spectrometer, comprising:

[0071] The data acquisition and processing module is used to detect the gas sample to be detected using a Fourier transform infrared spectrometer, obtain the output signal of the light intensity changing with the optical path difference, and calibrate it as an interference signal, convert the interference signal into a spectrum through Fourier transform, and calculate the number of wavelength points based on the wavelength range and resolution;

[0072] A singular value decomposition module is used to perform singular value decomposition on the spectrum to obtain eigenvalues, construct a singular value diagonal matrix from the obtained eigenvalues ​​in descending order, and mark the diagonal elements of the singular value diagonal matrix as singular values;

[0073] The component number determination module is used to calculate the difference between adjacent elements of singular values, form a difference sequence and calibrate the sequence number, calculate the mean and standard deviation of the difference sequence, build a discriminant model based on the mean and standard deviation, mark the difference higher than the output result of the discriminant model as a mutation point, and select the sequence number corresponding to the largest mutation point as the component number;

[0074] The matrix generation module is used to discriminate the model, using the number of components as columns and a random number generator to generate an initial concentration matrix; using the number of components as rows and the number of wavelength points as columns and a random number generator to generate an initial absorption spectrum matrix;

[0075] The algorithm iteration module is used to apply the MCR-ALS algorithm, first fix the concentration matrix to update the absorption spectrum matrix, then fix the absorption spectrum matrix to update the concentration matrix, and repeat the iteration. In each iteration, the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration is calculated. When the norm change is less than the set norm change threshold, the iteration is stopped to obtain the absorption spectrum matrix after iteration.

[0076] The gas relative content calculation module is used to pre-set a correlation coefficient threshold, calculate the correlation coefficient between the absorption spectrum matrix and each spectrum in the standard spectrum library, and the gas type represented by the standard spectrum exceeding the correlation coefficient threshold is one of the gas types contained in the test sample. The relative content of each gas is determined by calculating the average value of each column of the concentration matrix.

[0077] Compared with the prior art, the present invention has the following beneficial effects:

[0078] By performing singular value decomposition on the spectrum, we can deeply explore the intrinsic information in the spectral data, construct a diagonal matrix using singular values, and determine the number of components based on the analysis of the differences between adjacent singular values. This method can more accurately reflect the composition characteristics of the gas sample. Compared with traditional methods that may only rely on a single spectral feature or simple signal processing, this method can more comprehensively capture the complex information of gas molecules in the infrared spectrum, thereby effectively improving the accuracy of gas identification.

[0079] When determining the type of gas, the reliability of gas type identification is enhanced by calculating the Pearson correlation coefficient between the analyzed absorption spectrum matrix and each spectrum in the standard spectrum library, and setting a reasonable threshold for judgment. Then, iterative calculations are performed using the MCR-ALS algorithm, and the results are gradually optimized by alternating fixed concentration matrices and absorption spectrum matrices to determine the relative content of each gas, making the invention have a wider range of application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 It is a schematic diagram of the overall method flow of the present invention;

[0081] Figure 2 It is a schematic diagram of the overall system module of the present invention. DETAILED DESCRIPTION

[0082] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0083] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0084] Example:

[0085] See also Figure 1 , the present invention provides a technical solution:

[0086] A gas identification method based on Fourier transform infrared spectrometer, the specific steps include:

[0087] Step 1: Use a Fourier transform infrared spectrometer to detect the gas sample to be detected, obtain the signal of the output light intensity changing with the optical path difference, and calibrate it as an interference signal. Convert the interference signal into a spectrum through Fourier transform, and calculate the number of wavelength points based on the wavelength range and resolution;

[0088] Different gas molecules have unique absorption characteristics in the infrared band. In this way, the overall absorption information of the gas sample in the infrared spectrum can be obtained. Therefore, the light source of the Fourier transform infrared spectrometer is set to emit 4000cm -1 Up to 400cm -1 The wide-band infrared light is used to irradiate the central area of ​​the gas sample placed in a specific sample chamber vertically. Compared with the edge area, the central area is less affected by external factors and can better represent the state of the entire sample. The detector of the instrument is used to record the interference signal that changes with time. This interference signal is the result of light propagating and interfering in the sample, but it is in the time domain. Then, the built-in Fourier transform function of the instrument is started, and the interference signal in the time domain is converted into an absorption spectrum in the frequency domain according to the Fourier transform algorithm, and an absorption spectrum matrix A with a dimension of m*n is obtained:

[0089]

[0090] Where m is the frequency point number, n is the number of measurement scans, for example, every 1cm -1If one frequency point is collected, then the number of frequency points m = 3601, and the instrument is set to scan 10 times, then the number of measurement scans n = 10.

[0091] Step 2: Perform singular value decomposition on the spectrum to obtain eigenvalues, construct a singular value diagonal matrix from the obtained eigenvalues ​​in descending order, and mark the diagonal elements of the singular value diagonal matrix as singular values;

[0092] Singular value decomposition is a powerful matrix analysis technique that can decompose the original absorption spectrum matrix into multiple components with different importance, perform dimensionality reduction on complex spectral data, highlight the main features of the data, reduce the interference of noise and redundant information, and extract valuable information for gas identification.

[0093] Perform singular value decomposition on the absorption spectrum matrix A. First, calculate the transpose A of the matrix A. T :

[0094]

[0095] Constructing matrix multiplication:

[0096]

[0097] AA is obtained by calculation T , construct the characteristic equation:

[0098] det(AA T -λI)=0

[0099] In the formula, λ is represented as the eigenvalue, I is represented as the n*n unit matrix, and the characteristic equation is solved to satisfy A T A=VDV T The orthogonal matrix V and diagonal matrix D of , where n eigenvalues ​​are calculated, and the elements on the diagonal of the diagonal matrix D are arranged in descending order, that is,

[0100]

[0101] By calculating each eigenvalue λ on the diagonal of the diagonal matrix D i Perform a square root operation:

[0102]

[0103] In the formula, σ i Expressed as with the eigenvalue λ i One-to-one correspondence of singular values, where the matrix V is composed of A T The orthogonal matrix composed of the eigenvectors of A has a dimension of n*n. The matrix D is a diagonal matrix. The elements on the diagonal are the eigenvalues ​​of the matrix, and all the off-diagonal elements are 0. The matrix VT is the transposed matrix of V, and V and V T The inverse matrices are placed on the diagonal of the matrix with dimension m*n in descending order to form a singular value diagonal matrix:

[0104]

[0105] Step 3: Calculate the difference between adjacent elements of singular values, form a difference sequence and calibrate the sequence number, calculate the mean and standard deviation of the difference sequence, build a discriminant model based on the mean and standard deviation, mark the difference higher than the output result of the discriminant model as a mutation point, and select the sequence number corresponding to the largest mutation point as the component number;

[0106] Singular values ​​reflect the importance or degree of change of spectral data in different dimensions. The difference sequence of singular values ​​and their statistical characteristics, namely the mean and standard deviation, are calculated because in the singular value sequence, the changes in singular values ​​caused by the main components and the changes in singular values ​​caused by noise or other minor factors have different statistical laws. The singular values ​​related to the number of gas components will show a large change (mutation) at a certain point. By constructing a discriminant model and using the mean and standard deviation to define this mutation, the key information points related to the number of components can be automatically identified from the singular value sequence, thereby determining the number of components. The components corresponding to the number of components contain the most significant spectral characteristics of each gas, and the value is equivalent to the number of main components of complex spectral data.

[0107] Suppose the singular value sequence of the singular value diagonal matrix is:

[0108] σ=[σ1,σ2…σ n ]

[0109] Compute the differences between adjacent singular values:

[0110] d=[d1,d2,…,d n-1 ]

[0111] In the formula, d represents the difference sequence, d i =σ i+1 -σ i , expressed as the difference between adjacent elements of singular values;

[0112] Calculate the mean of the difference sequence d

[0113]

[0114] Calculate the standard deviation σ of the difference sequence d d :

[0115]

[0116] Constructed discriminant model:

[0117]

[0118] Will satisfy The index record corresponding to the element is recorded, and the position is marked as the mutation point. Then, among all the mutation points, the value corresponding to the largest mutation point is selected as the component number.

[0119] Step 4: The discriminant model uses the number of components as columns and a random number generator to generate an initial concentration matrix; uses the number of components as rows and the number of wavelength points as columns and a random number generator to generate an initial absorption spectrum matrix;

[0120] At the beginning of the MCR-ALS algorithm, it is necessary to provide an initial concentration matrix and absorption spectrum matrix as the starting point of the iteration. Since there is no exact information about the concentration and spectrum of the gas sample at the beginning, the use of random number generation can provide an initial estimate so that the algorithm can start iterative calculations. Generating random numbers uniformly distributed in the range of [0, 1] is a simple and commonly used initialization method. It can ensure the randomness and diversity of the initial matrix to a certain extent, avoid the initial value being too biased towards a specific situation, and help the algorithm gradually converge to the true solution in the subsequent iteration process.

[0121] According to the number of components, the dimension of the initial concentration matrix is ​​determined to be g*1, and the range of concentration values ​​is set to [0, 1]. Then, random numbers are generated in the interval in a uniform distribution to fill the matrix, row by row and column by column, to obtain the initial concentration matrix.

[0122] The dimension of the initial absorption spectrum matrix is ​​determined to be g*p according to the number of components and wavelength points. The value range of the spectrum data is set to [0, 1]. Random numbers are generated in this interval in a uniformly distributed manner to fill the matrix. Starting from the first row and first column of the matrix, the generated random number is placed in this position, and then the elements of the remaining columns of the row are filled one by one to the right. This rule is followed row by row until all elements of the entire matrix are filled, and the initial absorption spectrum matrix is ​​obtained.

[0123] Step 5: Use the MCR-ALS algorithm to first fix the concentration matrix to update the absorption spectrum matrix, then fix the absorption spectrum matrix to update the concentration matrix, and repeat this process. In each iteration, calculate the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration. When the norm change is less than the set norm change threshold, stop the iteration and obtain the absorption spectrum matrix after iteration.

[0124] Set the norm change threshold to μ and construct the objective function:

[0125]

[0126] For the objective function with respect to s lj Find partial derivatives:

[0127]

[0128] Let the partial derivative Record the results in matrix form: T C)S T =C T A, solve for S T :

[0129] S T =(C T C) -1 C T A

[0130] For S T After transposing to obtain the new absorption spectrum matrix S, the Frobenius norm is used to measure the degree of change. The calculation formula is:

[0131]

[0132] In the formula, s lj is the element in the absorption spectrum matrix S obtained in this iteration, is the absorption spectrum matrix S of the previous iteration prev The corresponding element in the calculation will change the norm of the absorption spectrum matrix ‖ΔS‖ F Compared with the norm change threshold μ, when ‖ΔS‖ F <μ, the iteration stops, and the current concentration matrix C and absorption spectrum matrix S are the final results. F >μ, enter the steps of fixing the absorption spectrum matrix and updating the concentration matrix:

[0133] Construct the objective function about the concentration matrix C:

[0134]

[0135] For the objective function with respect to c lj Find the partial derivative, set the partial derivative equal to 0, and organize it into a matrix form: (SS T )C T =SA T , and then solve the concentration matrix C:

[0136] C T =(SS T ) -1 SA T

[0137] C TTranspose to get a new concentration matrix C, and then calculate the updated concentration matrix C and the concentration matrix C obtained in the previous iteration prev The change norm between , that is, calculate the Frobenius norm:

[0138]

[0139] The concentration matrix change norm ‖ΔC‖ F Compared with the set threshold μ, when ‖ΔC‖ F <μ, stop the iteration and output the current concentration matrix C and absorption spectrum matrix S. F >μ, the number of iterations is increased, and then the step of fixing the concentration matrix to update the absorption spectrum matrix is ​​returned again, and the iteration is continued until the change norms of the concentration matrix C and the absorption spectrum matrix S respectively corresponding to the matrices of the previous iteration are less than the set norm change threshold μ.

[0140] The core of the MCR-ALS algorithm is to iteratively solve the concentration matrix and the absorption spectrum matrix through the alternating least squares method. The construction of the objective function and the partial derivative are based on the principle of the least squares method, and the purpose is to minimize the sum of squares of the error between the measured data (absorption spectrum matrix A) and the data calculated by the current concentration matrix C and the absorption spectrum matrix S. By continuously updating the absorption spectrum matrix and the concentration matrix, this error is gradually reduced, thereby approaching the true concentration and spectrum information. The purpose of setting the change norm threshold and comparing it is to determine whether the iteration has converged, that is, whether the current matrix update is small enough and does not need to continue iterating, so as to avoid overcalculation and ensure reasonable results. Through this iterative optimization process, the accuracy of the concentration matrix and the absorption spectrum matrix is ​​gradually improved, and subsequent gas type identification and content determination can be performed based on these accurate matrices.

[0141] Step 6: Preset a correlation coefficient threshold, calculate the correlation coefficient between the absorption spectrum matrix and each spectrum in the standard spectrum library, the gas type represented by the standard spectrum exceeding the correlation coefficient threshold is one of the gas types contained in the test sample, and determine the relative content of each gas by calculating the average value of each column of the concentration matrix;

[0142] The HITRAN database is jointly compiled and maintained by the Smithsonian Center for Astrophysics at Harvard University and the Air Force Geophysical Laboratory. It is one of the most widely used high-resolution infrared spectral databases. It covers the infrared absorption spectrum data of various gas molecules and contains standard spectrum data of many known gases. Each standard spectrum has the same wavelength point dimension p as the gas sample absorption spectrum matrix.

[0143] Definitions stdi′It is represented as the i′th standard absorption spectrum matrix in the standard spectrum library. For the resolved absorption spectrum matrix S, the Pearson correlation coefficient is calculated between it and each standard spectrum in the standard spectrum library:

[0144]

[0145] In the formula, r i′ Expressed as the absorption spectrum matrix S and each standard spectrum s stdi′ The correlation coefficient, s stdi′j′ represents the j′th column element in the standard absorption spectrum matrix, s lj It is represented by the elements in the absorption spectrum matrix S finally resolved after iterative use of the MCR-ALS algorithm. It is expressed as the average value of the elements in the lth row of the absorption spectrum matrix S, Denoted as the i′th standard spectrum s stdi′ The average value of the elements;

[0146] The Pearson correlation coefficient is a statistical indicator used to measure the correlation between two variables. In gas identification, the absorption spectrum matrix represents the spectral information analyzed from the sample. By calculating the Pearson correlation coefficient, the linear similarity between the analyzed spectrum and the standard spectrum can be quantitatively evaluated. For example, when the shapes and change trends of the two spectra are highly consistent, their Pearson correlation coefficients will be close; when the two spectra are completely unrelated, such as one spectrum has an absorption peak and the other has no absorption peak at the same position, or their change trends are completely opposite, the correlation coefficient will be close or even negative. The use of the Pearson correlation coefficient can fully capture these differences and more accurately determine whether they are the same gas. This overall consideration method is in line with the characteristics of the gas spectrum, and can intuitively judge the similarity between the analyzed spectrum and the standard spectrum, and then determine whether the sample contains the corresponding known gas.

[0147] Then set the correlation coefficient threshold to r th , according to the requirements for gas identification accuracy and the quality factors of the standard spectral library. If the threshold is set too low, it may lead to misjudgment, and some spectra that are similar but not the target gas may also be judged as matching; if the threshold is set too high, some actually existing gases may be missed. Therefore, the correlation coefficient threshold is set to r th =0.9, which can be appropriately reduced when the accuracy requirement is low. Compare the calculated correlation coefficient r i′ The correlation coefficient threshold r th , for any r i′ >r th When , it is determined that the gas type represented by the corresponding i'th spectrum in the standard spectrum library is one of the gas types contained in the detection sample.

[0148] For the gases that have been confirmed to exist, that is, those gases whose correlation coefficients exceed the correlation coefficient threshold, let the concentration matrix be C. At this time, the number of gases that have been confirmed is j. For example, after calculating all the correlation coefficients, it is found that r1>r th 、r3>r th and r7>r th , which means that there are gases in the sample corresponding to the 1st, 3rd and 7th standard spectra in the standard spectrum library, then the number of gas types j = 3, each correlation coefficient exceeding the threshold corresponds to an identified gas, and the number of gas types is determined by counting the number of correlation coefficients exceeding the threshold.

[0149] For the jth column of the concentration matrix C, construct the relative content formula:

[0150]

[0151] The relative content of each identified gas is calculated through this formula, thereby completing the type identification and content determination of the gas sample.

[0152] See also Figure 2 The present invention further provides a gas identification device based on a Fourier transform infrared spectrometer, wherein the system is used to execute the above-mentioned gas identification method based on a Fourier transform infrared spectrometer, comprising:

[0153] The data acquisition and processing module is used to detect the gas sample to be detected using a Fourier transform infrared spectrometer, obtain the output signal of the light intensity changing with the optical path difference, and calibrate it as an interference signal, convert the interference signal into a spectrum through Fourier transform, and calculate the number of wavelength points based on the wavelength range and resolution;

[0154] A singular value decomposition module is used to perform singular value decomposition on the spectrum to obtain eigenvalues, construct a singular value diagonal matrix from the obtained eigenvalues ​​in descending order, and mark the diagonal elements of the singular value diagonal matrix as singular values;

[0155] The component number determination module is used to calculate the difference between adjacent elements of singular values, form a difference sequence and calibrate the sequence number, calculate the mean and standard deviation of the difference sequence, build a discriminant model based on the mean and standard deviation, mark the difference higher than the output result of the discriminant model as a mutation point, and select the sequence number corresponding to the largest mutation point as the component number;

[0156] The matrix generation module is used to discriminate the model, using the number of components as columns and a random number generator to generate an initial concentration matrix; using the number of components as rows and the number of wavelength points as columns and a random number generator to generate an initial absorption spectrum matrix;

[0157] The algorithm iteration module is used to apply the MCR-ALS algorithm, first fix the concentration matrix to update the absorption spectrum matrix, then fix the absorption spectrum matrix to update the concentration matrix, and repeat the iteration. In each iteration, the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration is calculated. When the norm change is less than the set norm change threshold, the iteration is stopped to obtain the absorption spectrum matrix after iteration.

[0158] The gas relative content calculation module is used to pre-set a correlation coefficient threshold, calculate the correlation coefficient between the absorption spectrum matrix and each spectrum in the standard spectrum library, and the gas type represented by the standard spectrum exceeding the correlation coefficient threshold is one of the gas types contained in the test sample. The relative content of each gas is determined by calculating the average value of each column of the concentration matrix.

[0159] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0160] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0161] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A gas identification method based on Fourier transform infrared spectrometer, characterized in that: The specific steps include: Step 1: Use a Fourier transform infrared spectrometer to detect the gas sample to be detected, obtain the signal of the output light intensity changing with the optical path difference, and calibrate it as an interference signal. Convert the interference signal into a spectrum through Fourier transform, and calculate the number of wavelength points based on the wavelength range and resolution; Step 2: Perform singular value decomposition on the spectrum to obtain eigenvalues, construct a singular value diagonal matrix from the obtained eigenvalues ​​in descending order, and mark the diagonal elements of the singular value diagonal matrix as singular values; Step 3: Calculate the difference between adjacent elements of singular values, form a difference sequence and calibrate the sequence number, calculate the mean and standard deviation of the difference sequence, build a discriminant model based on the mean and standard deviation, mark the difference higher than the output result of the discriminant model as a mutation point, and select the sequence number corresponding to the largest mutation point as the component number; Step 4: The discriminant model uses the number of components as columns and a random number generator to generate an initial concentration matrix; uses the number of components as rows and the number of wavelength points as columns and a random number generator to generate an initial absorption spectrum matrix; Step 5: Use the MCR-ALS algorithm to first fix the concentration matrix to update the absorption spectrum matrix, then fix the absorption spectrum matrix to update the concentration matrix, and repeat this process. In each iteration, calculate the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration. When the norm change is less than the set norm change threshold, stop the iteration and obtain the absorption spectrum matrix after iteration. Step 6: Pre-set a correlation coefficient threshold, calculate the correlation coefficient between the absorption spectrum matrix and each spectrum in the standard spectrum library, and the gas type represented by the standard spectrum exceeding the correlation coefficient threshold is one of the gas types contained in the test sample. The relative content of each gas is determined by calculating the average value of each column of the concentration matrix.

2. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: The steps to calculate the number of wavelength points based on wavelength range and resolution are: Fourier transform infrared spectrometer with 4000cm -1 Up to 400cm -1 The infrared light is used to irradiate the gas sample for detection. The number of measurement scans is set to n, and the number of wavelength points is set to p, where n is a positive integer ≥ 5. The interference pattern obtained from each scan is converted into an absorption spectrum matrix in the frequency domain through the built-in Fourier transform function: Where A is the absorption spectrum matrix, a ij Represented as elements in a matrix, where i represents the row index and j represents the column index. The dimension of the absorption spectrum matrix is ​​m*n, where m is the number of frequency points and n is the number of measurement scans.

3. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 2, performing singular value decomposition on the spectrum includes the following steps: Calculate the transpose A of the absorption spectrum matrix A T : Calculate A using matrix multiplication T A: In the formula, (A T A) ij Represented as matrix A T The element in row i and column j of A, a ki Represented as the transposed matrix A T The Kth row and ith column element in a kj Represented as the transposed matrix A T The Kth row and jth column element in A T A performs eigenvalue decomposition to obtain the value that satisfies A T A=VDV T The orthogonal matrix V and diagonal matrix D are used to construct the characteristic equation: det(A T A-λI)=0 In the formula, λ is represented as the eigenvalue, I is the n*n unit matrix, and the n eigenvalues ​​can be obtained by solving the characteristic equation. These eigenvalues ​​are organized into a diagonal matrix from large to small, that is, 4. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 2, the method of constructing a singular value diagonal matrix from the obtained eigenvalues ​​in order from large to small is: By calculating each eigenvalue λ on the diagonal of the diagonal matrix D i Perform a square root operation: In the formula, σ i Expressed as with the eigenvalue λ i One-to-one correspondence of singular values, where the matrix V is composed of A T The orthogonal matrix composed of the eigenvectors of A has a dimension of n*n. The matrix D is a diagonal matrix. The elements on the diagonal are the eigenvalues ​​of the matrix, and all the off-diagonal elements are 0. The matrix V T is the transposed matrix of V, and V and V T are inverse matrices of each other, Place the calculated singular values ​​on the diagonal of the matrix with dimension m*n in descending order to form a singular value diagonal matrix:

5. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 3, a discriminant model is constructed based on the mean and standard deviation, and the difference value higher than the calculated result of this model is marked as a mutation point by: Setting i is the difference between adjacent elements of the singular value array, then the difference sequence is: d=[d1,d2,…,d n-1 ] In the formula, d represents the difference sequence, d i =σ i+1 -σ i ; Calculate the mean of the difference sequence d Calculate the standard deviation σ of the difference sequence d d : Constructed discriminant model: Will satisfy The index record corresponding to the element is recorded and the position is marked as the mutation point.

6. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 4, the method for generating the initial absorption spectrum matrix is: The dimension of the initial concentration matrix is ​​determined to be g*1 according to the number of components, and the range of concentration values ​​is set to [0, 1]. Then, random numbers are generated in the interval in a uniform distribution to fill the matrix, row by row and column by column, to obtain the initial concentration matrix. The dimension of the initial absorption spectrum matrix is ​​determined to be g*p according to the number of components and wavelength points. The value range of the spectrum data is set to [0, 1]. Random numbers are generated in this interval in a uniformly distributed manner to fill the matrix. Starting from the first row and first column of the matrix, the generated random number is placed in this position, and then the elements of the remaining columns of the row are filled one by one to the right. This rule is followed row by row until all elements of the entire matrix are filled, and the initial absorption spectrum matrix is ​​obtained.

7. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 4, the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration is calculated in each iteration. When the norm change is less than the set norm change threshold, the iteration is stopped, which includes the following steps: Set the norm change threshold to μ and construct the objective function: For the objective function with respect to s ij Find partial derivatives: Let the partial derivative Record the results in matrix form: T C)S T =C T A, solve for S T : S T =(C T C) -1 C T A For S T After transposing to obtain the new absorption spectrum matrix S, the Frobenius norm is used to measure the degree of change. The calculation formula is: In the formula, s lj is the element in the absorption spectrum matrix S obtained in this iteration, is the absorption spectrum matrix S of the previous iteration prev The corresponding element in the calculation will change the norm of the absorption spectrum matrix ‖ΔS‖ F Compare with the norm change threshold μ: When ‖ΔS‖ F is less than μ, stop the iteration. The current concentration matrix C and absorption spectrum matrix S are the final results; When ‖ΔS‖ F >μ, enter the steps of fixing the absorption spectrum matrix and updating the concentration matrix: Fix the absorption spectrum matrix S and construct the objective function about the concentration matrix C: For the objective function with respect to c lj Find the partial derivative, set the partial derivative equal to 0, and organize it into a matrix form: (SS T )C T =SA T , and then solve the concentration matrix C: C T =(SS T ) -1 IN T C T Transpose to get a new concentration matrix C, and then calculate the updated concentration matrix C and the concentration matrix C obtained in the previous iteration prev The change norm between , that is, calculate the Frobenius norm: The concentration matrix change norm ‖ΔC‖ F Compared with the set threshold μ, When ‖ΔC‖ F <μ, stop the iteration and output the current concentration matrix C and absorption spectrum matrix S; When ‖ΔC‖ F >μ, the number of iterations is increased, and then the step of fixing the concentration matrix to update the absorption spectrum matrix is ​​returned again, and the iteration is continued until the change norms of the concentration matrix C and the absorption spectrum matrix S respectively corresponding to the matrices of the previous iteration are less than the set norm change threshold μ.

8. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 6, the method for determining the corresponding gas type is: Definitions stdi′ It is represented as the i′th standard absorption spectrum matrix in the standard spectrum library. For the resolved absorption spectrum matrix S, the Pearson correlation coefficient is calculated between it and each standard spectrum in the standard spectrum library: In the formula, r i′ Expressed as the absorption spectrum matrix S and each standard spectrum s stdi′ The correlation coefficient, s stdi′j′ represents the j′th column element in the standard absorption spectrum matrix, s lj It is represented by the elements in the absorption spectrum matrix S finally resolved after iterative use of the MCR-ALS algorithm. It is expressed as the average value of the elements in the lth row of the absorption spectrum matrix S, Denoted as the i′th standard spectrum s stdi′ The average value of the elements; Set the correlation coefficient threshold to r th , and compare the calculated correlation coefficient r i′ With threshold r th , when r i′ >r th When , it is determined that the gas type represented by the corresponding i'th spectrum in the standard spectrum library is one of the gas types contained in the detection sample.

9. The gas identification method based on Fourier transform infrared spectrometer according to claim 1, characterized in that: In step 6, the method for determining the relative content of each gas by calculating the average value of each column of the concentration matrix is: For the gas species that have been confirmed to exist, the relative content formula is constructed: In the formula, c ij Represented as an element in the concentration matrix C, c l Expressed as the relative content of the first determined gas.

10. A gas identification device based on Fourier transform infrared spectrometer, characterized in that: The system is used to execute a gas identification method based on Fourier transform infrared spectrometer according to any one of claims 1 to 9: The data acquisition and processing module is used to detect the gas sample to be detected using a Fourier transform infrared spectrometer, obtain the output signal of the light intensity changing with the optical path difference, and calibrate it as an interference signal, convert the interference signal into a spectrum through Fourier transform, and calculate the number of wavelength points based on the wavelength range and resolution; A singular value decomposition module is used to perform singular value decomposition on the spectrum to obtain eigenvalues, construct a singular value diagonal matrix from the obtained eigenvalues ​​in descending order, and mark the diagonal elements of the singular value diagonal matrix as singular values; The component number determination module is used to calculate the difference between adjacent elements of singular values, form a difference sequence and calibrate the sequence number, calculate the mean and standard deviation of the difference sequence, build a discriminant model based on the mean and standard deviation, mark the difference higher than the output result of the discriminant model as a mutation point, and select the sequence number corresponding to the largest mutation point as the component number; The matrix generation module is used to discriminate the model with the number of components as columns and use a random number generator to generate the initial concentration matrix; The initial absorption spectrum matrix is ​​generated by a random number generator with the number of components as rows and the number of wavelength points as columns; The algorithm iteration module is used to apply the MCR-ALS algorithm, first fix the concentration matrix to update the absorption spectrum matrix, then fix the absorption spectrum matrix to update the concentration matrix, and repeat the iteration. In each iteration, the change norm of the concentration matrix and the absorption spectrum matrix compared with the previous iteration is calculated. When the norm change is less than the set norm change threshold, the iteration is stopped to obtain the absorption spectrum matrix after iteration. The gas relative content calculation module is used to pre-set a correlation coefficient threshold, calculate the correlation coefficient between the absorption spectrum matrix and each spectrum in the standard spectrum library, and the gas type represented by the standard spectrum exceeding the correlation coefficient threshold is one of the gas types contained in the test sample. The relative content of each gas is determined by calculating the average value of each column of the concentration matrix.

Citation Information

Patent Citations

  • Monitoring, detecting and quantifying chemical compounds in sample

    CN103210301A

  • Gas identification method based on Fourier transform infrared spectrometer

    CN107132195A

  • Residual gas analysis method and system based on intelligent spectrum fitting

    CN118730926A

  • Method and system for automatically detecting and reconstructing spectrum peaks in near infrared spectrum analysis of tea

    US20230243744A1

Cited By

  • Process end point detection method and semiconductor equipment

    CN121419610A