A method for online monitoring of gas analyzers based on nonlinear filtering algorithm
By using adaptive nonlinear filtering algorithm in the gas analyzer, the problem of difficult filtering and responding to rapid gas concentration changes in the prior art under strong interference environments is solved, real-time and stable of the analyzer are achieved, and online monitoring is met need.
Patent Information
- Application Number
- CN202210197055.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-03-01
Smart Images

Figure CN114577989B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of gas concentration online monitoring, and in particular to a method for realizing online monitoring of a gas analyzer based on a nonlinear filtering algorithm. Background Art
[0002] The original signal and the filtering result of the linear filter are an arithmetic operation, that is, it is realized by operations such as addition, subtraction, multiplication and division. The original signal and the filtering result of the nonlinear filter are a logical relationship, that is, it is realized by logical operations. In real life, the gas concentration detected by optical instruments is actually nonlinear. On the one hand, in the process of collecting data, the sensor will inevitably produce abnormal values due to various interferences, resulting in more noise introduced into the collected spectrum. It is necessary to use filtering algorithms to reduce the noise, but this will inevitably bring about a delay in response time; on the other hand, as the on-site working conditions change, the gas concentration will also change accordingly. At this time, the output results of the analyzer need to reflect the working conditions in a timely manner and speed up the response time. Therefore, it is necessary to provide a nonlinear filtering method that can effectively filter the collected spectral data under a strong interference environment, and at the same time follow up the rapid changes in gas concentration in a timely manner according to the on-site working conditions, without affecting the real-time output of the analyzer concentration.
[0003] At present, common filtering algorithms cannot perfectly balance stability and real-time performance, and many existing improved filtering algorithms are complex in calculation, high in cost, and not conducive to engineering implementation. Based on the above shortcomings, there is no satisfactory nonlinear filtering method for online monitoring of gas analyzers in the prior art. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method for online monitoring of a gas analyzer based on a nonlinear filtering algorithm, which can take into account both stability and real-time performance and meet the needs of online monitoring.
[0005] In order to solve the above technical problems, the present invention provides a method for realizing online monitoring of a gas analyzer based on a nonlinear filtering algorithm, comprising the following steps:
[0006] Step 1: pre-set the filter coefficient of the adaptive filtering algorithm, set the count value of the initial filter counter to 0, initialize the noise threshold value, and initialize the concentration change filter value;
[0007] Step 2: Perform real-time data sampling to obtain the concentration value of the analyzer at time t, and calculate the concentration change at time t;
[0008] Step 3, updating the count value of the filter counter;
[0009] Step 4, performing nonlinear filtering on the concentration change at time t and the concentration value at time t;
[0010] Step 5: Update the noise threshold.
[0011] Preferably, in step (2), the concentration change at time t is calculated using the least squares method, and the concentration data C is collected once per second. t , when the acquisition time exceeds n seconds, record
[0012] x=[1,2,…,n-1,n],
[0013] y=[C t-n+1 ,C t-n+2 ,…,C t-1 ,C t ],
[0014] Assume the equation of the fitted line is According to the least squares calculation principle, the slope is estimated
[0015]
[0016] Recorded as the concentration change at time t.
[0017] Preferably, in step (3), updating the count value of the filter counter specifically includes the following steps:
[0018] Step 3-1: Determine whether the concentration change at time t is greater than the noise threshold value. If so, the count value of the filter counter is increased by 1 on the original basis, otherwise go to step 3-2;
[0019] Step 3-2: Determine whether the count value of the filter counter is non-zero. If so, the count value of the filter counter is reduced by 1 based on the original value. Otherwise, the count value of the filter counter is cleared to 0.
[0020] Preferably, in step (4), nonlinear filtering is performed on the concentration change at time t and the concentration value at time t, specifically: determine whether the count value of the filter counter is zero, if so, perform first-order lag filtering, and the filter value at time t is equal to the weighted combination of the sampling value at time t and the filter value at time t-1; otherwise, no filtering is performed, and the filter value at time t is equal to the filter value at time t-1.
[0021] Preferably, in step (5), the noise threshold value is equal to a multiple of the concentration change filter value at time t-1.
[0022] The beneficial effects of the present invention are as follows: the present invention has a fast response time and can significantly suppress white noise and Gaussian noise. It is applied to the automatic monitoring of polluted gas concentration of a gas analyzer. When a step change occurs in the gas concentration, the filtering result can be followed up in time. When the gas concentration tends to be stable, the filtering result can quickly tend to be stable. It perfectly takes into account stability and real-time performance, and meets the needs of online monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the method flow of the present invention.
[0024] Figure 2 It is a schematic diagram for comparing concentration responses before and after nonlinear filtering of the present invention.
[0025] Figure 3 It is a schematic diagram comparing the concentration filtering effects before and after the nonlinear filtering of the present invention. DETAILED DESCRIPTION
[0026] As Figure 1 As shown, a method for realizing online monitoring of a gas analyzer based on a nonlinear filtering algorithm comprises the following steps:
[0027] Step 1: pre-set the filter coefficient of the adaptive filtering algorithm, set the count value of the initial filter counter to 0, initialize the noise threshold value, and initialize the concentration change filter value;
[0028] Step 2: Perform real-time data sampling to obtain the concentration value of the analyzer at time t, and calculate the concentration change at time t;
[0029] Step 3, updating the count value of the filter counter;
[0030] Step 4, performing nonlinear filtering on the concentration change at time t and the concentration value at time t;
[0031] Step 5: Update the noise threshold.
[0032] Example:
[0033] First, in step 1, the filter coefficients are set according to the actual situation of the data to be processed. The count value of the initial filter counter is 0, the initial noise threshold value is 0.8, and the initial concentration change filter value is 0.2. The above parameters are determined based on the response speed and filtering effect of the actual concentration data filtering process.
[0034] In step 2, concentration data C is collected once per second t When the acquisition time exceeds 11s, the concentration change at time t is calculated. If n is 11, the fitting slope is
[0035]
[0036] Recorded as the concentration change at time t Δ t .
[0037] In step 3, the concentration change at time t is compared with the noise threshold to update the filter counter. tIf the value is greater than the noise threshold, the count value of the filter counter is increased by 1 on the original basis. Otherwise, it is further determined whether the count value of the filter counter is non-zero. If so, the count value of the filter counter is reduced by 1 on the original basis. Otherwise, the count value of the filter counter is cleared.
[0038] In step 4, it is determined whether to perform filtering according to the count value of the filter counter obtained in step 3. It is determined whether the count value of the filter counter is zero. If so, first-order lag filtering is performed, and the filter value at time t is equal to the weighted combination of the sampling value at time t and the filter value at time t-1. Otherwise, no filtering is performed, and the filter value at time t is equal to the filter value at time t-1.
[0039] Finally, in step 5, the noise threshold value is updated in real time. In this implementation case, the multiple is 6, and the noise threshold value is equal to 6 times the filtered value of the concentration change at time t-1, which is used for the next count value update judgment of the filter counter.
[0040] Figure 2 and Figure 3 The waveform comparison diagram before and after the nonlinear filtering of this embodiment is shown. Figure 2 It can be seen that the algorithm responds quickly to concentration changes. When the concentration changes step by step, the filtering result can follow up in time. Figure 3 It can be seen that the filtering effect of the algorithm is significant. When the concentration tends to be stable, the filtering result can also tend to be stable, perfectly balancing stability and real-time performance, and meeting the needs of online monitoring.
Claims
1. A method for online monitoring of a gas analyzer based on a nonlinear filtering algorithm, characterized in that: The steps include: Step 1: pre-set the filter coefficient of the adaptive filtering algorithm, set the count value of the initial filter counter to 0, initialize the noise threshold value, and initialize the concentration change filter value; Step 2: Perform real-time data sampling to obtain the concentration value of the analyzer at time t and calculate the concentration change at time t; use the least squares method to calculate the concentration change at time t and collect concentration data C once per second. t , when the acquisition time exceeds n seconds, record x=[1,2,…,n-1,n], y=[C t-n+1 ,C t-n+2 ,…,C t-1 ,C t ], Assume the equation of the fitted line is According to the least squares calculation principle, the slope is estimated Recorded as the concentration change at time t; Step 3: Update the count value of the filter counter; specifically, the steps include: Step 3-1: Determine whether the concentration change at time t is greater than the noise threshold value. If so, the count value of the filter counter is increased by 1 on the original basis, otherwise go to step 3-2; Step 3-2: Determine whether the count value of the filter counter is non-zero. If so, the count value of the filter counter is reduced by 1 based on the original value. Otherwise, the count value of the filter counter is cleared to 0. Step 4, performing nonlinear filtering on the concentration change at time t and the concentration value at time t; Determine whether the count value of the filter counter is zero. If so, perform first-order lag filtering, and the filter value at time t is equal to the weighted combination of the sampling value at time t and the filter value at time t-1. Otherwise, do not perform filtering, and the filter value at time t is equal to the filter value at time t-1. Step 5: Update the noise threshold.
2. The method for realizing online monitoring of a gas analyzer based on a nonlinear filtering algorithm as claimed in claim 1, characterized in that: In step (5), the noise threshold value is equal to a multiple of the concentration change filter value at time t-1.
Citation Information
Patent Citations
Adaptive predistortion system and method based on hybrid indirect learning algorithm
CN103856429A
Method for achieving automatic navigation of vehicle based on self-adaptive filtering algorithm
CN104913783A