A TDLAS gas sensor and an anti-interference filtering noise reduction method thereof
By decomposing and classifying the TDLAS gas sensor signal using an adaptive median filtering algorithm, the problem of decreased detection accuracy in complex environments is solved, achieving efficient noise reduction and fast response, making it suitable for industrial field detection.
Patent Information
- Application Number
- CN202610719205.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-06-26
Smart Images

Figure CN122286101A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of gas concentration detection technology, and in particular to a TDLAS gas sensor and its anti-interference filtering and noise reduction method. Background Technology
[0002] Tunable semiconductor laser absorption spectroscopy (TDLAS) technology, with its advantages of high selectivity, high sensitivity, and fast real-time response, has been widely used in the field of gas concentration detection, especially in scenarios such as trace moisture monitoring in battery drying processes and industrial waste gas analysis, becoming one of the core technologies to replace traditional chemical detection methods. TDLAS-based gas sensors achieve concentration inversion through the characteristic absorption interaction between laser light and target gas molecules; their detection accuracy directly determines the quality of industrial production and the effectiveness of process optimization.
[0003] However, in practical applications, the detection signal of TDLAS gas sensors is susceptible to interference from multiple noise sources, leading to decreased detection accuracy and making it difficult to meet the requirements of high-precision measurement. Existing noise reduction techniques, such as simple mean filtering and threshold filtering, have limited effectiveness in suppressing temperature-pressure coupled noise. Complex algorithms suffer from high computational complexity and slow response speed, failing to meet the real-time detection needs of industrial scenarios. The basic noise reduction function of lock-in amplifiers can only suppress some low-frequency noise and is insufficient to cope with dynamically changing environmental interference. Therefore, developing a targeted, highly effective, fast-responding, and significantly effective filtering and noise reduction method is crucial. Summary of the Invention
[0004] The purpose of this invention is to address the problem that existing TDLAS gas sensors are susceptible to noise interference from ambient temperature and pressure fluctuations in complex industrial environments, leading to a decrease in detection accuracy, while traditional filtering methods cannot balance noise reduction effectiveness with real-time response speed. This invention provides a TDLAS gas sensor and its anti-interference filtering and noise reduction method.
[0005] The above-mentioned objective of this application is achieved through the following technical solution: S1: Based on the designed TDLAS gas sensor, acquire the raw analog-to-digital conversion data of the gas to be measured; S2: Using an adaptive median filtering algorithm, the original analog-to-digital conversion data is filtered, denoised, and baseline corrected to obtain the time-domain signal; S3: Based on Beer-Lambert's law and combined with the time-domain signal, the gas concentration of the gas to be measured is calculated.
[0006] Optionally, step S2 includes: The adaptive median filtering algorithm specifically includes the following steps: S21: The original analog-to-digital conversion data is processed using multi-resolution analysis, which decomposes it into low-frequency and high-frequency components. The high-frequency components include noise and absorption peak signals; the low-frequency components include the signal trend and overall profile. S22: Based on high-frequency components, calculate the local gradient change of the signal and identify noise regions and absorption peak regions; S23: Based on the local amplitude distribution characteristics of the signal, an adaptive threshold is set to classify and process noise regions and absorption peak regions, as follows: Median filtering is used to remove noise from noisy regions. A protection zone is established for the absorption peak region, and median filtering is not performed. S24: The processed high-frequency and low-frequency components are recombined according to the time-series sampling order of the original analog-to-digital conversion data; a multi-scale reconstruction algorithm is used to synthesize the recombined high-frequency and low-frequency components into a time-domain signal, and finally the denoised time-domain signal is output.
[0007] Optionally, step S21 includes: The decomposition formula for the low-frequency component is:
[0008] in, The low-frequency components are those of the first-order decomposition. The original signal for analog-to-digital conversion. These are the coefficients of a low-pass scale filter. The sampling point number, For signal sequence indexing; The decomposition formula for high-frequency components is:
[0009] in, For the high-frequency components of the first-order decomposition, These are the coefficients of the high-pass wavelet filter.
[0010] Optionally, step S22 includes: The local gradient change is calculated using the first-order forward difference method, as shown in the formula:
[0011] in, For the first Gradient values at each sampling point The first high-frequency component The amplitude of each sampling point The first high-frequency component The amplitude of each sampling point; The formula for the mean local gradient is:
[0012] in, Let be the mean of the local window gradient at the k-th sampling point. This refers to the width of a local window. For the first The gradient value of each sampling point.
[0013] Optionally, step S23 includes: The formula for calculating the adaptive threshold is:
[0014] in, For the first Adaptive threshold for each sampling point The average amplitude weighting coefficient is used. The standard deviation of the amplitude is the weighting coefficient. The mean local amplitude of the k-th sampling point. For the first Local amplitude standard deviation of each sampling point; By comparing gradient values With adaptive threshold The magnitude of the signal determines the signal type: when and If the rate of change exceeds the preset threshold, it is determined to be an absorption peak region; otherwise, it is determined to be a noise region or a stable background region.
[0015] Optionally, step S24 includes: The formula for the multi-scale reconstruction algorithm is:
[0016] in, These are the coefficients of the low-pass reconstruction filter. These are the coefficients of a high-pass reconstruction filter, used to recover the time-domain signal from the processed low-frequency and high-frequency components. ; and These represent the low-frequency component and the high-frequency component, respectively. and Indicates the time-domain sampling point number and sampling point number Belongs to the set of integers .
[0017] A TDLAS gas sensor includes: an integrated controller, an optical path cell, and a computer; the integrated controller includes: a signal generator, a laser, a collimator, a photodetector, a preamplifier, and a lock-in amplifier; The optical path cell is connected to the integrated controller via optical fiber; The integrated controller is connected to the computer via a serial bus.
[0018] Optionally, the TDLAS gas sensor further includes: The laser is generated in a laser, adjusted by a collimator, and then transmitted by an optical fiber to an optical path cell in the gas environment to be tested. After multiple reflections in the optical path cell, it is converted into an electrical signal by a photodetector. The electrical signal is processed by a preamplifier and a lock-in amplifier to obtain the raw analog-to-digital conversion data. The raw analog-to-digital conversion data is input into a computer, and an adaptive median filtering algorithm is used to filter, reduce noise, and correct the baseline of the raw analog-to-digital conversion data.
[0019] The beneficial effects of the technical solution provided in this application are: 1. This invention addresses the susceptibility of TDLAS gas sensors to interference from ambient temperature fluctuations and pressure changes by employing an adaptive median filtering algorithm to significantly improve the signal-to-noise ratio of the sensor signal, thus exhibiting strong anti-interference capabilities.
[0020] 2. This invention decomposes the signal into high-frequency and low-frequency components through multi-resolution analysis, performs targeted filtering on noise regions, and establishes protection for absorption peak regions. It can accurately separate the effective spectral signal from the noise components, significantly reduce signal baseline drift, and has a good noise reduction effect.
[0021] 3. This invention employs local gradient calculation and adaptive threshold determination. Key parameters are dynamically adjusted based on the local characteristics of the signal, ensuring noise reduction while maintaining a fast response speed, thus meeting the real-time detection needs of industrial sites. Attached Figure Description
[0022] The present application will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of the TDLAS gas sensor detection system in the embodiments of this application; Figure 2 This is a schematic diagram illustrating the principle of the adaptive median filtering algorithm in the embodiments of this application; Figure 3 This is a schematic diagram comparing the original data and the noise-reduced data in the embodiments of this application. Detailed Implementation
[0023] To provide a clearer understanding of the technical features, objectives, and effects of this application, the specific embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0024] The embodiments of this application provide an anti-interference filtering and noise reduction method for a TDLAS gas sensor.
[0025] Please refer to Figure 1 , Figure 1This is a schematic diagram of a TDLAS gas sensor detection system according to an embodiment of the present application, which includes an anti-interference filtering and noise reduction method for a TDLAS gas sensor. S1: Based on the designed TDLAS gas sensor, acquire the raw analog-to-digital conversion data of the gas to be measured; S2: Using an adaptive median filtering algorithm, the original analog-to-digital conversion data is filtered, denoised, and baseline corrected to obtain the time-domain signal; Step S2 includes: The adaptive median filtering algorithm specifically includes the following steps: S21: The original analog-to-digital conversion data is processed using multi-resolution analysis, which decomposes it into low-frequency and high-frequency components. The high-frequency components include noise and absorption peak signals; the low-frequency components include the signal trend and overall profile. S22: Based on high-frequency components, calculate the local gradient change of the signal and identify noise regions and absorption peak regions; S23: Based on the local amplitude distribution characteristics of the signal, an adaptive threshold is set to classify and process noise regions and absorption peak regions, as follows: Median filtering is used to remove noise from noisy regions. A protection zone is established for the absorption peak region, and median filtering is not performed. As one example, a median filtering algorithm is used to remove noise from the noisy region and a protection region is established for the absorption peak region to avoid the processing of neighboring points during the filtering process from affecting the absorption peak. Key parameters (such as threshold, window size, and protection range) are dynamically adjusted according to the local characteristics of the signal.
[0026] S24: The processed high-frequency and low-frequency components are recombined according to the time-series sampling order of the original analog-to-digital conversion data; a multi-scale reconstruction algorithm is used to synthesize the recombined high-frequency and low-frequency components into a time-domain signal, and finally the denoised time-domain signal is output.
[0027] S3: Based on Beer-Lambert's law and combined with the time-domain signal, the gas concentration of the gas to be measured is calculated.
[0028] As one example, Figure 2 This is a schematic diagram illustrating the principle of the adaptive median filtering algorithm; Figure 3 This is a diagram comparing the original data and the noise-reduced data.
[0029] Step S21 includes: The decomposition formula for the low-frequency component is:
[0030] in, The low-frequency components are those of the first-order decomposition. The original signal for analog-to-digital conversion. These are the coefficients of a low-pass scale filter. The sampling point number, For signal sequence indexing; The decomposition formula for high-frequency components is:
[0031] in, For the high-frequency components of the first-order decomposition, These are the coefficients of the high-pass wavelet filter.
[0032] Step S22 includes: The local gradient change is calculated using the first-order forward difference method, as shown in the formula:
[0033] in, For the first Gradient values at each sampling point The first high-frequency component The amplitude of each sampling point The first high-frequency component The amplitude of each sampling point; The formula for the mean local gradient is:
[0034] in, Let be the mean of the local window gradient at the k-th sampling point. This represents the width of a local window, with a value ranging from 5 to 15. For the first The gradient value of each sampling point.
[0035] Step S23 includes: The formula for calculating the adaptive threshold is:
[0036] in, For the first Adaptive threshold for each sampling point This is the average amplitude weighting coefficient, with a value ranging from 0.5 to 1.5. This is the amplitude standard deviation weighting coefficient, with a value ranging from 0.5 to 1.5. The mean local amplitude of the k-th sampling point. For the first Local amplitude standard deviation of each sampling point; By comparing gradient values With adaptive threshold The magnitude of the signal determines the signal type: when and If the rate of change exceeds the preset threshold, it is determined to be an absorption peak region; otherwise, it is determined to be a noise region or a stable background region.
[0037] Step S24 includes: The formula for the multi-scale reconstruction algorithm is:
[0038] in, These are the coefficients of the low-pass reconstruction filter. These are the coefficients of a high-pass reconstruction filter, used to recover the time-domain signal from the processed low-frequency and high-frequency components. ; and These represent the low-frequency component and the high-frequency component, respectively. and Indicates the time-domain sampling point number and sampling point number Belongs to the set of integers .
[0039] As one example, the TDLAS gas sensor employs direct laser absorption spectroscopy (DLS) for detection. Its core principle lies in locking the laser frequency to the peak position of the characteristic absorption spectral line of the target gas. By measuring the attenuation relationship between the incident and transmitted light intensities, a mathematical model is established based on the Lambert-Beer law, thereby achieving quantitative analysis of the target gas concentration. Since the emission wavelength of semiconductor lasers is easily affected by external factors such as ambient temperature and mechanical vibration, filtering algorithms can significantly improve the stability of the sensor's detection signal.
[0040] As one embodiment, according to Figure 3 When the sensor of this invention is applied to the moisture detection scenario in the baking oven of a battery factory, the problem that the original analog-to-digital conversion data is easily affected by environmental interference in this scenario can be effectively addressed by the above-mentioned filtering and noise reduction method, which can effectively filter out noise while completely preserving the characteristic information of the gas absorption peak, thus ensuring the reliability of the moisture concentration detection results.
[0041] A TDLAS gas sensor includes: an integrated controller, an optical path cell, and a computer; the integrated controller includes: a signal generator, a laser, a collimator, a photodetector, a preamplifier, and a lock-in amplifier; The optical path cell is connected to the integrated controller via optical fiber; The integrated controller is connected to the computer via a serial bus.
[0042] The TDLAS gas sensor also includes: The laser is generated in a laser, adjusted by a collimator, and then transmitted by an optical fiber to an optical path cell in the gas environment to be tested. After multiple reflections in the optical path cell, it is converted into an electrical signal by a photodetector. The electrical signal is processed by a preamplifier and a lock-in amplifier to obtain the raw analog-to-digital conversion data. The raw analog-to-digital conversion data is input into a computer, and an adaptive median filtering algorithm is used to filter, reduce noise, and correct the baseline of the raw analog-to-digital conversion data.
[0043] Table 1 below compares the original analog-to-digital conversion data of cell moisture concentration measured in the cell baking oven of the battery factory before and after filtering and noise reduction.
[0044] Table 1
[0045] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure.
[0046] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A method for anti-interference filtering and noise reduction of a TDLAS gas sensor, characterized in that, The method includes the following steps: S1: Based on the designed TDLAS gas sensor, acquire the raw analog-to-digital conversion data of the gas to be measured; S2: Using an adaptive median filtering algorithm, the original analog-to-digital conversion data is filtered, denoised, and baseline corrected to obtain the time-domain signal; S3: Based on Beer-Lambert's law and combined with the time-domain signal, the gas concentration of the gas to be measured is calculated.
2. The anti-interference filtering and noise reduction method of a TDLAS gas sensor according to claim 1, wherein, Step S2 includes: The adaptive median filtering algorithm specifically includes the following steps: S21: The original analog-to-digital conversion data is processed using multi-resolution analysis, which decomposes it into low-frequency and high-frequency components. The high-frequency components include noise and absorption peak signals; the low-frequency components include the signal trend and overall profile. S22: Based on high-frequency components, calculate the local gradient change of the signal and identify noise regions and absorption peak regions; S23: Based on the local amplitude distribution characteristics of the signal, an adaptive threshold is set to classify and process noise regions and absorption peak regions, as follows: Median filtering is used to remove noise from noisy regions. A protection zone is established for the absorption peak region, and median filtering is not performed. S24: The processed high-frequency and low-frequency components are recombined according to the time-series sampling order of the original analog-to-digital conversion data; a multi-scale reconstruction algorithm is used to synthesize the recombined high-frequency and low-frequency components into a time-domain signal, and finally the denoised time-domain signal is output.
3. The anti-interference filtering and noise reduction method of a TDLAS gas sensor according to claim 2, wherein, Step S21 includes: The decomposition formula for the low-frequency component is: wherein, is a low frequency component of the 1st order decomposition, is an analog to digital conversion raw signal, is a low pass scaling filter coefficient, is a sample point number, is a signal sequence index; The decomposition formula for high-frequency components is: wherein is a high frequency component of the first order decomposition, is a high-pass wavelet filter coefficient.
4. The anti-interference filtering and noise reduction method of a TDLAS gas sensor according to claim 2, wherein, Step S22 includes: The local gradient change is calculated using the first-order forward difference method, as shown in the formula: wherein, is a gradient value of the first sample point, is an amplitude value of the first sample point in the high frequency component, is an amplitude value of the first sample point in the high frequency component; The formula for the mean local gradient is: wherein, is the local window gradient mean for the kth sample point, is the local window width, is the gradient value for the kth sample point.
5. The anti-interference filtering and noise reduction method of a TDLAS gas sensor according to claim 4, wherein, Step S23 includes: The formula for calculating the adaptive threshold is: in, For the first Adaptive threshold for each sampling point The average amplitude weighting coefficient is used. The standard deviation of the amplitude is the weighting coefficient. The mean local amplitude of the k-th sampling point. For the first Local amplitude standard deviation of each sampling point; By comparing gradient values With adaptive threshold The magnitude of the signal determines the signal type: when and If the rate of change exceeds the preset threshold, it is determined to be an absorption peak region; otherwise, it is determined to be a noise region or a stable background region.
6. The anti-interference filtering and noise reduction method for a TDLAS gas sensor as described in claim 2, characterized in that, Step S24 includes: The formula for the multi-scale reconstruction algorithm is: in, These are the coefficients of the low-pass reconstruction filter. These are the coefficients of a high-pass reconstruction filter, used to recover the time-domain signal from the processed low-frequency and high-frequency components. ; and These represent the low-frequency component and the high-frequency component, respectively. and Indicates the time-domain sampling point number and sampling point number Belongs to the set of integers .
7. A TDLAS gas sensor, used to implement the anti-interference filtering and noise reduction method for a TDLAS gas sensor as described in any one of claims 1-6, characterized in that, The TDLAS gas sensor includes: an integrated controller, an optical path cell, and a computer; the integrated controller includes: a signal generator, a laser, a collimator, a photodetector, a preamplifier, and a lock-in amplifier; The optical path cell is connected to the integrated controller via optical fiber; The integrated controller is connected to the computer via a serial bus.
8. A TDLAS gas sensor as described in claim 7, characterized in that, The TDLAS gas sensor also includes: The laser is generated in a laser, adjusted by a collimator, and then transmitted by an optical fiber to an optical path cell in the gas environment to be tested. After multiple reflections in the optical path cell, it is converted into an electrical signal by a photodetector. The electrical signal is processed by a preamplifier and a lock-in amplifier to obtain the raw analog-to-digital conversion data. The raw analog-to-digital conversion data is input into a computer, and an adaptive median filtering algorithm is used to filter, reduce noise, and correct the baseline of the raw analog-to-digital conversion data.
