A method and system for measuring trace amounts of ammonia optically
Patent Information
- Application Number
- CN202510480727.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-04-17
AI Technical Summary
[0005]针对现有技术存在的不足,本发明的目的在于提供一种用光学手段测量微量氨的方法及系统,通过基于小波重构有效解决信号噪声干扰的问题,并通过贝叶斯因果分析方法,实时考虑环境因素对测量结果的影响,有效判断测量结果的准确性
[0043] This invention eliminates noise in Raman scattering light and photoacoustic signals through a signal reconstruction step and enhances the effective signal, making the trace ammonia signal, which was originally difficult to detect accurately, clearer and thus improving the measurement accuracy. Furthermore, the measurement results are further verified based on relevant variables using Bayesian causal analysis, thereby obtaining the most accurate trace ammonia concentration.
Smart Images

Figure CN119985446B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ammonia concentration measurement technology, and more specifically to a method and system for measuring trace amounts of ammonia using optical means. Background Technology
[0002] The measurement of trace ammonia concentration is of great significance in industrial production, environmental monitoring, biomedicine and other fields, but traditional measurement methods have limitations such as low detection sensitivity, great susceptibility to environmental interference and insufficient measurement accuracy.
[0003] For example, Chinese patent CN105806806B provides a device and method for detecting the concentration of escaped ammonia based on TDLAS technology. It determines the center wavelength position of water vapor by the absorption peak of water vapor near the ammonia absorption spectrum line, and then determines the center wavelength position of ammonia by the relative position of the center wavelengths of ammonia and water vapor, thereby achieving accurate positioning of the ammonia absorption peak and thus determining the concentration of escaped ammonia.
[0004] However, this invention relies solely on the principle of spectral absorption to determine the position of the center wavelength of ammonia, and judges it only from the relative position of the absorption peaks, resulting in low measurement accuracy. Therefore, the existing technology has shortcomings. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for measuring trace amounts of ammonia using optical means. This method effectively solves the problem of signal noise interference by using wavelet reconstruction and, through Bayesian causal analysis, considers the influence of environmental factors on the measurement results in real time, thereby effectively judging the accuracy of the measurement results.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] This invention provides a method for measuring trace amounts of ammonia using optical means, comprising:
[0008] Acquire the Raman scattering light signal and photoacoustic signal of the ammonia-containing sample to be tested;
[0009] The Raman scattered light signal is reconstructed to obtain a first reconstructed signal, and the photoacoustic signal is reconstructed to obtain a second reconstructed signal;
[0010] The trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal.
[0011] As a further improvement of the present invention, the Raman scattered light signal is reconstructed to obtain a first reconstructed signal, and the photoacoustic signal is reconstructed to obtain a second reconstructed signal, including:
[0012] Based on the Raman scattered light signal and its corresponding wavelet basis function and decomposition level, a first wavelet coefficient sequence is obtained; based on the photoacoustic signal and its corresponding wavelet basis function and decomposition level, a second wavelet coefficient sequence is obtained.
[0013] Thresholding is applied to the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence;
[0014] Perform an inverse wavelet transform on the first reconstructed sequence to obtain the first reconstructed signal, and perform an inverse wavelet transform on the second reconstructed sequence to obtain the second reconstructed signal.
[0015] As a further improvement of the present invention, the step of performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence includes:
[0016] The first wavelet coefficient sequence and the second wavelet coefficient sequence are divided into blocks to obtain multiple first local blocks and multiple second local blocks;
[0017] Calculate the mean and standard deviation of each first local block and each second local block;
[0018] Based on the mean and standard deviation, the threshold corresponding to each first local block and each second local block is obtained;
[0019] Based on the threshold, the first wavelet coefficient sequence and the second wavelet coefficient sequence are adjusted to obtain the first reconstructed sequence and the second reconstructed sequence.
[0020] As a further improvement of the present invention, adjusting the first wavelet coefficient sequence and the second wavelet coefficient sequence according to the threshold includes:
[0021] For each wavelet coefficient in the first wavelet coefficient sequence and the second wavelet coefficient sequence, if the wavelet coefficient is less than or equal to the threshold, the wavelet coefficient is replaced with zero.
[0022] If the wavelet coefficients are greater than the threshold, the wavelet coefficients are shrunk towards zero.
[0023] As a further improvement of the present invention, the wavelet basis function corresponding to the Raman scattered light signal is the db4 wavelet basis function, and the wavelet basis function corresponding to the photoacoustic signal is the sym8 wavelet basis function.
[0024] As a further improvement of the present invention, the trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal, including:
[0025] Based on the first reconstructed signal, a Raman spectrum is obtained, and based on the second reconstructed signal, a photoacoustic spectrum is obtained.
[0026] The first ammonia concentration is obtained based on the position of the characteristic peak in the Raman spectrum, and the second ammonia concentration is obtained based on the position of the characteristic peak in the photoacoustic spectrum.
[0027] The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the Bayesian causal analysis method.
[0028] As a further improvement of the present invention, the trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the Bayesian causal analysis method, including:
[0029] Based on historical experimental data, the variables affecting the accuracy of the trace ammonia concentration were identified, and the likelihood function for the variables was calculated.
[0030] Based on the likelihood function and the prior probability of the trace ammonia concentration, the posterior probability formula for the trace ammonia concentration is obtained.
[0031] The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula.
[0032] As a further improvement of the present invention, if there are multiple variables, the calculation of the likelihood function with respect to the variables includes:
[0033] Based on the historical experimental data, determine the relationship between the variable and the trace ammonia concentration, and the correlation coefficient between the variables;
[0034] Based on the historical experimental data and the correlation coefficient, the mean vector and covariance matrix of the variables are obtained;
[0035] The likelihood function is obtained based on the relation, the mean vector, and the covariance matrix.
[0036] As a further improvement of the present invention, the trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, including:
[0037] Based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, the probabilities of the occurrence of the first ammonia concentration and the second ammonia concentration are obtained;
[0038] The probability is compared with a preset probability value. If the probability is greater than the preset probability value, the larger of the first ammonia concentration and the second ammonia concentration is taken as the trace ammonia concentration.
[0039] As a further improvement of the present invention, the present invention provides a system for measuring trace amounts of ammonia using optical means, comprising:
[0040] The acquisition module is used to acquire the Raman scattering light signal and photoacoustic signal of the ammonia-containing sample to be tested;
[0041] The reconstruction module is used to reconstruct the Raman scattered light signal to obtain a first reconstructed signal and to reconstruct the photoacoustic signal to obtain a second reconstructed signal.
[0042] The calculation module is used to calculate the trace ammonia concentration based on the first reconstructed signal and the second reconstructed signal.
[0043] This invention eliminates noise in Raman scattering light and photoacoustic signals through a signal reconstruction step and enhances the effective signal, making the trace ammonia signal, which was originally difficult to detect accurately, clearer and thus improving the measurement accuracy. Furthermore, the measurement results are further verified based on relevant variables using Bayesian causal analysis, thereby obtaining the most accurate trace ammonia concentration. Attached Figure Description
[0044] Figure 1 This is a flowchart illustrating the steps of the method of the present invention;
[0045] Figure 2 Flowchart of threshold processing steps;
[0046] Figure 3 This is a cause-and-effect diagram;
[0047] Figure 4 This is a schematic diagram of the detection equipment in this invention. Detailed Implementation
[0048] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof.
[0049] The term "and / or" in the following text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0050] like Figure 1 As shown in the embodiment of this application, a method for measuring trace amounts of ammonia using optical means is provided, comprising:
[0051] Acquire the Raman scattering light signal and photoacoustic signal of the ammonia-containing sample to be tested;
[0052] The Raman scattered light signal is reconstructed to obtain the first reconstructed signal, and the photoacoustic signal is reconstructed to obtain the second reconstructed signal;
[0053] The concentration of trace ammonia was calculated based on the first and second reconstructed signals.
[0054] Specifically, the steps for acquiring Raman scattering light signals are as follows: the excitation source is focused onto the ammonia-containing sample to be tested. At this time, the ammonia molecules interact with the excitation light to produce Raman scattering. The Raman scattered light is collected and transmitted to a spectrometer for spectral dispersion. Then, the Raman scattered light after spectral dispersion is incident on a detector. The detector converts the Raman scattered light into a Raman scattering light signal and transmits it to a computer for analysis. Preferably, the excitation source is emitted by a 785nm semiconductor laser.
[0055] Similarly, the photoacoustic signal acquisition steps are as follows: the excitation light source is focused on the ammonia-containing sample to be tested. At this time, the ammonia molecules interact with the excitation light. After absorbing the laser energy, the ammonia molecules undergo vibration and rotational energy level transitions, which leads to a local temperature increase in the gas and periodic thermal expansion, thereby forming sound waves. The sound waves are converted into photoelectric signals by a piezoelectric sensor and transmitted to a computer for analysis. Preferably, the excitation light source can be a distributed feedback (DFB) semiconductor laser with a center wavelength of about 1530nm.
[0056] This application embodiment removes noise from Raman scattering light and photoacoustic signals through a signal reconstruction step, and enhances the effective signal, so that the trace ammonia signal, which was originally difficult to detect accurately, can be presented more clearly, thereby improving the measurement accuracy. Furthermore, the measurement results are further verified based on relevant variables through Bayesian causal analysis, thereby obtaining the most accurate trace ammonia concentration.
[0057] Furthermore, embodiments of this application provide a step of reconstructing a Raman scattered light signal to obtain a first reconstructed signal, and reconstructing a photoacoustic signal to obtain a second reconstructed signal, comprising:
[0058] The first wavelet coefficient sequence is obtained based on the Raman scattered light signal, its corresponding wavelet basis function, and the number of decomposition layers. The second wavelet coefficient sequence is obtained based on the photoacoustic signal, its corresponding wavelet basis function, and the number of decomposition layers.
[0059] Thresholding is applied to the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence.
[0060] Perform an inverse wavelet transform on the first reconstructed sequence to obtain the first reconstructed signal, and perform an inverse wavelet transform on the second reconstructed sequence to obtain the second reconstructed signal.
[0061] Preferably, the wavelet basis function corresponding to the Raman scattered light signal is the db4 wavelet basis function, and the wavelet basis function corresponding to the photoacoustic signal is the sym8 wavelet basis function. The db4 wavelet basis has compact support, and the Raman scattered light signal is usually only meaningful within a certain wavenumber range. Therefore, the compact support of db4 allows it to better localize the signal within this limited range, thereby more accurately analyzing the detailed information of the Raman scattered light signal at each wavenumber position, which helps to distinguish the signal from noise. The sym8 wavelet basis has approximate symmetry, so the sym8 wavelet basis can better match the periodic characteristics of the photoacoustic signal, thereby more accurately capturing the periodic pattern of the signal during the wavelet transform process and reducing signal distortion.
[0062] Specifically, for a length of Raman scattered light signal vector , Indicates wavelength. Each element in the table represents the Raman scattering intensity at a given wavelength, and the number of decomposition layers is set. For length is photoacoustic signal vector , Indicates time, Each element in the table represents the photoacoustic signal intensity value at a given moment, and the number of decomposition layers is set. .
[0063] Next, the Raman scattered light signal vector conduct Layered wavelet transform yields wavelet coefficients at different scales. ,in , indicating different scales, The discrete wavelet coefficient index can also be represented as the index of the wavelet coefficients at the 1st digit. Position translation at various scales, where the specific formula for wavelet transform is... ,in For the db4 wavelet basis functions, each wavelet coefficient... Arrange them sequentially to obtain the first wavelet coefficient sequence.
[0064] Similarly, for photoacoustic signal vectors conduct Layered wavelet transform yields wavelet coefficients at different scales. ,in , indicating different scales, The discrete wavelet coefficient index can also be represented as the index of the wavelet coefficients at the 1st digit. Position translation at various scales, where the specific formula for wavelet transform is... ,in For the sym8 wavelet basis functions, each wavelet coefficient... Arrange them sequentially to obtain the second wavelet coefficient sequence.
[0065] The method provided in this application selects appropriate wavelet basis functions based on the characteristics of different signals, which can more accurately capture the characteristic information of the signal, and effectively remove noise while retaining the main characteristics of the signal through the thresholding process.
[0066] Furthermore, such as Figure 2 As shown, this embodiment provides a step of performing threshold processing on a first wavelet coefficient sequence and a second wavelet coefficient sequence respectively to obtain a first reconstructed sequence and a second reconstructed sequence, including:
[0067] The first wavelet coefficient sequence and the second wavelet coefficient sequence are divided into blocks to obtain multiple first local blocks and multiple second local blocks;
[0068] Calculate the mean and standard deviation of each first local block and each second local block;
[0069] Based on the mean and standard deviation, the thresholds corresponding to each first local block and each second local block are obtained;
[0070] Based on the threshold, the first wavelet coefficient sequence and the second wavelet coefficient sequence are adjusted to obtain the first reconstructed sequence and the second reconstructed sequence.
[0071] Specifically, for the first wavelet coefficient sequence, it is divided into multiple non-overlapping local blocks, assuming that each local block contains... Wavelet coefficients, assuming the first wavelet coefficient sequence contains... If there are several wavelet coefficients, then it can be divided into: The local block, and the first one of them Each local block is denoted as ,in , .
[0072] Next, for each local block, its mean is calculated. and standard deviation :
[0073]
[0074]
[0075] Next, based on the mean and standard deviation of each local block, the threshold for each local block is calculated. Following the VisuShrink concept, the threshold formula for each local block is:
[0076]
[0077] For the second wavelet coefficient sequence, the threshold corresponding to each local block in the second wavelet coefficient sequence can be calculated in the same way.
[0078] The method provided in this embodiment divides each wavelet coefficient sequence into multiple local blocks and processes each local block using a different threshold. Compared to processing each wavelet coefficient using the same threshold, the method provided in this embodiment takes into account the differences in noise levels between different local regions and can adjust the noise characteristics of each local block accordingly.
[0079] The varying noise levels in different regions of the Raman scattering signal are due to the presence of diverse components in the ammonia-containing sample. The uneven distribution of these components leads to different Raman scattering cross-sections, resulting in variations in scattered light intensity. In regions with weaker scattered light intensity, noise is more pronounced and the noise level is higher. Furthermore, structural differences between components affect the efficiency of Raman scattering and the polarization characteristics of the scattered light. Regions with complex structures or numerous defects exhibit more complex Raman signals, making noise control more difficult and resulting in higher noise levels. Similarly, the varying noise levels in different regions of the photoacoustic signal are due to the different light absorption capacities of the ammonia-containing sample. Regions with high light absorption coefficients absorb more light energy and convert it into heat, generating stronger photoacoustic signals. Conversely, regions with low light absorption coefficients produce weaker photoacoustic signals, where noise has a greater impact, resulting in higher noise levels. Additionally, the different thermal diffusivity coefficients of the components mean that regions with faster thermal diffusivity lose heat more easily, affecting the efficiency of photoacoustic signal generation and leading to relatively weaker signals and higher noise levels.
[0080] Furthermore, this embodiment provides a step of adjusting the first wavelet coefficient sequence and the second wavelet coefficient sequence according to a threshold, including:
[0081] For each wavelet coefficient in the first wavelet coefficient sequence and the second wavelet coefficient sequence, if the wavelet coefficient is less than or equal to the threshold, the wavelet coefficient is replaced with zero.
[0082] If the wavelet coefficients are greater than the threshold, the wavelet coefficients will be shrunk towards zero.
[0083] Specifically, for the first wavelet coefficient sequence, the thresholding formula can be expressed as:
[0084]
[0085] in, This represents the adjusted wavelet coefficients. Represents a sign function, when hour, ;when hour, ;when hour, .
[0086] Next, the adjusted wavelet coefficients are used to perform an inverse wavelet transform to obtain the first reconstructed signal. for:
[0087]
[0088] in, This is the reconstruction function of the inverse wavelet transform.
[0089] Similarly, for the second wavelet coefficient sequence, the same thresholding method can be used, and the signal can be reconstructed based on the adjusted wavelet coefficients to obtain the second reconstructed signal.
[0090] The method provided in this embodiment performs a smooth contraction of wavelet coefficients larger than a threshold, avoiding abrupt changes in wavelet coefficients and exhibiting good gradual properties. This makes the reconstructed signal smoother, reduces fluctuations and interference caused by noise, and thus effectively improves the quality of the reconstructed signal.
[0091] Furthermore, this embodiment provides a step for calculating the trace ammonia concentration based on the first reconstructed signal and the second reconstructed signal, including:
[0092] Based on the first reconstructed signal, the Raman spectrum is obtained; based on the second reconstructed signal, the photoacoustic spectrum is obtained.
[0093] The first ammonia concentration is obtained based on the position of the characteristic peak in the Raman spectrum, and the second ammonia concentration is obtained based on the position of the characteristic peak in the photoacoustic spectrum.
[0094] The trace ammonia concentration was obtained based on the first ammonia concentration, the second ammonia concentration, and Bayesian causal analysis.
[0095] Raman spectroscopy and photoacoustic spectroscopy can be obtained using specialized spectral analysis software. The method of determining ammonia concentration based on the position of characteristic peaks is existing technology and will not be described in detail in this embodiment.
[0096] However, methods for determining concentration based on the position of absorption peaks are usually based on simple relationships such as the Lambert-Beer law. These methods typically only consider the single relationship between absorption peak intensity and concentration. For complex ammonia-containing samples containing multiple components, there is overlap between the absorption peaks corresponding to each component, which can affect the accuracy of the detection results. Therefore, existing technologies have shortcomings. This embodiment uses Bayesian causal analysis to comprehensively consider the relationship between multiple factors and ammonia concentration, examines the first and second ammonia concentrations, and finally obtains the trace ammonia concentration.
[0097] Furthermore, embodiments of this application provide a step for obtaining a trace ammonia concentration based on a first ammonia concentration, a second ammonia concentration, and a Bayesian causal analysis method, including:
[0098] Based on historical experimental data, the variables affecting the accuracy of trace ammonia concentration were identified, and the likelihood functions of the variables were calculated.
[0099] Based on the likelihood function and the prior probability of trace ammonia concentration, the formula for the posterior probability of trace ammonia concentration is obtained.
[0100] The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula.
[0101] Furthermore, embodiments of this application provide a step for calculating a likelihood function for multiple variables, including:
[0102] Based on historical experimental data, determine the relationship between the variable and the trace ammonia concentration, and the correlation coefficient between the variables;
[0103] Based on historical experimental data and correlation coefficients, the mean vector and covariance matrix of the variables are obtained;
[0104] Based on the relation, mean vector, and covariance matrix, the likelihood function is obtained.
[0105] Furthermore, this embodiment provides a step for obtaining a trace ammonia concentration based on a first ammonia concentration, a second ammonia concentration, and a posterior probability formula, including:
[0106] Based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, the probability of the first ammonia concentration and the second ammonia concentration occurring can be obtained.
[0107] The probability is compared with a preset probability value. If the probability is greater than the preset probability value, the larger of the first ammonia concentration and the second ammonia concentration is taken as the trace ammonia concentration.
[0108] For example, based on historical experimental data, the variables affecting the accuracy of trace ammonia concentration can be identified as temperature, humidity, and signal attenuation. All historical experimental data are based on samples with known ammonia concentrations. Specifically, for Raman scattering signals, temperature easily affects the Raman scattering characteristics of ammonia molecules; high humidity causes water vapor in the air to condense on the sample surface, reducing the laser energy reaching the sample and the intensity of the Raman signal, thus affecting measurement accuracy; signal attenuation easily leads to a decrease in the signal-to-noise ratio, thereby affecting the accuracy of ammonia concentration calculation. For photoacoustic signals, temperature changes alter the thermal properties of ammonia molecules, such as the coefficient of thermal expansion and thermal conductivity, affecting the thermoelastic expansion process in the photoacoustic effect, and thus changing the intensity of the photoacoustic signal; chemical reactions or physical adsorption between water vapor and ammonia alter the form and concentration distribution of ammonia, affecting the generation and propagation of the photoacoustic signal; severe signal attenuation can cause the position of characteristic peaks to shift or deform, thus affecting the accuracy of ammonia concentration calculation. Therefore, through the above analysis, the causal relationship between each variable and the finally calculated trace ammonia concentration can be obtained as follows: Figure 3 As shown, where This indicates the calculated trace ammonia concentration. Indicates humidity. Indicates temperature. Indicates the degree of signal attenuation. This is the abbreviation for the first reconstructed signal. This represents the second reconstructed signal, and the degree of signal attenuation can be calculated based on the propagation distance of the laser.
[0109] Next, for the Raman scattered light signal, considering the correlation between temperature, humidity, and signal attenuation, a vector incorporating temperature, humidity, and signal attenuation is defined. Assuming Follows a multivariate normal distribution ,in, Represents the mean vector. Let represent the covariance matrix.
[0110] Assuming the first reconstructed signal Each component in , All are related to ammonia concentration Temperature, humidity, and signal attenuation exhibit the following exponential relationship:
[0111]
[0112] in, It is a constant coefficient that scales the overall signal strength. The power coefficient is used to describe the effect of ammonia concentration on the Raman scattered light signal. , , and These are constants used to describe the effects of temperature, humidity, and signal attenuation on the Raman scattered light signal. and The ammonia concentrations were all calculated based on historical experimental data. The known concentrations of ammonia samples from historical experimental data. This represents noise, and it is assumed that the noise follows a normal distribution. Furthermore, this embodiment assumes... The relationship between each component and ammonia concentration, temperature, humidity and signal attenuation is exponential. However, this embodiment is not limited to this. In specific situations, other relationships can be used to fit the relationship according to changes in experimental conditions.
[0113] Based on the above relationship, the likelihood function is obtained as follows:
[0114]
[0115] in, This represents the variance of the noise.
[0116] Specifically, according to Bayes' theorem, the posterior probability Prior probability and likelihood function The relationship between these factors allows us to derive the formula for the posterior probability. Here, the prior probability is... The ammonia concentration can be determined based on the source of the ammonia sample. For example, assuming the sample is collected from an industrial waste gas emission outlet, the approximate distribution range of ammonia concentration in the sample collected from that outlet can be obtained based on the historical emission data of that outlet. Assuming that the ammonia concentration distribution follows a normal distribution, the prior probability can be calculated based on the probability density function of the normal distribution.
[0117] Then, the first ammonia concentration, the first reconstructed signal, the currently measured temperature, humidity, and signal attenuation are substituted into the posterior probability formula, and approximated using numerical calculation methods such as Markov Chain Monte Carlo (MCMC). This allows us to calculate the distribution of the probability of the first ammonia concentration occurring, given the first reconstructed signal, the currently measured temperature, humidity, and signal attenuation. The distribution follows, at this time Indicates the first ammonia concentration. and Let these represent the first reconstructed signal and vector, respectively. Then, for the photoacoustic signal, repeat the above steps to calculate the probability distribution of the second ammonia concentration, given the second reconstructed signal, the currently measured temperature, humidity, and signal attenuation. The distribution follows, at this time This indicates the second ammonia concentration. and Let them represent the corresponding second reconstructed signal and vector, respectively. Assuming the calculated... Follow the mean The variance is The normal distribution is calculated. Follow the mean The variance is If it follows a normal distribution, then... As the probability of the first ammonia concentration occurring, As the probability of the second ammonia concentration occurring.
[0118] If the probabilities of both the first and second ammonia concentrations are less than or equal to preset probability values, it indicates that, based on the first reconstructed signal, the second reconstructed signal, and the currently measured variable values, the probability of the first and second ammonia concentrations being trace ammonia concentrations is low. This further indicates that the measured Raman scattering light and photoacoustic signals are significantly affected by related variables, resulting in a large error in the first and second ammonia concentrations calculated solely based on the first and second reconstructed signals. In this case, remeasurement and recalculation are necessary. If the probabilities of both the first and second ammonia concentrations are greater than preset probability values, or if one of them is greater than the preset probability value, then the larger of the first and second ammonia concentrations is selected as the trace ammonia concentration. The preset probability value can be determined based on the experimentally acceptable error range.
[0119] Existing technologies often rely solely on Raman scattering light signals or photoacoustic signals for analysis, or use the average of these two signals as the trace ammonia concentration. However, this embodiment considers that variables such as temperature, humidity, and signal attenuation can affect the accuracy of the Raman scattering light signals and photoacoustic signals, thereby affecting the accuracy of the first and second reconstructed signals, leading to significant errors in the calculated first and second ammonia concentrations. Therefore, this embodiment uses a Bayesian causal analysis method to verify the first and second ammonia concentrations. This method considers the influence of multiple related variables and can accurately calculate the probability that the first and second ammonia concentrations are trace ammonia concentrations under the influence of these variables, i.e., the probability that the first and second ammonia concentrations are accurate. This probability is then verified using a preset probability value to obtain the final trace ammonia concentration.
[0120] Furthermore, embodiments of this application provide a system for measuring trace amounts of ammonia using optical means, comprising:
[0121] The acquisition module is used to acquire the Raman scattering light signal and photoacoustic signal of the ammonia-containing sample to be tested;
[0122] The reconstruction module is used to reconstruct the Raman scattered light signal to obtain the first reconstructed signal and to reconstruct the photoacoustic signal to obtain the second reconstructed signal.
[0123] The calculation module is used to calculate the trace ammonia concentration based on the first reconstructed signal and the second reconstructed signal.
[0124] The acquisition module, reconstruction module, and calculation module are all located within the server. Additionally, as... Figure 4 As shown, the system also includes detection equipment, which includes a laser emitting device, a receiving device, and a sample tube.
[0125] This application provides a method and system for measuring trace ammonia using optical means. Through a signal reconstruction step, noise in the Raman scattering light signal and photoacoustic signal is eliminated, and the effective signal is enhanced, so that the trace ammonia signal, which was originally difficult to detect accurately, can be presented more clearly, thereby improving the measurement accuracy. Furthermore, the measurement results are further verified based on relevant variables through Bayesian causal analysis, thereby obtaining the most accurate trace ammonia concentration.
[0126] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0127] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0128] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0129] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for measuring trace amounts of ammonia using optical means, characterized in that, include: Acquire the Raman scattering light signal and photoacoustic signal of the ammonia-containing sample to be tested; The Raman scattered light signal is reconstructed to obtain a first reconstructed signal, and the photoacoustic signal is reconstructed to obtain a second reconstructed signal; The trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal; The process includes reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal to obtain a second reconstructed signal, including: Based on the Raman scattered light signal and its corresponding wavelet basis function and decomposition level, a first wavelet coefficient sequence is obtained, and based on the photoacoustic signal and its corresponding wavelet basis function and decomposition level, a second wavelet coefficient sequence is obtained, wherein the wavelet basis function corresponding to the Raman scattered light signal is the db4 wavelet basis function, and the wavelet basis function corresponding to the photoacoustic signal is the sym8 wavelet basis function. Thresholding is applied to the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence; Perform an inverse wavelet transform on the first reconstructed sequence to obtain the first reconstructed signal, and perform an inverse wavelet transform on the second reconstructed sequence to obtain the second reconstructed signal; The step of performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence includes: The first wavelet coefficient sequence and the second wavelet coefficient sequence are divided into blocks to obtain multiple first local blocks and multiple second local blocks; Calculate the mean and standard deviation of each first local block and each second local block; Based on the mean and standard deviation, the threshold corresponding to each first local block and each second local block is obtained. ,in The standard deviation is... The number of wavelet coefficients contained in each local block; Based on the threshold, the first wavelet coefficient sequence and the second wavelet coefficient sequence are adjusted to obtain the first reconstructed sequence and the second reconstructed sequence; The adjustment of the first wavelet coefficient sequence and the second wavelet coefficient sequence according to the threshold includes: For each wavelet coefficient in the first wavelet coefficient sequence and the second wavelet coefficient sequence, if the wavelet coefficient is less than or equal to the threshold, the wavelet coefficient is replaced with zero. If the wavelet coefficients are greater than the threshold, the wavelet coefficients are shrunk towards zero; The trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal, including: Based on the first reconstructed signal, a Raman spectrum is obtained, and based on the second reconstructed signal, a photoacoustic spectrum is obtained. The first ammonia concentration is obtained based on the position of the characteristic peak in the Raman spectrum, and the second ammonia concentration is obtained based on the position of the characteristic peak in the photoacoustic spectrum. The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the Bayesian causal analysis method; The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the Bayesian causal analysis method, including: Based on historical experimental data, the variables affecting the accuracy of the trace ammonia concentration were identified, and the likelihood function for the variables was calculated. Based on the likelihood function and the prior probability of the trace ammonia concentration, the posterior probability formula for the trace ammonia concentration is obtained. The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula; Wherein, if there are multiple variables, the calculation of the likelihood function with respect to the variables includes: Based on the historical experimental data, the relationship between the variable and the trace ammonia concentration, and the correlation coefficient between the variables are determined. The variables include temperature, humidity, and signal attenuation. Based on the historical experimental data and the correlation coefficient, the mean vector and covariance matrix of the variables are obtained; The likelihood function is obtained based on the relation, the mean vector, and the covariance matrix. The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, including: Based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, the probabilities of the occurrence of the first ammonia concentration and the second ammonia concentration are obtained; The probability is compared with a preset probability value. If the probability is greater than the preset probability value, the larger of the first ammonia concentration and the second ammonia concentration is taken as the trace ammonia concentration.
2. A system for measuring trace amounts of ammonia using optical means, characterized in that, include: The acquisition module is used to acquire the Raman scattering light signal and photoacoustic signal of the ammonia-containing sample to be tested; The reconstruction module is used to reconstruct the Raman scattered light signal to obtain a first reconstructed signal and to reconstruct the photoacoustic signal to obtain a second reconstructed signal. The calculation module is used to calculate the trace ammonia concentration based on the first reconstructed signal and the second reconstructed signal; The process includes reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal to obtain a second reconstructed signal, including: Based on the Raman scattered light signal and its corresponding wavelet basis function and decomposition level, a first wavelet coefficient sequence is obtained, and based on the photoacoustic signal and its corresponding wavelet basis function and decomposition level, a second wavelet coefficient sequence is obtained, wherein the wavelet basis function corresponding to the Raman scattered light signal is the db4 wavelet basis function, and the wavelet basis function corresponding to the photoacoustic signal is the sym8 wavelet basis function. Thresholding is applied to the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence; Perform an inverse wavelet transform on the first reconstructed sequence to obtain the first reconstructed signal, and perform an inverse wavelet transform on the second reconstructed sequence to obtain the second reconstructed signal; The step of performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain the first reconstructed sequence and the second reconstructed sequence includes: The first wavelet coefficient sequence and the second wavelet coefficient sequence are divided into blocks to obtain multiple first local blocks and multiple second local blocks; Calculate the mean and standard deviation of each first local block and each second local block; Based on the mean and standard deviation, the threshold corresponding to each first local block and each second local block is obtained. ,in The standard deviation is... The number of wavelet coefficients contained in each local block; Based on the threshold, the first wavelet coefficient sequence and the second wavelet coefficient sequence are adjusted to obtain the first reconstructed sequence and the second reconstructed sequence; The adjustment of the first wavelet coefficient sequence and the second wavelet coefficient sequence according to the threshold includes: For each wavelet coefficient in the first wavelet coefficient sequence and the second wavelet coefficient sequence, if the wavelet coefficient is less than or equal to the threshold, the wavelet coefficient is replaced with zero. If the wavelet coefficients are greater than the threshold, the wavelet coefficients are shrunk towards zero; The trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal, including: Based on the first reconstructed signal, a Raman spectrum is obtained, and based on the second reconstructed signal, a photoacoustic spectrum is obtained. The first ammonia concentration is obtained based on the position of the characteristic peak in the Raman spectrum, and the second ammonia concentration is obtained based on the position of the characteristic peak in the photoacoustic spectrum. The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the Bayesian causal analysis method; The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the Bayesian causal analysis method, including: Based on historical experimental data, the variables affecting the accuracy of the trace ammonia concentration were identified, and the likelihood function for the variables was calculated. Based on the likelihood function and the prior probability of the trace ammonia concentration, the posterior probability formula for the trace ammonia concentration is obtained. The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula; Wherein, if there are multiple variables, the calculation of the likelihood function with respect to the variables includes: Based on the historical experimental data, the relationship between the variable and the trace ammonia concentration, and the correlation coefficient between the variables are determined. The variables include temperature, humidity, and signal attenuation. Based on the historical experimental data and the correlation coefficient, the mean vector and covariance matrix of the variables are obtained; The likelihood function is obtained based on the relation, the mean vector, and the covariance matrix. The trace ammonia concentration is obtained based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, including: Based on the first ammonia concentration, the second ammonia concentration, and the posterior probability formula, the probabilities of the occurrence of the first ammonia concentration and the second ammonia concentration are obtained; The probability is compared with a preset probability value. If the probability is greater than the preset probability value, the larger of the first ammonia concentration and the second ammonia concentration is taken as the trace ammonia concentration.
Citation Information
Patent Citations
A device and method for detecting escaped ammonia concentration based on TDLAS technology
CN105806806B
Raman spectroscopy of airway gases
US5450193A