Method and system for measuring trace ammonia by optical means
Through wavelet reconstruction and Bayesian causal analysis methods, the problems of low sensitivity and insufficient accuracy in the measurement of trace ammonia concentration are solved, and measurement results with higher accuracy and less environmental interference are achieved.
Patent Information
- Application Number
- CN202510480727.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-17
AI Technical Summary
The prior art has problems in the measurement of trace ammonia concentrations with low detection sensitivity, high environmental interference, and insufficient measurement accuracy.
Through wavelet reconstruction-based signal processing, noise in Raman scattered optical signals and photoacoustic signals is eliminated, and the Bayesian causal analysis method is used to consider the impact of environmental factors on the measurement results in real time to improve the accuracy of measurement.
It improves the accuracy and sensitivity of trace ammonia concentration measurement, reduces the impact of environmental interference, and ensures the accuracy of measurement results.
Smart Images

Figure CN119985446A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ammonia concentration measurement, and more particularly to a method and system for measuring trace ammonia by optical means. Background Art
[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 environmental interference, and insufficient measurement accuracy.
[0003] For example, a Chinese patent with authorization announcement number CN105806806B provides a device and method for detecting the concentration of escaped ammonia based on TDLAS technology. The central wavelength position of water vapor is determined by the absorption peak of water vapor near the ammonia absorption spectrum, and the central wavelength position of ammonia is determined according to the relative position of the central wavelengths of ammonia and water vapor, thereby achieving accurate positioning of the ammonia absorption peak and further determining the concentration of escaped ammonia.
[0004] However, the invention only relies on the principle of spectral absorption to determine the central wavelength position of ammonia, and only judges from the relative position of the absorption peak, resulting in low measurement accuracy. Therefore, the existing technology has shortcomings. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method and system for measuring trace ammonia by optical means, which effectively solves the problem of signal noise interference through wavelet-based reconstruction, and uses a Bayesian causal analysis method to consider the impact of environmental factors on the measurement results in real time, and effectively judge the accuracy of the measurement results.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] The present invention provides a method for measuring trace ammonia by optical means, comprising:
[0008] Obtaining Raman scattering light signals and photoacoustic signals of the ammonia-containing sample to be tested;
[0009] Reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal 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, reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal to obtain a second reconstructed signal, including:
[0012] Obtaining a first wavelet coefficient sequence according to the Raman scattered light signal and its corresponding wavelet basis function and decomposition level number, and obtaining a second wavelet coefficient sequence according to the photoacoustic signal and its corresponding wavelet basis function and decomposition level number;
[0013] Performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain a first reconstructed sequence and a second reconstructed sequence;
[0014] Perform an inverse wavelet transform on the first reconstruction sequence to obtain the first reconstruction signal, and perform an inverse wavelet transform on the second reconstruction sequence to obtain the second reconstruction 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 a first reconstructed sequence and a second reconstructed sequence comprises:
[0016] respectively performing block processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence to obtain a plurality of first local blocks and a plurality of second local blocks;
[0017] Calculating the mean and standard deviation of each first local block and each second local block;
[0018] Obtaining a threshold corresponding to each of the first local blocks and each of the second local blocks according to the mean and the standard deviation;
[0019] According to 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 value 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, replace the wavelet coefficient with zero;
[0022] If the wavelet coefficient is greater than the threshold, the wavelet coefficient is shrunk toward 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 according to the first reconstructed signal and the second reconstructed signal, including:
[0025] Obtaining a Raman spectrum according to the first reconstructed signal, and obtaining a photoacoustic spectrum according to the second reconstructed signal;
[0026] Obtaining a first ammonia concentration according to the position of the characteristic peak in the Raman spectrum, and obtaining a second ammonia concentration according to the position of the characteristic peak in the photoacoustic spectrum;
[0027] The trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and a Bayesian causal analysis method.
[0028] As a further improvement of the present invention, the trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and the Bayesian causal analysis method, including:
[0029] Determine the variables that affect the accuracy of the trace ammonia concentration based on historical experimental data, and calculate the likelihood function of the variables;
[0030] Obtaining a posterior probability formula for the trace ammonia concentration according to the likelihood function and the prior probability of the trace ammonia concentration;
[0031] The trace ammonia concentration is obtained according to 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 to obtain the likelihood function about the variables includes:
[0033] Determining, based on the historical experimental data, a relationship between the variable and the trace ammonia concentration, and a correlation coefficient between the variables;
[0034] According to the historical experimental data and the correlation coefficient, a mean vector and a covariance matrix of the variable are obtained;
[0035] The likelihood function is obtained according to the relationship, the mean vector and the covariance matrix.
[0036] As a further improvement of the present invention, the trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, including:
[0037] According to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, obtaining the probability of occurrence of the first ammonia concentration and the second ammonia concentration;
[0038] The probability is compared with a preset probability value, and if the probability is greater than the preset probability value, a larger value between the first ammonia concentration and the second ammonia concentration is used as the trace ammonia concentration.
[0039] As a further improvement of the present invention, the present invention provides a system for measuring trace ammonia by optical means, comprising:
[0040] An acquisition module, used to acquire Raman scattered light signals and photoacoustic signals of the ammonia-containing sample to be tested;
[0041] A reconstruction module, used to reconstruct the Raman scattered light signal to obtain a first reconstructed signal, and reconstruct the photoacoustic signal to obtain a second reconstructed signal;
[0042] A calculation module is used to calculate the trace ammonia concentration according to the first reconstructed signal and the second reconstructed signal.
[0043] The present invention eliminates noise in Raman scattered light signals and photoacoustic signals through a signal reconstruction step, and enhances effective signals, so that trace ammonia signals that were originally difficult to detect accurately can be presented more clearly, thereby improving measurement accuracy. The measurement results are further verified according to relevant variables through a Bayesian causal analysis method, thereby obtaining the most accurate trace ammonia concentration. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 Schematic diagram of the process steps of the present invention;
[0045] Figure 2 is a flowchart of the steps of threshold processing;
[0046] Figure 3 is a cause-effect diagram;
[0047] Figure 4 It is a schematic diagram of the detection equipment in the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention is described in detail below through 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 of the technical solution of the present invention.
[0049] The term "and / or" in the following text is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0050] like Figure 1 As shown, the embodiment of the present application provides a method for measuring trace ammonia by optical means, comprising:
[0051] Obtaining Raman scattering light signals and photoacoustic signals of the ammonia-containing sample to be tested;
[0052] Reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal to obtain a second reconstructed signal;
[0053] The trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal.
[0054] Specifically, the step of acquiring the Raman scattered light signal is to focus the excitation light source on the ammonia-containing sample to be tested, at which time the ammonia molecules interact with the excitation light to produce Raman scattering phenomenon, collect the Raman scattered light, and transmit it to the spectrometer for spectrometry, then the Raman scattered light after spectrometry is incident on the detector, and the Raman scattered light is converted into a Raman scattered light signal by the detector, and transmitted to the computer for analysis. Preferably, the excitation light source is emitted by a 785nm semiconductor laser.
[0055] Similarly, the step of acquiring the photoacoustic signal is to focus the excitation light source on the ammonia-containing sample to be tested. At this time, the ammonia molecules interact with the excitation light, and the ammonia molecules absorb the laser energy and undergo vibration and rotational energy level transitions, which causes the local temperature of the gas to rise and produce periodic thermal expansion, thereby forming sound waves. The sound waves are converted into photoelectric signals through piezoelectric sensors and transmitted to a computer for analysis. Preferably, the excitation light source can be selected to use a distributed feedback (DFB) semiconductor laser with a central wavelength of about 1530nm.
[0056] The embodiment of the present application uses a signal reconstruction step to remove noise from Raman scattered light signals and photoacoustic signals and enhance effective signals, so that trace ammonia signals that were originally difficult to detect accurately can be presented more clearly, thereby improving the measurement accuracy. The measurement results are further verified according to relevant variables through a Bayesian causal analysis method to obtain the most accurate trace ammonia concentration.
[0057] Furthermore, the embodiment of the present application provides 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, including:
[0058] According to the Raman scattered light signal and its corresponding wavelet basis function and the number of decomposition layers, a first wavelet coefficient sequence is obtained; according to the photoacoustic signal and its corresponding wavelet basis function and the number of decomposition layers, a second wavelet coefficient sequence is obtained;
[0059] Performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain a first reconstructed sequence and a second reconstructed sequence;
[0060] The first reconstruction sequence is subjected to an inverse wavelet transform to obtain a first reconstruction signal, and the second reconstruction sequence is subjected to an inverse wavelet transform to obtain a second reconstruction 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, wherein the db4 wavelet basis has compact support, and the Raman scattered light signal is usually only meaningful within a certain wavenumber range, so the compact support of db4 enables 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 between signals and noise; the sym8 wavelet basis has approximate symmetry, so the sym8 wavelet basis can better match the periodic characteristics of the photoacoustic signal, and thus more accurately capture the periodic law of the signal in the wavelet transform process, reducing signal distortion.
[0062] Specifically, for the length The Raman scattered light signal vector , represents the wavelength, Each element in represents the Raman scattering intensity value at a wavelength, and sets the number of decomposition layers. ; For length The photoacoustic signal vector , Indicates time, Each element in represents the intensity value of the photoacoustic signal at a moment, and the number of decomposition layers is set .
[0063] Then the Raman scattered light signal vector conduct Layer wavelet transform to obtain wavelet coefficients at different scales ,in , representing different scales, Represents the discrete wavelet coefficient index, which can also be expressed as The position translation at each scale is: ,in is the db4 wavelet basis function, each wavelet coefficient Arrange them in sequence to obtain the first wavelet coefficient sequence.
[0064] Similarly, for the photoacoustic signal vector conduct Layer wavelet transform to obtain wavelet coefficients at different scales ,in , representing different scales, Represents the discrete wavelet coefficient index, which can also be expressed as The position translation at each scale is: ,in For the sym8 wavelet basis function, each wavelet coefficient Arrange them in sequence to obtain the second wavelet coefficient sequence.
[0065] The method provided in the embodiment of the present application selects appropriate wavelet basis functions according to 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 threshold processing step.
[0066] Further, such as Figure 2 As shown, this embodiment provides a 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, including:
[0067] The first wavelet coefficient sequence and the second wavelet coefficient sequence are respectively processed into blocks to obtain a plurality of first local blocks and a plurality of second local blocks;
[0068] Calculating the mean and standard deviation of each first local block and each second local block;
[0069] According to the mean and the standard deviation, a threshold corresponding to each first local block and each second local block is obtained;
[0070] According to the threshold, the first wavelet coefficient sequence and the second wavelet coefficient sequence are adjusted to obtain a first reconstructed sequence and a 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 that the first wavelet coefficient sequence contains wavelet coefficients, it can be divided into local blocks, The local block is denoted as ,in , .
[0072] Then for each local block, calculate its mean and standard deviation :
[0073]
[0074]
[0075] Then, according to the mean and standard deviation of each local block, the threshold of each local block is calculated. According to the VisuShrink idea, the threshold formula of each local block is obtained as follows:
[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 uses a different threshold value to process each local block. Compared with using the same threshold value to process each wavelet coefficient, the method provided in this embodiment takes into account the differences in noise levels in different local areas and can adjust each local block according to its noise characteristics.
[0079] Among them, the reason why the noise levels in different local areas of the Raman scattering light signal are different is that there are many different material components in the ammonia-containing sample to be tested, and the uneven distribution of different components will lead to different Raman scattering cross sections, which in turn makes the scattered light intensity different. In the area with weak scattered light intensity, the noise is relatively more obvious, and the noise level is higher. In addition, the structural differences between different components will affect the efficiency of Raman scattering and the polarization characteristics of scattered light. In areas with complex structures or more defects, the Raman signal is more complex, the noise is more difficult to control, and the noise level is higher. The reason why the noise levels in different local areas of the photoacoustic signal are different is that different material components in the ammonia-containing sample to be tested have different light absorption capabilities. The area with high light absorption coefficient can absorb more light energy and convert it into heat energy, thereby generating a stronger photoacoustic signal, while the photoacoustic signal in the area with low light absorption coefficient is weak. Relatively speaking, the impact of noise on weak signals is greater, and the noise level is higher. In addition, there are differences in the thermal diffusion coefficients of different material components. Heat is more easily dissipated in areas with fast thermal diffusion, and the generation efficiency of the photoacoustic signal will be affected, the signal is relatively weak, and the noise level is relatively high.
[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, replace the wavelet coefficient with zero;
[0082] If the wavelet coefficient is greater than the threshold, shrink the wavelet coefficient to zero.
[0083] Specifically, for the first wavelet coefficient sequence, the threshold processing formula can be expressed as:
[0084]
[0085] in, represents the adjusted wavelet coefficients, represents a symbolic function, when hour, ;when hour, ;when hour, .
[0086] Then use the adjusted wavelet coefficients to perform inverse wavelet transform to obtain the first reconstructed signal for:
[0087]
[0088] in, is the reconstruction function of the inverse wavelet transform.
[0089] Similarly, for the second wavelet coefficient sequence, the same method can be used to perform threshold processing, and the signal can be reconstructed based on the adjusted wavelet coefficients to obtain a second reconstructed signal.
[0090] The method provided in this embodiment performs smooth shrinkage processing on wavelet coefficients greater than a threshold value, avoiding sudden changes in wavelet coefficients, having good progressive properties, and can make the reconstructed signal smoother, reduce fluctuations and interference caused by noise, thereby effectively improving the quality of the reconstructed signal.
[0091] Furthermore, this embodiment provides a step of calculating the trace ammonia concentration according to the first reconstructed signal and the second reconstructed signal, including:
[0092] A Raman spectrum is obtained according to the first reconstruction signal, and a photoacoustic spectrum is obtained according to the second reconstruction signal;
[0093] According to the position of the characteristic peak in the Raman spectrum, a first ammonia concentration is obtained, and according to the position of the characteristic peak in the photoacoustic spectrum, a second ammonia concentration is obtained;
[0094] According to the first ammonia concentration, the second ammonia concentration and the Bayesian causal analysis method, the trace ammonia concentration is obtained.
[0095] Among them, Raman spectrum and photoacoustic spectrum can be obtained according to special spectrum analysis software. The method of determining the ammonia concentration according to the position of the characteristic peak is a prior art and will not be described in detail in this embodiment.
[0096] However, the method of determining the concentration based on the position of the absorption peak is usually based on simple relationships such as the Lambert-Beer law. Such methods usually only consider the single relationship between the absorption peak intensity and the concentration. For complex ammonia-containing samples containing multiple components, there is overlap between the absorption peaks corresponding to each component, which will affect the accuracy of the test results. Therefore, the prior art has shortcomings. This embodiment uses the Bayesian causal analysis method to comprehensively consider the relationship between multiple factors and ammonia concentration, test the first ammonia concentration and the second ammonia concentration, and finally obtain the trace ammonia concentration.
[0097] Furthermore, the embodiment of the present application provides a step of obtaining a trace ammonia concentration according to the first ammonia concentration, the second ammonia concentration and the Bayesian causal analysis method, including:
[0098] According to historical experimental data, the variables that affect the accuracy of trace ammonia concentration are determined, and the likelihood function of the variables is calculated;
[0099] According to the likelihood function and the prior probability of trace ammonia concentration, the posterior probability formula of trace ammonia concentration is obtained;
[0100] According to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, the trace ammonia concentration is obtained.
[0101] Furthermore, the embodiment of the present application provides a step of calculating a likelihood function about a variable if there are multiple variables, including:
[0102] Based on historical experimental data, determine the relationship between variables and trace ammonia concentration, and the correlation coefficient between variables;
[0103] According to the historical experimental data and correlation coefficients, the mean vector and covariance matrix of the variables are obtained;
[0104] According to the relationship, mean vector and covariance matrix, the likelihood function is obtained.
[0105] Furthermore, this embodiment provides a step of obtaining a trace ammonia concentration according to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, including:
[0106] According to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, the probability of occurrence of the first ammonia concentration and the second ammonia concentration is obtained;
[0107] The probability is compared with a preset probability value, and if the probability is greater than the preset probability value, the larger value of the first ammonia concentration and the second ammonia concentration is taken as the trace ammonia concentration.
[0108] Exemplarily, based on historical experimental data, the variables that affect the accuracy of trace ammonia concentration can be determined to be temperature, humidity, and signal attenuation. The historical experimental data are all based on samples with known ammonia concentrations. Among them, for Raman scattered light signals, temperature is likely to affect the Raman scattering characteristics of ammonia molecules; when the humidity is high, water vapor in the air will condense on the surface of the sample, reducing the laser energy reaching the sample and the intensity of the Raman signal, affecting the accuracy of the measurement; the degree of signal attenuation is likely to cause the signal-to-noise ratio to decrease, thereby affecting the accuracy of the ammonia concentration calculation. For photoacoustic signals, temperature changes will change the thermal properties of ammonia molecules such as the thermal expansion coefficient and thermal conductivity, affecting the thermoelastic expansion process in the photoacoustic effect, and thus changing the intensity of the photoacoustic signal; water vapor and ammonia undergo chemical reactions or physical adsorption, which will change the existence form and concentration distribution of ammonia, affecting the generation and propagation of photoacoustic signals; if the signal attenuation is severe, it will cause the position of the characteristic peak to shift or deform, thereby affecting the accuracy of the ammonia concentration calculation. Therefore, through the above analysis, the causal relationship between each variable and the final calculated trace ammonia concentration can be obtained as follows: Figure 3 As shown, represents the calculated trace ammonia concentration, Indicates humidity, Indicates temperature, Indicates the degree of signal attenuation. is the short form of the first reconstructed signal, represents the second reconstructed signal, and the signal attenuation degree can be calculated according to 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 containing temperature, humidity and signal attenuation is defined: , assuming Follow multivariate normal distribution ,in, represents the mean vector, represents the covariance matrix.
[0110] Assume that the first reconstructed signal Each component in , , both with ammonia concentration , temperature, humidity and signal attenuation, there is the following exponential relationship:
[0111]
[0112] in, is a constant coefficient that scales the overall signal strength. is the power coefficient used to describe the effect of ammonia concentration on the Raman scattering light signal, , , and are constants used to describe the effects of temperature, humidity, and signal attenuation on Raman scattering light signals. and All calculated based on historical experimental data, ammonia concentration is the known concentration of ammonia samples in historical experimental data, represents noise, assuming that the noise follows a normal distribution. The relationship between each component in and the ammonia concentration, temperature, humidity and signal attenuation degree is an exponential relationship, but the present embodiment is not limited thereto. In specific practical situations, other relationship fitting relationships can be used according to changes in experimental conditions.
[0113] According to the above relationship, the likelihood function is:
[0114]
[0115] in, represents the variance of the noise.
[0116] Specifically, according to Bayes' theorem, the posterior probability , prior probability and the likelihood function The relationship between , we can get the formula for the posterior probability. Among them, the prior probability It can be determined based on the source of the ammonia-containing sample to be tested. For example, assuming that the sample is collected from an industrial waste gas emission port, the approximate distribution range of the ammonia concentration in the ammonia-containing sample collected at the emission port can be obtained based on the historical emission data of the emission port. Assuming that the distribution of ammonia concentration obeys the 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 the solution is approximated by numerical calculation methods such as the Markov Chain Monte Carlo (MCMC) method. When the first reconstructed signal, the currently measured temperature, humidity, and signal attenuation are known, the probability distribution of the first ammonia concentration can be calculated, that is, Obeying the distribution, at this time represents the first ammonia concentration, and Represent the corresponding first reconstructed signal and vector respectively. Then, for the photoacoustic signal, repeat the above steps to calculate the distribution of the probability of the second ammonia concentration when the second reconstructed signal, the currently measured temperature, humidity, and signal attenuation are known, that is, Obeying the distribution, at this time represents the second ammonia concentration, and Represent the corresponding second reconstructed signal and vector respectively. Assuming that the calculated The mean is , the variance is The normal distribution of The mean is , the variance is If the normal distribution of As the probability of the first ammonia concentration occurring, As the probability of the second ammonia concentration occurring.
[0118] If the probability of the first ammonia concentration and the second ammonia concentration occurring are both less than or equal to the preset probability value, it means that based on the first reconstructed signal, the second reconstructed signal and the currently measured variable value, the probability that the first ammonia concentration and the second ammonia concentration are trace ammonia concentrations is small, which further indicates that the measured Raman scattered light signal and the photoacoustic signal are greatly affected by the relevant variables. Therefore, the error of the first ammonia concentration and the second ammonia concentration calculated based only on the first reconstructed signal and the second reconstructed signal is large, and re-measurement and calculation are required at this time. If the probability of the first ammonia concentration and the second ammonia concentration occurring are both greater than the preset probability value, or one of them is greater than the preset probability value, the larger value of the first ammonia concentration and the second ammonia concentration is selected as the trace ammonia concentration. The preset probability value can be determined according to the error range allowed by the experiment.
[0119] In the prior art, analysis is often performed only based on Raman scattered light signals or photoacoustic signals, or the average result obtained based on the two signals is used as the trace ammonia concentration. However, this embodiment takes into account that relevant variables such as temperature, humidity, and signal attenuation will affect the accuracy of Raman scattered light signals and photoacoustic signals, thereby affecting the accuracy of the first reconstructed signal and the second reconstructed signal, resulting in a large error in the calculated first ammonia concentration and the second ammonia concentration. Therefore, this embodiment tests the first ammonia concentration and the second ammonia concentration based on the Bayesian causal analysis method. The method takes into account the influence of multiple related variables and can accurately calculate the probability that the first ammonia concentration and the second ammonia concentration are trace ammonia concentrations under the influence of these variables, that is, the probability that the first ammonia concentration and the second ammonia concentration are accurate, and tests them in combination with the preset probability value to obtain the final trace ammonia concentration.
[0120] Furthermore, the present application provides a system for measuring trace ammonia by optical means, comprising:
[0121] An acquisition module, used to acquire Raman scattered light signals and photoacoustic signals of the ammonia-containing sample to be tested;
[0122] A reconstruction module, 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;
[0123] The calculation module is used to calculate the trace ammonia concentration according to the first reconstructed signal and the second reconstructed signal.
[0124] Among them, the acquisition module, reconstruction module, and calculation module are all located in the server. Figure 4 As shown, the system also includes a detection device, which includes a laser emitting device, a receiving device, a sample tube, etc.
[0125] The embodiments of the present application provide a method and system for measuring trace ammonia by optical means. Through the signal reconstruction step, the noise in the Raman scattered light signal and the photoacoustic signal is eliminated, and the effective signal is enhanced, so that the trace ammonia signal that was originally difficult to detect accurately can be presented more clearly, thereby improving the measurement accuracy. The measurement results are further verified according to relevant variables through the Bayesian causal analysis method, thereby obtaining the most accurate trace ammonia concentration.
[0126] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0129] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for measuring trace ammonia by optical means, characterized in that: include: Obtaining Raman scattering light signals and photoacoustic signals of the ammonia-containing sample to be tested; Reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal to obtain a second reconstructed signal; The trace ammonia concentration is calculated based on the first reconstructed signal and the second reconstructed signal.
2. The method for measuring trace ammonia by optical means according to claim 1, characterized in that: Reconstructing the Raman scattered light signal to obtain a first reconstructed signal, and reconstructing the photoacoustic signal to obtain a second reconstructed signal, including: Obtaining a first wavelet coefficient sequence according to the Raman scattered light signal and its corresponding wavelet basis function and decomposition level number, and obtaining a second wavelet coefficient sequence according to the photoacoustic signal and its corresponding wavelet basis function and decomposition level number; Performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain a first reconstructed sequence and a second reconstructed sequence; Perform an inverse wavelet transform on the first reconstruction sequence to obtain the first reconstruction signal, and perform an inverse wavelet transform on the second reconstruction sequence to obtain the second reconstruction signal.
3. The method for measuring trace ammonia by optical means according to claim 2, characterized in that: The performing threshold processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence respectively to obtain a first reconstructed sequence and a second reconstructed sequence comprises: respectively performing block processing on the first wavelet coefficient sequence and the second wavelet coefficient sequence to obtain a plurality of first local blocks and a plurality of second local blocks; Calculating the mean and standard deviation of each first local block and each second local block; Obtaining a threshold corresponding to each of the first local blocks and each of the second local blocks according to the mean and the standard deviation; According to 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.
4. The method for measuring trace ammonia by optical means according to claim 3, characterized in that: According to the threshold, adjusting the first wavelet coefficient sequence and the second wavelet coefficient sequence 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, replace the wavelet coefficient with zero; If the wavelet coefficient is greater than the threshold, the wavelet coefficient is shrunk toward zero.
5. The method for measuring trace ammonia by optical means according to claim 2, characterized in that: 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.
6. The method for measuring trace ammonia by optical means according to claim 1, characterized in that: Calculating the trace ammonia concentration according to the first reconstructed signal and the second reconstructed signal includes: Obtaining a Raman spectrum according to the first reconstructed signal, and obtaining a photoacoustic spectrum according to the second reconstructed signal; Obtaining a first ammonia concentration according to the position of the characteristic peak in the Raman spectrum, and obtaining a second ammonia concentration according to the position of the characteristic peak in the photoacoustic spectrum; The trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and a Bayesian causal analysis method.
7. The method for measuring trace ammonia by optical means according to claim 6, characterized in that: The trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and the Bayesian causal analysis method, including: Determine the variables that affect the accuracy of the trace ammonia concentration based on historical experimental data, and calculate the likelihood function of the variables; Obtaining a posterior probability formula for the trace ammonia concentration according to the likelihood function and the prior probability of the trace ammonia concentration; The trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and the posterior probability formula.
8. The method for measuring trace ammonia by optical means according to claim 7, characterized in that: If there are multiple variables, the calculation to obtain the likelihood function about the variables includes: Determining, based on the historical experimental data, a relationship between the variable and the trace ammonia concentration, and a correlation coefficient between the variables; According to the historical experimental data and the correlation coefficient, a mean vector and a covariance matrix of the variable are obtained; The likelihood function is obtained according to the relationship, the mean vector and the covariance matrix.
9. The method for measuring trace ammonia by optical means according to claim 8, characterized in that: The trace ammonia concentration is obtained according to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, including: According to the first ammonia concentration, the second ammonia concentration and the posterior probability formula, obtaining the probability of occurrence of the first ammonia concentration and the second ammonia concentration; The probability is compared with a preset probability value, and if the probability is greater than the preset probability value, a larger value between the first ammonia concentration and the second ammonia concentration is used as the trace ammonia concentration.
10. A system for measuring trace ammonia by optical means, characterized in that: include: An acquisition module, used to acquire Raman scattered light signals and photoacoustic signals of the ammonia-containing sample to be tested; A reconstruction module, used to reconstruct the Raman scattered light signal to obtain a first reconstructed signal, and reconstruct the photoacoustic signal to obtain a second reconstructed signal; A calculation module is used to calculate the trace ammonia concentration according to the first reconstructed signal and the second reconstructed signal.
Citation Information
Patent Citations
A device and method for detecting escaped ammonia concentration based on TDLAS technology
CN105806806B
Homonuclear diatomic gas detection method and system based on photoacoustic stimulated Raman effect
CN112577942A
Raman spectrum-based SF6 decomposed gas detection enhancement system
CN112666083A
Noise reduction method for metering signal of direct-current electric energy meter
CN118939937A
Raman spectroscopy of respiratory gases
EP0557658A1