Mid-infrared laser spectrum absorption detection filtering control method for natural gas detection
Patent Information
- Application Number
- CN202610922762.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-06-25
AI Technical Summary
1、噪声抑制能力差且缺乏自适应性;
1、本发明的用于天然气检测的中红外激光光谱吸收检测滤波控制方法, 其核心在于采用3343nm独立无吸收波段的分时驱动机制:首次在燃气检测中红外激光光谱技术中设置绝对无吸收的噪声提取波段(3343nm)和特征吸收的检测扫描波段(3343-3347nm),通过DAC精准锁定激光器波长,波长波动误差≤±0.01nm,实现背景噪声与有效吸收信号的物理分离,避免噪声提取受气体交叉干扰,解决了传统技术噪声提取不纯净的核心问题。
Smart Images

Figure CN122468649B_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of gas / natural gas detection technology, specifically a mid-infrared laser spectral absorption detection and filtering control method for natural gas detection. It is particularly suitable for high-precision concentration detection of characteristic gases such as methane and ethane in natural gas, and can be applied to scenarios such as urban natural gas pipeline network inspection, online monitoring of gas stations, and natural gas leak tracing. Background Technology
[0002] Tunable semiconductor laser absorption spectroscopy (TDLAS) is a mainstream technology in the field of gas detection. The mid-infrared band is a preferred technology for high-precision detection because the fundamental absorption peaks of characteristic gases such as methane and ethane are located in this band. This type of technology typically uses interband cascaded lasers (ICLs) as the light source and inverts the concentration by analyzing the amplitude of the gas absorption peaks based on Lambert-Beer's law.
[0003] However, existing detection technologies using mid-infrared laser spectral absorption have the following shortcomings in practical gas detection scenarios: 1. Poor noise suppression capability and lack of adaptability; During the detection process, the noise from external environmental noise (such as traffic and construction noise around pipelines), optical path system noise (such as optical path loss and lens scattering), and circuit system noise (such as ADC / DAC sampling noise and amplifier noise) are superimposed. Traditional filtering methods (such as fixed weight low-pass / high-pass filtering and wavelet filtering) are static filtering strategies and cannot adjust the filtering parameters according to the real-time changes in noise. The filtering effect drops significantly when the noise fluctuates.
[0004] 2. Valid signals are easily filtered out incorrectly; Traditional filtering methods fail to distinguish the characteristic differences between background noise and gas absorption peak signals. In the process of suppressing strong noise, weak absorption peak signals are easily filtered out, which leads to a decrease in the detection accuracy of low concentrations of methane and ethane in natural gas and a drift in the concentration inversion results.
[0005] 3. Poor coupling between noise extraction and filtering; Existing technologies do not set up independent noise extraction bands, and mostly use the non-absorption range within the detection band as a noise reference. This range may still be affected by gas cross-interference, resulting in the extracted noise signal containing effective gas absorption components, and noise residue still exists after filtering.
[0006] 4. The algorithm has high implementation complexity; Some existing adaptive filtering algorithms (such as the traditional LMS algorithm) have slow convergence speed and do not simplify the algorithm by taking into account the characteristics of the laser driving signal, making it difficult to achieve engineering applications under the real-time requirements of gas detection.
[0007] 5. Insufficient environmental adaptability; Existing technologies do not address the temperature and pressure compensation or electromagnetic interference prevention measures required for gas detection environments. Changes in ambient temperature and pressure, as well as electromagnetic interference, will further reduce detection accuracy and fail to meet the detection needs of complex environments.
[0008] To address the aforementioned technical shortcomings, current improvements in gas detection technology primarily focus on optical path optimization (such as increasing the optical path length using multi-pass cells), laser wavelength modulation (such as WMS technology to lower the detection limit), and multi-sensor fusion (such as AI-based leak detection using acoustic signatures). However, none of these approaches address the impact of noise on spectral absorption detection from the perspectives of laser-driven signal design, independent noise extraction, adaptive filtering algorithm fusion, and full-scenario engineering adaptation. Consequently, they fail to balance the real-time performance, accuracy, and stability of detection, making it clearly difficult to meet the demands for micro-leakage detection in urban natural gas pipelines and high-precision monitoring of multi-component gases at gas stations. Summary of the Invention
[0009] This invention addresses the shortcomings of existing mid-infrared laser spectral absorption technology for gas detection by providing a simple, highly accurate, and widely applicable mid-infrared laser spectral absorption detection filtering and control method for natural gas detection.
[0010] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A mid-infrared laser spectral absorption detection filtering control method for natural gas detection, comprising: Step S1: Laser time-division drive signal generation; A digital-to-analog converter (DAC) is used to output a square wave drive signal and a sawtooth wave scanning signal in a time-division manner to drive the mid-infrared interband cascaded laser (ICL) to work; The drive signal period is divided into a first half period and a second half period, and the drive signal frequency and the ADC sampling frequency satisfy an integer multiple relationship. Step S2: Optical signal acquisition and electrical signal conversion; the optical signal output from the mid-infrared interband cascaded laser is passed into the gas detection absorption cell, and after absorption, the light intensity signal is acquired by the photodetector; Step S3: Adaptive filtering control based on optimized FxLMS algorithm; construct an adaptive digital filter based on the filtering x-minimum mean square algorithm FxLMS, and adopt a strategy of iterative convergence of weight vector in the first half-cycle and fixed weight vector filtering in the second half-cycle to complete the adaptive filtering of background noise. Step S4: Temperature and pressure compensated concentration inversion calculation; perform baseline fitting, absorbance calculation, and temperature and pressure compensated concentration inversion on the filtered pure effective signal to obtain the concentration values of methane and ethane in natural gas.
[0011] As a further improvement of the present invention: the temperature and pressure compensated concentration inversion process includes: Obtain a reference signal D(n) = K × d(n), and use a laser or detector channel in another band that has no absorption of methane but is equally sensitive to changes in temperature, pressure, and vibration throughout the optical path to obtain the reference signal to construct X(n). Training the filter in the "baseline region": In the acquired full spectrum, a wavelength range is defined that is far from the methane absorption line, called the "baseline region," which serves as the non-absorption region. In the baseline region, the theoretical absorbance of the pure spectrum is zero, and a virtual expected signal is defined. Using the reference signal acquired at the same time and the error in this baseline region, an adaptive filter based on the optimized FxLMS algorithm is driven to achieve fast convergence and predict the jitter of the spectral baseline. After training, the adaptive filter is fixed, and the main signal of the entire spectrum is input into the system. The adaptive filter uses the reference signal to generate an interference estimate for the entire spectrum. The interference estimate is subtracted from the main signal of the entire spectrum and then output by the system. At this time, it is the pure absorbance light after adaptive temperature and pressure compensation.
[0012] As a further improvement of the present invention: the process of eliminating light intensity baseline drift by using absorbance calculation in step S4 includes: Calibration: Introduce high-purity nitrogen or zero gas. At this time, the methane concentration is 0, all absorption peaks disappear, and the main detector signal is completely the sum of interference signals. Acquire the drift reference signal. Training: An adaptive filter based on the optimized FxLMS algorithm is trained using the drift reference signal to predict the drift of the light intensity baseline; Detection: When the natural gas to be tested is introduced, the methane absorption peak appears, the filter coefficients are frozen or updated very slowly, and only the trained adaptive digital filter is used to generate the interference estimation signal; Output: The system outputs a pure absorbance spectrum stripped of baseline drift, which is then used for subsequent concentration inversion.
[0013] As a further improvement of the present invention: in step S4, the process of constructing the multi-input FxLMS architecture includes: Constructing multi-dimensional reference signals; Reference signal 1: Light intensity drift It originates from the splitting ratio reference channel, the intensity at non-absorption wavelength points, or the DC component of the modulation signal; it primarily carries information about light source power fluctuations and detector drift. Reference signal 2: Temperature and pressure disturbance ; derived from highly sensitive, fast-response temperature / pressure sensors, or spectral features that are sensitive to temperature and pressure but not to concentration; An adaptive filter based on an optimized FxLMS algorithm is constructed, resulting in a multi-channel FxLMS filter bank.
[0014] Among them, two filters , The weight coefficients are updated independently via LMS-like rules; Fusion Training: Zero Gas Phase: Detector Signal It consists entirely of interference; two filters learn together, one capturing slow baseline fluctuations and the other learning rapid jitter caused by temperature and pressure. Measurement phase: With fixed filter coefficients, parallel operation is performed to simultaneously remove two types of interference from the measured signal, outputting a clean spectrum. .
[0015] As a further improvement of the present invention: step S1 includes: Square wave drive signal: amplitude 4-6V, frequency 500Hz-2kHz, fixed laser drive current 100-300mA, precisely lock the wavelength of the mid-infrared interband cascaded laser at 3343nm, wavelength fluctuation error ≤±0.01nm; perform wavelength calibration using a wavelength meter, adjust the square wave amplitude so that the wavelength of the mid-infrared interband cascaded laser falls at 3343nm, record the calibrated square wave amplitude as a fixed value, and keep it unchanged in subsequent tests; Sawtooth wave scanning signal: amplitude 0-6V, scanning rate 10-50nm / ms, controlling the output wavelength of the mid-infrared interband cascaded laser to scan linearly in the range of 3343nm-3347nm.
[0016] As a further improvement of the present invention: In step S2, the photocurrent signal output by the photodetector is sequentially processed by I / V conversion, signal amplification, and DC blocking filtering, and then acquired as a digital electrical signal by an analog-to-digital converter (ADC) with a bit width ≥ 24 bits. The ADC acquisition and DAC drive signals are synchronously triggered by hardware. The photodetector has a response band of 2-5μm and a responsivity of ≥0.5A / W; the I / V converter has a feedback resistance of 10-100MΩ and a bandwidth of ≥1MHz; the amplifier has a gain of 10-100 times; and the ADC has a sampling frequency of 5-20kHz. During preprocessing, after the electrical signal is converted, it undergoes DC blocking and first-order RC low-pass filtering preprocessing. The DC blocking capacitor value is 0.1-1μF, and the low-pass filter cutoff frequency is ≥5kHz. During signal output, two digital detection signals are obtained. The first half-cycle is a pure noise reference signal containing only background noise, and the second half-cycle is the effective signal to be measured containing the absorption peak signal of the characteristic gas of the combustion gas and background noise.
[0017] As a further improvement of the present invention: In step S3, the value of the filter x-minimum mean square algorithm FxLMS is selected according to the criterion of small step size to ensure stability and large step size to improve convergence speed. For the gas detection scenario, the 32nd order is preferred.
[0018] As a further improvement of the present invention: step S3 includes: Step S301: Define the reference signal and input signal; Let the square wave driving signal of the first half cycle be d(n), and the output after the DC gain K of the system be the reference signal D(n) = K × d(n); let the pure noise detection signal of the first half cycle be the input signal x(n). Before the input signal enters the filter, an amplitude limiting filter is added to remove abnormal noise with an amplitude exceeding ±3σ, where σ is the noise standard deviation of the first N sampling cycles, and N ≥ 100. Step S302: Calculate the filter output; Let the weight coefficients of the digital filter be wk, where k = 1, 2, ..., K, and K is the filter order, which takes values from 16 to 64. The filter output signal y(n) is the discrete-time convolution of the input sequence and the weight coefficient sequence. Step S303: Weight vector iterative convergence; the filter weight vector is initialized with a zero vector, i.e., wk(0)=0; the weight vector is adjusted along the negative gradient direction of the performance function with respect to the weight coefficients based on the steepest descent method, and the instantaneous estimation of the gradient is used instead of the average estimation. Step S304: Fixed weight vector filtering; the filter weight vector is kept fixed in the second half of the cycle, and the effective signal to be measured is input to the converged adaptive filter to complete the adaptive filtering of background noise; the output contains only the pure effective signal of the characteristic gas absorption peak of the gas combustion.
[0019] As a further improvement of the present invention: step S4 includes: Baseline fitting: A third-order polynomial was used for fitting, with the fitting window covering the entire band of the sawtooth wave scan. The number of fitting points was ≥100, and the fitting error was ≤±0.001V. The fitted baseline light intensity was obtained. Absorbance calculation: The maximum value extracted from the absorbance curve is the absorption peak value Amax, and the half width at half maximum (WHM) of the absorption peak satisfies 0.02-0.04 nm for methane and 0.03-0.05 nm for ethane; Temperature and pressure compensated concentration inversion: Concentration calculation is performed based on a special formula for gas detection using Lambert-Beer's law; Post-processing of results: The concentration inversion results are post-processed using moving average filtering; a validity determination of the results is added. If the half-width at half-maximum of the absorption peak exceeds the normal range, the detection result is deemed invalid and the detection is repeated.
[0020] As a further improvement of the present invention, it also includes step S5: system calibration and periodic calibration; full parameter calibration is completed before the first use, and periodic calibration is performed during actual use. The calibration and calibration results are stored locally in the system as the reference parameters for detection.
[0021] As a further improvement of the present invention: step S5 includes system calibration; performed in a pure nitrogen atmosphere, and includes one or more of the following calibration operations: Noise extraction and calibration: Acquire the noise signal of the first half cycle, calibrate the reference value of the system background noise, and determine the σ value of the amplitude limiting filter; Transfer function K calibration: Input square wave signals of different amplitudes, collect the corresponding output signals, and obtain the system DC gain K through linear fitting; Concentration calibration: Using standard methane / ethane gas of known concentration, the gas is introduced into the absorption cell, the absorption peak value is collected, and a calibration curve of absorption peak value-concentration is established to correct the error of the concentration inversion formula. Temperature and pressure compensation calibration: The absorption peak values of standard gases are collected under different temperature and pressure conditions, and the correction coefficient of the temperature and pressure compensation factor is calibrated.
[0022] As a further improvement of the present invention: step S5 includes periodic calibration, which includes one or more of the following calibration operations: Routine calibration: Preset periodic calibration, calibrating according to a fixed time cycle; Emergency calibration: If the testing environment changes drastically, or if the equipment is involved in a collision or repair, on-site calibration should be performed immediately.
[0023] As a further improvement of the present invention, it also includes the step of: constructing a hardware architecture; the hardware architecture includes a light source module, a signal generation module, a photoelectric signal conversion module, a signal acquisition module, a data processing module, a system calibration and standardization module, and an auxiliary module; wherein, the signal generation module generates a time-division driving signal to drive the light source module, the photoelectric signal conversion module completes the conversion and preprocessing of the photoelectric signal to the electrical signal, the signal acquisition module converts the analog signal into a digital signal, the data processing module implements FxLMS adaptive filtering, temperature and pressure compensated concentration inversion, and result post-processing, the system calibration and standardization module completes the initial calibration and periodic calibration, and the auxiliary module includes a temperature and pressure sensor, an isolated power supply, and an audible and visual warning module. Compared with the prior art, the advantages of the present invention are: 1. The mid-infrared laser spectroscopy absorption detection and filtering control method for natural gas detection of the present invention is based on the use of a time-division driving mechanism with an independent 3343nm non-absorption band: For the first time in the mid-infrared laser spectroscopy technology for gas detection, an absolutely non-absorption noise extraction band (3343nm) and a characteristic absorption detection scanning band (3343-3347nm) are set. The laser wavelength is precisely locked by DAC, with a wavelength fluctuation error ≤ ±0.01nm, realizing the physical separation of background noise and effective absorption signal, avoiding noise extraction from gas cross-interference, and solving the core problem of impure noise extraction in traditional technology.
[0024] 2. The mid-infrared laser spectral absorption detection filtering control method for natural gas detection of the present invention adopts deep fusion optimization of FxLMS algorithm and laser driving signal: For the DC fixed value characteristics of square wave driving signal, the theoretical transfer function of the system is simplified to a constant K, which greatly reduces the computational complexity of FxLMS algorithm; a time-matched weight vector iteration strategy is designed to make the algorithm convergence time accurately match the square wave period, with convergence in the first half of the period and filtering in the second half of the period, taking into account both filtering adaptability and detection real-time performance, and adopting optimization methods such as zero vector initialization and amplitude limiting filtering to improve algorithm stability and anti-interference.
[0025] 3. The mid-infrared laser spectral absorption detection filtering control method for natural gas detection of the present invention constructs a gas detection-specific adaptation model based on Lambert-Beer's law: a temperature and pressure compensation factor is introduced, and a temperature and pressure compensated concentration inversion formula is derived to eliminate the influence of environmental temperature and pressure changes on the detection results; a third-order polynomial baseline fitting, moving average result post-processing, and validity determination are designed to achieve full-link accuracy optimization from signal processing to concentration inversion, and the detection limits of methane and ethane reach trace levels.
[0026] 4. The mid-infrared laser spectral absorption detection filtering control method for natural gas detection of the present invention adopts a full-process system calibration and engineering adaptation scheme: it formulates the initial full parameter calibration and graded periodic calibration criteria, clarifies the calibration method and calibration trigger conditions of each parameter; and provides a core parameter value table for different gas detection scenarios. Only three parameters, namely the driving signal frequency, filter order, and step size factor, need to be adjusted to adapt to different scenarios such as pipeline inspection, station monitoring, and leak tracing, so as to realize the engineering implementation of the technical solution.
[0027] 5. The mid-infrared laser spectral absorption detection filtering control method for natural gas detection in this invention adopts a multi-dimensional anti-interference design of hardware and software: at the hardware level, measures such as isolated power supply, shielded lines, sealed absorption cell, and polarization-maintaining fiber are used to suppress electromagnetic interference, optical path loss fluctuations and other problems; at the software level, steps such as amplitude limiting filtering, abnormal signal rejection, and result validity judgment are designed to avoid detection errors caused by sudden noise and equipment failure, and improve the robustness of the system in complex gas detection sites.
[0028] 6. The mid-infrared laser spectral absorption detection filtering control method for natural gas detection of the present invention is an adaptive mid-infrared laser spectral absorption detection filtering control method for background noise. Through independent non-absorption band design, FxLMS algorithm optimization, full-link parameter calibration, and multi-dimensional anti-interference design, it achieves independent and accurate extraction of background noise, real-time adaptive adjustment of filtering parameters, and lossless preservation of effective absorption signals. At the same time, the present invention completes temperature and pressure compensation and engineering adaptation, thereby solving the problems of limited concentration inversion accuracy and result drift caused by environmental / optical / circuit noise and temperature and pressure changes. Ultimately, it improves the real-time performance, accuracy, and stability of gas detection and can meet the engineering application needs of different gas detection scenarios. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating the method of the present invention in a specific application example.
[0030] Figure 2 This is a system architecture and module linkage logic diagram of the present invention in a specific application example, which marks the connection relationship, data flow and triggering method of the time-division driving module, optical / electrical signal conversion module, adaptive filtering module, concentration inversion module and system calibration and calibration module.
[0031] Figure 3 This is a waveform diagram of the DAC time-division driving signal in a specific application example of the present invention. The horizontal axis is time and the vertical axis is voltage. The amplitude, frequency, period and other parameters of the square wave and sawtooth wave are marked, and the timing characteristics of the square wave in the first half period and the sawtooth wave in the second half period are displayed.
[0032] Figure 4 This is a distribution of absorption spectra of methane, ethane, and water vapor in the 3343-3350nm wavelength band in a specific application example of the present invention. The horizontal axis is wavelength (μm), and the vertical axis is absorption coefficient. The characteristic absorption peaks are marked at 3343nm (no absorption band), 3344.6nm (methane), and 3345.8nm (ethane).
[0033] Figure 5 This is a flowchart illustrating the system-wide timing control table in a specific application example of the present invention, which breaks down the execution actions, execution times, and triggering conditions of each module in the first and second halves of the driving cycle.
[0034] Figure 6 This is a block diagram of the adaptive filtering control principle in a specific application example of the present invention, showing the connection relationships of the driving signal d(n), reference signal D(n), input signal x(n), output signal y(n), error signal e(n), digital filter, and control channel, as well as the weight vector iteration process. Detailed Implementation
[0035] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0036] The mid-infrared laser spectral absorption detection filtering control method for natural gas detection of this invention adopts the following hardware architecture in specific applications: a time-division driving module, an optical / electrical signal conversion module, an adaptive filtering module, a concentration inversion module, and a system calibration module. Each module achieves linkage through hardware triggering and software interrupts, and data interaction adopts DMA to avoid excessive CPU usage. This invention is based on the mid-infrared laser spectral absorption principle, Beer-Lambert law, and the x-least mean square (FxLMS) adaptive filtering principle. The core principles are band separation, timing matching, algorithm simplification, and end-to-end optimization.
[0037] like Figures 1-6 As shown, the mid-infrared laser spectral absorption detection filtering control method for natural gas detection according to the present invention includes: Step S1: Time-division driving signal for laser is generated; In a specific application example, the present invention uses a digital-to-analog converter (DAC) with a bit width ≥ 16 bits to output square wave drive signal and sawtooth wave scanning signal in a time-division manner to drive the mid-infrared interband cascaded laser (ICL) to work. The driving signal period is divided into a first half period and a second half period. The driving signal frequency and the ADC sampling frequency satisfy an integer multiple relationship (e.g., ADC sampling frequency = 10 × driving signal frequency) to avoid sampling aliasing. In specific application examples, the following conditions can be met according to actual needs: Square wave drive signal: amplitude 4-6V, frequency 500Hz-2kHz, fixed laser drive current 100-300mA, precisely lock the wavelength of the mid-infrared interband cascaded laser at 3343nm, wavelength fluctuation error ≤±0.01nm; perform wavelength calibration using a wavelength meter, adjust the square wave amplitude so that the wavelength of the mid-infrared interband cascaded laser falls at 3343nm, record the calibrated square wave amplitude as a fixed value, and keep it unchanged in subsequent tests; Sawtooth wave scanning signal: amplitude 0-6V, scanning rate 10-50nm / ms, controlling the output wavelength of the mid-infrared interband cascaded laser to linearly scan within the range of 3343nm-3347nm, accurately covering the characteristic absorption spectra of methane (3344.6nm) and ethane (3345.8nm); Scenario-specific parameter values: 1kHz is the preferred frequency for urban natural gas pipeline network inspection, 2kHz is the preferred frequency for online monitoring of gas stations, and 500Hz is the preferred frequency for tracing natural gas leaks.
[0038] Step S2: Optical signal acquisition and electrical signal conversion; The light signal output from the mid-infrared interband cascaded laser is fed into the gas detection absorption cell. After selective absorption by the gas in the gas detection absorption cell, the light intensity signal is collected by a photodetector. The photocurrent signal output by the photodetector is sequentially processed by I / V conversion, signal amplification, and DC blocking filtering. It is then collected into a digital electrical signal by an analog-to-digital converter (ADC) with a bit width of ≥24 bits. The ADC acquisition and DAC drive signal are synchronously triggered by hardware, and the acquisition delay is ≤1μs.
[0039] In specific application examples, the following conditions can be met according to actual needs: The photodetector has a response band of 2-5μm and a responsivity of ≥0.5A / W; the I / V converter has a feedback resistance of 10-100MΩ and a bandwidth of ≥1MHz; the amplifier has a gain of 10-100 times; and the ADC has a sampling frequency of 5-20kHz.
[0040] Preprocessing is performed, namely: after the electrical signal is converted, DC blocking and first-order RC low-pass filtering are performed. The DC blocking capacitor is 0.1-1μF and the low-pass filter cutoff frequency is ≥5kHz to avoid introducing new noise in the preprocessing stage.
[0041] When the signal is output, two digital detection signals are obtained. The first half of the cycle is a pure noise reference signal containing only background noise, and the second half of the cycle is the effective signal to be measured containing the absorption peak signal of the characteristic gas of the combustion gas and background noise.
[0042] Step S3: Adaptive filtering control based on optimized FxLMS algorithm; An adaptive digital filter based on the filtering x-minimum mean square algorithm (FxLMS) is constructed, which adopts the strategy of iterative convergence of the weight vector in the first half of the cycle and filtering with a fixed weight vector in the second half of the cycle to achieve adaptive filtering of background noise. In specific application examples, the core parameters of the above-mentioned filtering x-minimum mean square algorithm (FxLMS) are selected according to the principle of small step size to ensure stability and large step size to improve convergence speed. For gas detection scenarios, the 32nd order is preferred (taking into account both filtering effect and computational load). In a specific application example, the specific process of step S3 above may include: Step S301: Define the reference signal and input signal; Let the square wave driving signal of the first half-cycle be d(n), and the output after passing through the DC gain K of the system be the reference signal D(n) = K × d(n); let the pure noise detection signal of the first half-cycle be the input signal x(n). Before the input signal enters the filter, an amplitude limiting filter is added to remove abnormal noise with an amplitude exceeding ±3σ, where σ is the noise standard deviation of the first N sampling cycles, N ≥ 100, in order to avoid sudden strong noise causing the filter to diverge; Step S302: Calculate the filter output; Let the weight coefficients of the digital filter be wk, where k = 1, 2, ..., K, and K is the filter order, ranging from 16 to 64. The filter output signal y(n) is the discrete-time convolution of the input sequence and the weight coefficient sequence, i.e.: y(n)=∑k=0K-1wk(n)x(n-k); Step S303: The weight vector iteration converges; The filter weight vector is initialized with a zero vector, i.e., wk(0)=0; Calculate the error signal e(n) = D(n) - y(n), and use the mean square value of the error signal as the performance function J(n) = E[|e(n)|2]. Based on the steepest descent method, adjust the weight vector along the negative gradient direction of the performance function with respect to the weight coefficients, and use the instantaneous estimate of the gradient instead of the average estimate. The weight vector adjustment formula is as follows: wk(n+1)=wk(n)+2μe(n)x(n-k) The step size factor μ ranges from 0.001 to 0.05, with 0.01 being the preferred value for the gas detection scenario. The iteration stopping condition is when the mean square value of the error signal e(n) is ≤10. -6 When V², stop the weight vector iteration and determine that the filter has converged. The convergence time is ≤0.2ms. Step S304: Fixed weight vector filtering; In the second half of the cycle, the filter weight vector is kept fixed, and the effective signal to be measured is input to the converged adaptive filter to complete the adaptive filtering of background noise; the output contains only the pure effective signal of the characteristic gas absorption peak of the gas combustion, without any effective signal misfiltering.
[0043] Step S4: Temperature and pressure compensated concentration inversion calculation; The filtered, clean, and effective signal is subjected to baseline fitting, absorbance calculation, and temperature and pressure compensated concentration inversion to eliminate the effects of light intensity baseline drift and environmental temperature and pressure changes, and to accurately invert the concentration values of methane and ethane in natural gas. In a specific application example, step S4 above includes: Baseline fitting: A third-order polynomial was used for fitting, with the fitting window covering the entire band of the sawtooth wave scan (3343-3347nm). The number of fitting points was ≥100, and the fitting error was ≤±0.001V. The fitted baseline light intensity I0 was obtained.
[0044] Absorbance calculation: Calculate absorbance according to the formula A=ln(II0) (I is the actual detected light intensity). Extract the maximum value of the absorbance curve as the absorption peak value Amax. The half width at half maximum (WHM) of the absorption peak must meet the following requirements: 0.02-0.04 nm for methane and 0.03-0.05 nm for ethane.
[0045] Temperature and pressure compensated concentration inversion: Concentration is calculated based on a gas detection formula derived from Lambert-Beer's law. The formula is as follows: C = ε × L × P × T0 × Amax / (P0 × T) Where ε is the gas molar absorption coefficient (methane 1.2×10³L / (mol)). cm), ethane 0.9×10³L / (mol) L is the optical path length of the absorption cell (cm), P is the ambient pressure (kPa), P0 is the standard atmospheric pressure (101.325kPa), T is the ambient temperature (K), and T0 is the standard temperature (298K).
[0046] Post-processing of results: The concentration inversion results are post-processed using a moving average filter with an average window of 5-10 detection cycles to eliminate the influence of random noise on the final results; furthermore, a result validity judgment is added. If the half-width at half-maximum of the absorption peak exceeds the normal range, the detection result is deemed invalid and the detection is repeated.
[0047] First, it should be clarified that temperature-pressure coupling noise does not refer to the sound waves generated by temperature and pressure themselves, but rather to the rapid, random fluctuations in temperature and pressure that cause baseline jitter and absorption peak distortion in the spectral signal, thus introducing dynamic errors in concentration readings. This invention selects a baseline region outside the main absorption peak. When calibrated with pure nitrogen or zero gas, the signal in this region should be constant at zero. If fluctuations are detected in this region, it is entirely caused by temperature-pressure interference. This invention can directly use the signal in this region as the error signal for the FxLMS algorithm to train the filter. Then, using the trained filter, spectral distortion can be predicted from the interference characteristics. The detailed process includes: In the above process, a reference signal D(n) = K × d(n) was obtained. Using a laser or detector channel of another band, which has no absorption of methane but is equally sensitive to changes in temperature, pressure and vibration throughout the optical path, a reference signal was obtained to construct X(n). Training the filter in the "baseline region": In the acquired full spectrum, a wavelength range is defined that is far from the methane absorption line, called the "baseline region," which serves as the non-absorption region. In the baseline region, the theoretical absorbance of the pure spectrum is zero. A virtual expectation signal is defined: dimeal=0. In this way, the actual measured baseline region signal is exactly equal to the error. Using the reference signal acquired at the same time and this baseline region error, the adaptive digital filter of the x-Least Mean Square (FxLMS) filtering algorithm is driven. The filter will converge quickly to predict the jitter of the spectral baseline. After training, the filter is fixed, and the main signal of the entire spectrum is input into the system. The filter uses the reference signal to generate an interference estimate for the entire spectrum. The interference estimate is subtracted from the main signal of the entire spectrum and then output by the system. At this time, it is the pure absorbance light after adaptive temperature and pressure compensation.
[0048] The purified absorbance spectrum obtained after compensation is used for accurate concentration inversion through temperature and pressure compensation. This temperature and pressure compensation addresses slow, average temperature and pressure effects, while rapid dynamic fluctuations have been eliminated by the adaptive filter. This significantly improves accuracy and robustness when dealing with complex field conditions. The process of eliminating baseline drift using absorbance calculation includes: Calibration: High-purity nitrogen gas (zero gas) is introduced. At this time, the methane concentration is 0, all absorption peaks disappear, and the main detector signal is completely the sum of interference signals. The drift reference signal is then collected. Training: The adaptive digital filter of the filtering x-Least Mean Square (FxLMS) algorithm is trained using the drift reference signal to predict the drift of the light intensity baseline; Detection: When the natural gas to be tested is introduced, the methane absorption peak appears, the filter coefficients are frozen or updated very slowly, and only the trained adaptive digital filter is used to generate the interference estimation signal; Output: The system outputs a pure absorbance spectrum stripped of baseline drift. Using this pure spectrum for subsequent concentration inversion significantly improves detection accuracy. Furthermore, in practical operation, the baseline residual region outside the absorption peak can be selected to monitor whether residual drift still exists. If it exceeds a threshold, the adaptive digital filter is fine-tuned online with extremely small steps to achieve long-term stability.
[0049] As a preferred embodiment, the aforementioned "temperature-pressure coupling noise" and "light intensity baseline drift" are further considered as two types of interference that need to be identified and canceled using different reference signals. The system architecture of this invention can be extended from a single reference signal to a multi-reference signal adaptive noise canceller. Each adaptive filter is independently responsible for tracking and canceling a specific type of interference, and is designed using a phased training and joint online fine-tuning matching strategy. After the first two layers of adaptive filtering, the signal fed into the third layer is already a "clean and stable" spectrum. At this point, performing conventional temperature-pressure compensation concentration inversion yields the best results.
[0050] As a preferred embodiment, the present invention can further construct a multi-input FxLMS architecture, the process of which includes: Constructing multi-dimensional reference signals; Reference signal 1: Light intensity drift It originates from the splitting ratio reference channel, the intensity at non-absorption wavelength points, or the DC component of the modulation signal. It primarily carries information about light source power fluctuations and detector drift.
[0051] Reference signal 2: Temperature and pressure disturbance ; from highly sensitive, fast-response temperature / pressure sensors, or spectral features that are sensitive to temperature and pressure but not to concentration (such as the slope of a baseline). Based on the above-mentioned adaptive digital filter using the x-least mean square (FxLMS) filtering algorithm, a multi-channel FxLMS filter bank is constructed:
[0052] Among them, two filters , The weight coefficients are updated independently via LMS-like rules.
[0053] Fusion Training: Zero Gas Phase (No Target Gas): Detector Signal It consists entirely of interference. At this point, two filters are allowed to learn together: one captures slow baseline fluctuations, and the other learns the rapid jitter caused by temperature and pressure.
[0054] Measurement phase: With fixed filter coefficients, parallel operation is performed to simultaneously remove two types of interference from the measured signal, outputting a "clean" spectrum. .
[0055] The above design allows for the modular addition or removal of reference channels, offering excellent real-time performance and making it particularly suitable for handling dynamic interference. The key lies in the "cooperative filtering" framework for multiple reference signals.
[0056] As can be seen from the above, by adopting the above-described scheme of this invention, FxLMS does not directly process concentration data, but is used to optimize the spectral acquisition process. In photoacoustic spectroscopy or modulation spectroscopy, the FxLMS algorithm is used to pre-filter the modulation signal or to perform consistency calibration on the array signal of a multi-channel detector. After FxLMS front-end processing, the obtained result is usually a "clean" absorbance spectrum or second harmonic signal. Based on this, the system will follow up with a temperature and pressure compensation algorithm (such as using the ideal gas law to convert the number density, or using the spectral line shape for temperature correction) to calculate the final concentration. That is, the core FxLMS in this invention is responsible for solving "dynamic noise," which is different from the principle of traditional algorithms that are responsible for solving "static deviation," and can also greatly improve the applicability and detection accuracy of the system of this invention. Moreover, in this process, the technical solution based on FxLMS of this invention adopts an "online training" mode. In the zero gas calibration stage, nitrogen gas is introduced. At this time, the detector signal only contains interference. The FxLMS filter is trained using this data so that it "learns" the interference characteristics. In the measurement stage, the filter coefficients are fixed, the signal containing methane is filtered, the pure spectrum is output, and then the concentration is calculated.
[0057] In a specific application example, the present invention further includes step S5: system calibration and periodic calibration; this is to ensure detection accuracy. The system needs to complete full parameter calibration before first use, and needs to be calibrated periodically according to the criteria during actual use. The calibration and calibration results are stored locally in the system as the benchmark parameters for detection. This step includes: Step S501: System calibration; The calibration is performed in a pure nitrogen atmosphere and includes one or more of the following calibration procedures: Noise extraction and calibration: Acquire the noise signal of the first half cycle, calibrate the reference value of the system background noise, and determine the σ value of the amplitude limiting filter; Transfer function K calibration: Input square wave signals of different amplitudes, collect the corresponding output signals, and obtain the system DC gain K through linear fitting; Concentration calibration: Using standard methane / ethane gas of known concentration, the gas is introduced into the absorption cell, the absorption peak value is collected, and a calibration curve of absorption peak value-concentration is established to correct the error of the concentration inversion formula. Temperature and pressure compensation calibration: The absorption peak values of standard gases are collected under different temperature and pressure conditions, and the correction coefficient of the temperature and pressure compensation factor is calibrated.
[0058] Step S502: Periodic calibration criteria; Specifically, it may include one or more of the following calibration operations: Routine calibration: Preset periodic calibration, such as full parameter calibration every 1000 working hours or every 3 months; Emergency calibration: If the testing environment undergoes drastic changes (such as temperature change ≥10℃, pressure change ≥10kPa), or if the equipment has been involved in a collision or repair, on-site calibration must be performed immediately. Calibration method: Same as the initial system calibration method; update system reference parameters after calibration.
[0059] In the above method of the present invention, it should be particularly noted that: Mid-infrared spectral absorption adaptation principle: Methane has a strong fundamental absorption peak at 3344.6 nm and ethane at 3345.8 nm, with molar absorption coefficients of 1.2 × 10³ L / (mol) respectively. cm), 0.9×10³L / (mol) The mid-infrared band has a signal-to-noise ratio that is inherently better than that of the near-infrared band, with the absorption peaks of the mid-infrared band being much higher than those of the near-infrared band. The mid-infrared band is an absolutely non-absorption band for methane, ethane, and water vapor. No characteristic gas of the combustion gas absorbs the light signal at this wavelength, so it can be used as an independent background noise extraction band to achieve physical separation of noise from the effective absorption signal.
[0060] Lambert-Beer Law Gas Detection Adaptation Principle: The basic formula of Lambert-Beer Law is A=ε×C×L, where A is absorbance, ε is the gas molar absorptivity, C is the gas concentration, and L is the optical path length. For the on-site environment of gas detection, a temperature and pressure compensation factor is introduced, deriving a gas detection-specific formula C=ε×L×P×T0×Amax / (P0×T), eliminating the influence of environmental pressure and temperature changes on concentration inversion. Here, P is the detection environment pressure (kPa), P0 is the standard atmospheric pressure (101.325kPa), T is the detection environment temperature (K), T0 is the standard temperature (298K), and Amax is the peak value of the absorbance curve.
[0061] The timing matching principle of the FxLMS algorithm and time-division driving: The convergence time of the weight vector iteration of the FxLMS algorithm is precisely matched with the square wave period of the DAC time-division driving. Let the square wave period be T, the convergence time of the algorithm satisfies convergence (μ is the step size factor, λmax is the maximum eigenvalue of the autocorrelation matrix of the input signal), ensuring that the filter weight vector is fully converged in the square wave driving stage of the first half of the cycle, so that the filter reaches the best filtering state for the current background noise and avoids filtering failure due to insufficient convergence.
[0062] The mathematical principle of transfer function simplification: The square wave driving signal is a fixed DC signal, and the optical / electrical conversion link of laser-absorption cell-detector-I / V conversion is a linear time-invariant system. According to the characteristics of linear systems, the output of a DC signal through a linear time-invariant system is still a DC signal. Therefore, the theoretical transfer function can be simplified to a constant K (system DC gain), K=VinVout (Vin is the square wave input voltage, and Vout is the output voltage acquired by the ADC). This can be measured through calibration experiments, which greatly reduces the computational complexity of the FxLMS algorithm and enables real-time engineering applications.
[0063] Background noise classification and suppression principle: Background noise in gas detection scenarios is divided into low-frequency, slowly varying external environmental noise (50-200Hz), random narrowband optical path system noise, and wideband white noise circuit system noise. Through multi-order weight vector adjustment of the FxLMS adaptive filtering algorithm, noise with different characteristics can be suppressed in a targeted manner, with a noise suppression rate of ≥95%, while avoiding false filtering of effective absorption peak signals.
[0064] The following is a detailed description of the specific implementation of the present invention using a real-world application case: micro-leakage detection of buried PE pipes in urban natural gas pipelines (leakage ≤ 0.1 m³ / h). This embodiment is only used to explain the present invention and is not intended to limit the scope of protection of the present invention.
[0065] Implementation Scenario Overview: Urban buried PE natural gas pipelines are prone to micro-leakage due to geological subsidence and construction damage. External noise sources around the leak point include low-frequency traffic vibration and power frequency electromagnetic interference. Portable detection equipment also generates internal noise through its optical path (fiber optic transmission loss) and circuitry (power supply noise). Furthermore, the on-site temperature and pressure change in real time, making it difficult for traditional detection technologies to achieve high-precision detection of micro-leakages in this scenario. This invention is applied to this scenario, employing a portable mid-infrared laser spectroscopy detection device to achieve high-precision real-time detection of methane and ethane at micro-leakage points in buried PE pipelines.
[0066] Hardware System Setup: This embodiment adopts a portable device architecture, with each module meeting the requirements of low power consumption and miniaturization. Specific hardware configuration: Light source module: Mid-infrared interband cascaded laser (ICL), center wavelength 3345nm, wavelength tuning range 3340-3350nm, output power 10mW, drive current 100-300mA; Signal generation module: 16-bit high-precision DAC (model AD5760), outputting a time-division drive signal with a frequency of 1kHz, a square wave amplitude of 5V, and a sawtooth wave amplitude of 0-5V; Optical detection module: Mid-infrared photodetector (model InAsSb), response band 2-5μm, responsivity 0.6A / W; paired with low-noise I / V converter (model OPA847, feedback resistor 50MΩ) and gain-adjustable amplifier (gain 50 times). Signal acquisition module: 24-bit high-precision ADC (model ADS1256), sampling frequency 10kHz, hardware-synchronized triggering with DAC, acquisition delay ≤1μs; Data processing module: Embedded microprocessor (model STM32H743) to realize real-time operation of FxLMS algorithm, concentration inversion calculation, and result output; data interaction adopts DMA method. Optical path module: A folded multi-pass cell with an effective optical path of 10m is used as the absorption cell, which is equipped with a collimating lens and a focusing lens. The laser is transmitted using polarization-maintaining fiber, with an optical path loss of ≤5%. The absorption cell has a sealed structure. Auxiliary modules: temperature and pressure sensor (accuracy ±0.1℃, ±0.5kPa), isolated power supply (output 5V / 3A), audible and visual alarm module, local storage module.
[0067] Software Algorithm Implementation: The software algorithm adopts the method described above in this invention, developed based on STM32CubeIDE, and written in C language. It consists of five major modules: drive signal generation, signal acquisition, FxLMS filtering, concentration inversion, and calibration. Specific implementation details are as follows: Time-division drive signal generation: Write a DAC driver program to generate a 1kHz time-division drive signal. The first half cycle (0-0.5ms) outputs a 5V square wave, and the second half cycle (0.5-1ms) outputs a 0-5V linear sawtooth wave. After the wavelength meter is calibrated, it is locked at 3343nm. FxLMS Algorithm Porting: Implement the optimized FxLMS algorithm, setting the filter order K=32, step size factor μ=0.01, zero vector initialization, and the amplitude limiting filter σ value to the noise standard deviation of the first 200 sampling periods. The iteration stopping condition is e(n) mean square value ≤ 10. -6 V²; Signal processing and concentration inversion: A third-order polynomial baseline fitting program (128 fitting points), an absorbance calculation program, and a temperature and pressure compensated concentration inversion program were developed. The moving average window was set to 8 detection periods, and the half-width at half-maximum (WHM) range of the absorption peaks was 0.02-0.04 nm for methane and 0.03-0.05 nm for ethane. Calibration and calibration program: Write a program for acquiring, fitting, and storing calibration and calibration parameters, supporting parameter input and updating for initial calibration and periodic calibration, and real-time retrieval of calibration curves; Anti-interference program: Added amplitude limiting filter, abnormal signal rejection, and result validity judgment program; abnormal signals automatically trigger re-detection.
[0068] The specific process includes: Initial system calibration; full parameter calibration was completed under a pure nitrogen atmosphere, specifically including: Noise extraction calibration: Acquire the first half-cycle noise signal of the first 200 cycles, calculate σ=0.002V, and set the amplitude limiting filter threshold ±0.006V; Transfer function K calibration: Input 4V, 5V, and 6V square wave signals, acquire the corresponding output voltages of 0.8V, 1.0V, and 1.2V, and obtain K=0.2 through linear fitting; Concentration calibration: Introduce 10×10 -6 50×10 -6 100×10 -6 For methane / ethane standard gases, the absorption peak values are collected, a calibration curve is established, and the concentration inversion formula error is corrected to ≤±0.5%; Temperature and pressure compensation calibration: The absorption peak values of the standard gases are collected in the range of 0-40℃ and 80-120kPa, and the temperature and pressure compensation factor correction coefficient is calibrated.
[0069] The testing implementation specifically includes: Equipment deployment: The laser emitter and receiver of the portable detection equipment are respectively placed on both sides of the buried PE pipeline. The laser beam passes through the gaps in the soil above the pipeline and enters the sealed multi-channel absorption pool. The absorption pool collects the leaked gas in the pipeline. The temperature and pressure sensor is turned on to collect the on-site temperature and pressure data in real time.
[0070] Drive and Acquisition: The DAC outputs a 1kHz time-division drive signal to drive the ICL laser; the detector acquires the optical signal and converts it into photocurrent, which is then converted into a digital signal by the ADC at a frequency of 10kHz after I / V conversion, amplification, and DC blocking filtering, and then transmitted to the data processing module.
[0071] Adaptive filtering: The data processing module inputs the pure noise signal of the first half cycle into the FxLMS adaptive filter after amplitude limiting filtering, and completes the weight vector iterative convergence (convergence time 0.15ms); the effective signal containing methane and ethane absorption peaks in the second half cycle is input into the filter to filter out background noise and output a pure effective signal.
[0072] Concentration inversion and post-processing: A third-order polynomial baseline was fitted to the pure and effective signal to calculate the peak value of the absorbance curve; combined with real-time data from the temperature and pressure sensor, the concentration values of methane and ethane were calculated using a temperature and pressure compensated concentration inversion formula; after 8 periods of moving average, the validity of the results was determined.
[0073] Results output and warnings: If the results are valid, the detection data (concentration, temperature, pressure, time, location) is stored locally and displayed; if the methane volume fraction is ≥0.1%, an audible and visual warning is immediately triggered to indicate a micro-leak in the pipeline; if the results are invalid, a re-detection is automatically triggered.
[0074] In this real-world application scenario of detecting micro-leakage in urban buried PE pipeline networks, the implementation effect achieved by this invention is as follows: Noise suppression effect: The suppression rate of superimposed noise from the environment / optical path / circuit is ≥98%, the signal-to-noise ratio is improved by more than 25dB, and there is no false filtering of effective absorption peak signals; Detection accuracy: The lower limit of methane detection reaches 5×10 -9 (Volume fraction), the detection limit for ethane reaches 1×10⁻⁶. -8 (Volume fraction), concentration inversion error ≤ ±1.5%; Real-time performance: The single detection cycle is 1ms, and the concentration inversion calculation time is ≤0.4ms, which meets the real-time requirements of pipeline inspection. Stability: Under noise fluctuations (traffic noise intensity changes ±50%) and temperature and pressure changes (10-35℃, 90-110kPa), the concentration inversion results showed no significant drift, with fluctuation range ≤ ±0.8%; Engineering adaptability: The portable device has a power consumption of ≤5W and a continuous working time of ≥8 hours, which can meet the on-site requirements of outdoor pipeline inspection.
[0075] In summary, compared with existing infrared laser spectral absorption technology for gas detection, the present invention has the following technical advantages: Significantly improved detection accuracy and lower limit: Pure background noise extraction is achieved through an independent non-absorption band at 3343nm. Combined with an optimized FxLMS adaptive filtering algorithm, the noise suppression rate is ≥95%, avoiding false filtering of effective absorption peak signals. By introducing temperature and pressure compensation factors and optimizing the entire signal processing chain, the detection lower limit for methane and ethane reaches the trace level, with a concentration inversion error of ≤±2%. This solves the core problems of limited accuracy and result drift in traditional technologies, enabling high-precision detection of micro-leaks in natural gas.
[0076] Strong filtering adaptability and system robustness: The filtering parameters can be automatically adjusted according to the real-time changes in background noise, and have a good suppression effect on noise with different characteristics such as low-frequency slow change, random narrow band, and wideband white noise; The multi-dimensional anti-interference design of hardware and software enables the system to remain stable in complex gas detection sites such as traffic noise, electromagnetic interference, and temperature and pressure changes, and adapts to various outdoor and industrial scenarios.
[0077] It boasts strong real-time performance and is easy to implement in engineering: the system transfer function is simplified to a constant K, which greatly reduces the computational complexity of the FxLMS algorithm and can run in real time in embedded microprocessors; the iterative filtering strategy with timing matching makes the single detection period ≤1ms, which meets the requirements of real-time detection on site; at the same time, the present invention further designs a miniaturized and low-power hardware architecture that is compatible with various device forms such as portable and fixed devices.
[0078] High adaptability and practicality across all scenarios: A clear set of scenario-based parameter values has been developed, requiring only the adjustment of 3 core parameters to adapt to different scenarios such as urban natural gas pipeline inspection, online monitoring of gas stations, and natural gas leak tracing; The full-process system calibration and periodic calibration guidelines ensure that the equipment maintains high accuracy during long-term use, and on-site calibration can be completed without professional personnel, meeting the actual engineering requirements of industrial testing.
[0079] High scalability: The time-sharing driving mechanism, adaptive filtering strategy, and temperature and pressure compensation model of this invention can be directly extended to the detection of other characteristic gases such as propane and butane in natural gas. Only by adjusting the fixed noise extraction wavelength, scanning wavelength range, and gas molar absorption coefficient of the laser, high-precision detection of multi-component gas can be achieved, providing a solution for the upgrading of gas detection technology.
[0080] The above are merely preferred embodiments 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 be considered within the scope of protection of the present invention.
Claims
1. A mid-infrared laser spectral absorption detection and filtering control method for natural gas detection, characterized in that, include: Step S1: Time-division driving signal for laser is generated; A digital-to-analog converter (DAC) is used to output a square wave drive signal and a sawtooth wave scanning signal in a time-division manner to drive the mid-infrared interband cascaded laser (ICL). The drive signal period is divided into a first half period and a second half period, and the drive signal frequency and the ADC sampling frequency satisfy an integer multiple relationship. Step S2: Optical signal acquisition and electrical signal conversion; The light signal output by the mid-infrared interband cascaded laser is fed into the gas detection absorption cell, and after absorption, the light intensity signal is collected by a photodetector. Step S3: Adaptive filtering control based on optimized FxLMS algorithm; construct an adaptive digital filter based on the filtering x-minimum mean square algorithm FxLMS, and adopt a strategy of iterative convergence of weight vector in the first half-cycle and fixed weight vector filtering in the second half-cycle to complete the adaptive filtering of background noise. Step S4: Temperature and pressure compensated concentration inversion calculation; perform baseline fitting, absorbance calculation, and temperature and pressure compensated concentration inversion on the filtered pure effective signal to obtain the concentration values of methane and ethane in natural gas; Step S3 includes: Step S301: Define the reference signal and input signal; Let the square wave driving signal of the first half cycle be d(n), and the output after the DC gain K of the system be the reference signal D(n) = K × d(n); let the pure noise detection signal of the first half cycle be the input signal x(n). Before the input signal enters the filter, an amplitude limiting filter is added to remove abnormal noise with an amplitude exceeding ±3σ, where σ is the noise standard deviation of the first N sampling cycles, and N ≥ 100. Step S302: Calculate the filter output; Let the weight coefficients of the digital filter be wk, where k = 1, 2, ..., K, and K is the filter order, which takes values from 16 to 64. The filter output signal y(n) is the discrete-time convolution of the input sequence and the weight coefficient sequence. Step S303: Weight vector iterative convergence; the filter weight vector is initialized with a zero vector, i.e., wk(0)=0; the weight vector is adjusted along the negative gradient direction of the performance function with respect to the weight coefficients based on the steepest descent method, and the instantaneous estimation of the gradient is used instead of the average estimation. Step S304: Fixed weight vector filtering; the filter weight vector is kept fixed in the second half of the cycle, and the effective signal to be measured is input to the converged adaptive filter to complete the adaptive filtering of background noise; the output contains only the pure effective signal of the characteristic gas absorption peak of the gas combustion. Step S4 includes: Baseline fitting: A third-order polynomial was used for fitting, with the fitting window covering the entire band of the sawtooth wave scan. The number of fitting points was ≥100, and the fitting error was ≤±0.001V. The fitted baseline light intensity was obtained. Absorbance calculation: The maximum value extracted from the absorbance curve is the absorption peak value Amax, and the half width at half maximum (WHM) of the absorption peak satisfies 0.02-0.04 nm for methane and 0.03-0.05 nm for ethane; Temperature and pressure compensated concentration inversion: Concentration calculation based on the gas detection formula of Lambert-Beer's law; Post-processing of results: Moving average filtering is used to post-process the concentration inversion results; a result validity judgment is added: if the half-width at half-maximum of the absorption peak exceeds the normal range, the detection result is deemed invalid and the detection is repeated. The temperature and pressure compensated concentration inversion process includes: Obtain a reference signal D(n) = K × d(n), and use a laser or detector channel in another band that has no absorption of methane but is equally sensitive to changes in temperature, pressure, and vibration throughout the optical path to obtain the reference signal to construct X(n). Training the filter in the "baseline region": In the acquired full spectrum, a wavelength range is defined that is far from the methane absorption line, called the "baseline region," which serves as the non-absorption region. In the baseline region, the theoretical absorbance of the pure spectrum is zero, and a virtual expected signal is defined. Using the reference signal acquired at the same time and the error in this baseline region, an adaptive filter based on the optimized FxLMS algorithm is driven to achieve fast convergence and predict the jitter of the spectral baseline. After training, the adaptive filter is fixed, and the main signal of the entire spectrum is input into the system. The adaptive filter uses the reference signal to generate an interference estimate for the entire spectrum. The interference estimate is subtracted from the main signal of the entire spectrum and then output by the system. At this time, it is the pure absorbance light after adaptive temperature and pressure compensation.
2. The mid-infrared laser spectral absorption detection and filtering control method for natural gas detection according to claim 1, characterized in that, In step S4, the process of eliminating light intensity baseline drift using absorbance calculation includes: Calibration: Introduce high-purity nitrogen or zero gas. At this time, the methane concentration is 0, all absorption peaks disappear, and the main detector signal is completely the sum of interference signals. Acquire the drift reference signal. Training: An adaptive filter based on the optimized FxLMS algorithm is trained using the drift reference signal to predict the drift of the light intensity baseline; Detection: When the natural gas to be tested is introduced, the methane absorption peak appears, the filter coefficients are frozen or updated very slowly, and only the trained adaptive digital filter is used to generate the interference estimation signal; Output: The system outputs a pure absorbance spectrum stripped of baseline drift, which is then used for subsequent concentration inversion.
3. The mid-infrared laser spectral absorption detection and filtering control method for natural gas detection according to claim 2, characterized in that, In step S4, the multi-input FxLMS architecture is constructed, and the process includes: Constructing multi-dimensional reference signals; Reference signal 1: Light intensity drift It originates from the splitting ratio reference channel, the intensity at non-absorption wavelength points, or the DC component of the modulation signal; it carries information about light source power fluctuations and detector drift. Reference signal 2: Temperature and pressure disturbance ; derived from highly sensitive, fast-response temperature / pressure sensors, or spectral features that are sensitive to temperature and pressure but not to concentration; An adaptive filter based on an optimized FxLMS algorithm is constructed, resulting in a multi-channel FxLMS filter bank. Among them, two filters , The weight coefficients are updated independently through the rules of FxLMS; Fusion Training: Zero Gas Phase: Detector Signal It consists entirely of interference; two filters learn together, one capturing slow baseline fluctuations and the other learning rapid jitter caused by temperature and pressure. Measurement phase: With fixed filter coefficients, parallel operation is performed to simultaneously remove two types of interference from the measured signal, outputting a clean spectrum. .
4. The mid-infrared laser spectral absorption detection and filtering control method for natural gas detection according to any one of claims 1-3, characterized in that, In step S3, the values in the filter-based x-minimum mean square algorithm FxLMS are selected according to the criterion of small step size to ensure stability and large step size to improve convergence speed. The gas detection scenario is of order 32.
5. The mid-infrared laser spectral absorption detection and filtering control method for natural gas detection according to any one of claims 1-3, characterized in that, It also includes step S5: system calibration and periodic calibration; complete full parameter calibration before first use, and perform periodic calibration during actual use. The calibration and calibration results are stored locally in the system as the reference parameters for testing.
6. The mid-infrared laser spectral absorption detection and filtering control method for natural gas detection according to claim 5, characterized in that, Step S5 includes system calibration; it is performed in a pure nitrogen environment and includes one or more of the following calibration operations: Noise extraction and calibration: Acquire the noise signal of the first half cycle, calibrate the reference value of the system background noise, and determine the σ value of the amplitude limiting filter; Transfer function K calibration: Input square wave signals of different amplitudes, collect the corresponding output signals, and obtain the system DC gain K through linear fitting; Concentration calibration: Using standard methane / ethane gas of known concentration, the gas is introduced into the absorption cell, the absorption peak value is collected, and a calibration curve of absorption peak value-concentration is established to correct the error of the concentration inversion formula. Temperature and pressure compensation calibration: The absorption peak values of standard gases are collected under different temperature and pressure conditions, and the correction coefficient of the temperature and pressure compensation factor is calibrated.
7. The mid-infrared laser spectral absorption detection and filtering control method for natural gas detection according to any one of claims 1-3, characterized in that, The method also includes the following steps: building a hardware architecture; the hardware architecture includes a light source module, a signal generation module, a photoelectric signal conversion module, a signal acquisition module, a data processing module, a system calibration and calibration module, and auxiliary modules; wherein, the signal generation module generates a time-division driving signal to drive the light source module, the photoelectric signal conversion module completes the conversion and preprocessing of the optical signal to the electrical signal, the signal acquisition module converts the analog signal to the digital signal, the data processing module implements FxLMS adaptive filtering, temperature and pressure compensated concentration inversion, and result post-processing, the system calibration and calibration module completes the initial calibration and periodic calibration, and the auxiliary modules include a temperature and pressure sensor, an isolated power supply, and an audible and visual early warning module.