A continuous polynomial real-time filtering method based on five-point cubic smoothing method

By introducing the five-point cubic smoothing method and sliding window technology into polynomial filtering, the problem of the poor effect of the polynomial filtering algorithm in real-time filtering and the jump of the filter window junction point are solved, and the data smoothing processing and real-time filtering effect are improved. .

CN113114169BActive Publication Date: 2024-09-24NORTH CHINA ELECTRIC POWER UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110447102.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-25
Publication Date
2024-09-24
Estimated Expiration
2041-04-25

AI Technical Summary

Technical Problem

The existing polynomial filtering algorithm has poor performance in real-time online filtering and cannot effectively process real-time data. Moreover, the intersection point of the filter window is prone to jump phenomena, resulting in non-smooth data.

Method used

A continuous polynomial real-time filtering method based on the five-point cubic smoothing method is adopted. Through offline polynomial filtering and sliding window technology, the content of the filter window is dynamically adjusted to avoid the jump of the filter window junction point, and the polynomial parameters are optimized through the least squares method. Estimation, combined with phase lead and lag adjustment to improve filtering effect.

Benefits of technology

The effect of polynomial filtering method in real-time filtering is improved, smoothing of data is achieved, the application scope of polynomial filtering is broadened, and the effect of real-time filtering is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113114169B
    Figure CN113114169B
Patent Text Reader

Abstract

The present invention discloses a continuous polynomial real-time filtering method based on a five-point cubic smoothing method, comprising the following steps: A. Assuming x(t) is data collected by a sensor at time t, and w is the length of the filtering window, then x(t‑1) to x(t‑w) are data collected by sensors at w times from t‑1 to t‑w, and x(t‑1) to x(t‑w) are subjected to offline polynomial filtering; B. A continuous polynomial real-time filtering method based on a five-point cubic smoothing method is used to perform real-time online filtering on the data x(t); C. A new sliding window is constructed, and a continuous polynomial real-time filtering method based on a five-point cubic smoothing method is used to perform real-time online filtering on the data x(t+1). The present invention can improve the deficiencies of the prior art and improve the effect of the polynomial filtering method in real-time filtering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of data processing, in particular to a continuous polynomial real-time filtering method based on a five-point cubic smoothing method. Background Art

[0002] Data is an important driving force for the industrial production process to move from mechanization to digitization, from manual to automation, and from fuzziness to precision. In modern industrial production processes, the invention of various sensors and the application of data measurement or soft measurement technology have enabled operators to have more detailed supervision of various production processes on site, further promoting the realization and application of technologies such as automatic control, intelligent control, system identification, and digital twins, providing guarantees for the automation and intelligence of industrial production.

[0003] Due to the complexity and diversity of the on-site working environment, as well as the limitations of sensor technology and electronic circuit technology, errors and measurement noise will inevitably occur during the data measurement process, resulting in inaccurate data measurement results. These data mixed with errors or measurement noise cannot be directly applied to automatic control, system modeling and other processes.

[0004] Data filtering technology filters out noise or errors in measured data through hardware circuits or software algorithms, restores the true mode of the measured data as much as possible, and compensates for the limitations brought by the measurement environment, measurement equipment, etc. It is an important part of data preprocessing in actual production process automatic control and system modeling.

[0005] The existing polynomial filtering algorithm has the following disadvantages:

[0006] 1) Existing polynomial filtering algorithms are mostly used for offline filtering, that is, filtering the collected data, and lack application in real-time online filtering;

[0007] 2) According to the principle of polynomial filtering algorithm, the polynomial filtering algorithm must determine the filtering window in advance so that the algorithm can solve the optimal polynomial in the window. After completing the filtering of the data in the current window, the window is moved to the next interval to continue filtering. The filtering value jumps easily at the intersection of the two intervals, causing the filtered curve to jump at the intersection of the filtering window, resulting in uneven filtered data.

[0008] 3) From the principle of the polynomial filtering algorithm, it can be seen that within a filtering window, the filtering effect of the middle point is better than that of the edge point, because for the middle point, in the process of obtaining the optimal polynomial, both the data trends on the left side of the middle point and the data trends on the right side of the middle point are integrated, while for the boundary point, in the process of obtaining the optimal polynomial, only the data trends on one side can be considered. In the process of applying polynomial filtering to real-time filtering, the real-time input data at the current moment is used as the right endpoint of the filtering window, and the filtering window is formed in chronological order with historical data. The filtering value of the data at the current moment only integrates the data information at the historical moments, and cannot integrate the data information at the future moments, which makes the effect of the polynomial filtering algorithm in real-time filtering worse than that of offline filtering. Summary of the invention

[0009] The technical problem to be solved by the present invention is to provide a continuous polynomial real-time filtering method based on a five-point cubic smoothing method, which can solve the deficiencies of the prior art and improve the effect of the polynomial filtering method in real-time filtering.

[0010] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows.

[0011] A continuous polynomial real-time filtering method based on a five-point cubic smoothing method comprises the following steps:

[0012] A. Let x(t) be the data collected by the sensor at time t, and w be the length of the filter window. Then x(t-1)~x(tw) are the data collected by the sensor at w times from t-1 to tw. Offline polynomial filtering is performed on x(t-1)~x(tw);

[0013] B. Using a continuous polynomial real-time filtering method based on a five-point cubic smoothing method to perform real-time online filtering on the data x(t);

[0014] C. Construct a new sliding window and use the continuous polynomial real-time filtering method based on the five-point cubic smoothing method to perform real-time online filtering on the data x(t+1).

[0015] Preferably, in step A,

[0016] Use a fourth-order polynomial to perform offline polynomial filtering on x(t-1)~x(tw), the polynomial form is y f =k0+k1t+k2t 2 +k3t 3 +k4t 4 , where k0, k1, k2, k3, k4 are the coefficients of the polynomial to be determined, t is the sequence label, the sequence label corresponding to the point x(tw) is 1, and the sequence label corresponding to the point x(t-1) is w. Establish w observation equations,

[0017]

[0018] Among them, e(tw)~e(t-1) are the errors between the polynomial regression model and the real data.

[0019] θ T =[k0 k1 k2 k3 k4]

[0020]

[0021]

[0022]

[0023] Then X = φθ + ε, and the least squares method is used to estimate θ. The goal is to minimize the sum of squares of the fitting residual ε. The sum of squares of the fitting residual is J = ε T ε=(X-φθ) T (X-φθ), the partial derivative of the objective function J with respect to θ is

[0024] Partial derivative The optimal estimate of θ is θ=(φ T φ) -1 φ T X, then the value y after polynomial filtering of x(t-1)~x(tw) f (t-1)~y f (tw) is,

[0025]

[0026] Preferably, in step B,

[0027] The data x(t) collected by the sensor at time t is compared with the data y obtained by offline filtering. f (t-w+1)~y f (t-1) together form a sliding window of length w, and a fourth-order polynomial is used to establish a regression model corresponding to the data in the sliding window. The structure of the fourth-order polynomial regression model is:

[0028]

[0029] Where k0, k1, k2, k3, k4 are the coefficients of the polynomial to be determined, t is the sequence label, and e(t) is the filtered data The residual with the data y(t) before filtering,

[0030] In the sliding window at time t, y(t) corresponds to the input data in the window, and the corresponding relationship is,

[0031]

[0032] In order to avoid the jump phenomenon at the intersection of the filter window and ensure the smoothness of the filtering result, the reference component of the polynomial filter is determined according to the historical filtering value, and the reference component k0=y(1) is set.

[0033] Use the least squares method to solve the optimal polynomial corresponding to the sliding window, let

[0034] θ T =[k1 k2 k3 k4]

[0035]

[0036]

[0037]

[0038] Then we have Y = φθ + ε, and the least squares method is used to estimate θ. The goal is to minimize the sum of squares of the fitting residual ε. The sum of squares of the fitting residual is J = ε T ε=(Y-φθ) T (Y-φθ), the partial derivative of the objective function J with respect to θ is

[0039] Partial derivative The optimal estimate of θ is θ=(φ T φ) -1 φ T Y, then the values ​​of y(1)~y(w) after polynomial filtering for

[0040]

[0041] The five-point cubic smoothing method was used to To further modify the value of , first select five points with a label interval of Δ. in The value of is unknown, and it is predicted using the polynomial obtained above. The calculation formula is:

[0042]

[0043] A cubic polynomial is selected to fit it, and the polynomial form is point The corresponding t is 1, 2, 3, 4, and 5 respectively, so we have the following formula

[0044]

[0045] The sum of squares of the fitting residuals is J = ε T ε=(Y-φθ) T (Y-φθ), use the least squares method to estimate θ, let the partial derivative The optimal estimate of θ is obtained as,

[0046]

[0047] Obtain The smoothed real-time output value y out for

[0048]

[0049] Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothing value of the one-beat lag is calculated as follows:

[0050] Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothing value of the two-beat lag is calculated as follows:

[0051]

[0052] Compared with the smoothed value The smoothed value of the phase lags by three beats, The smoothed value of is assigned to y out You can get The smoothed value of the three-beat lag is calculated as follows:

[0053]

[0054] Compared with the smoothed value The smoothed value phase is one beat ahead, The smoothed value of is assigned to y out You can get The smoothing value of the previous beat is calculated as follows:

[0055] The smoothed value y outUse leading or lagging values ​​to make adjustments based on specific circumstances, and select the best value for output.

[0056] Preferably, in step C,

[0057] At time t+1, the sensor collects data x(t+1) and y f (t-w+2)~y f (t) together form a sliding window of length w,

[0058] In the sliding window at time t+1, y(t) corresponds to the input data in the window, and the corresponding relationship is

[0059]

[0060] Two outputs are obtained: the first output is y obtained after five-point cubic smoothing out As the final output y after filtering the input x(t+1) at time t+1 out (t+1); the second output is the value after continuous polynomial filtering Update y f (t-w+2)~y f The value of (t+1) is used to construct the next sliding window;

[0061] And so on, the real-time filtering of subsequent input data is completed.

[0062] The beneficial effects brought about by adopting the above technical scheme are as follows: the present invention proposes a continuous polynomial real-time filtering algorithm based on five-point cubic smoothing technology, and improves the effect of the polynomial filtering method in real-time filtering by adding the five-point cubic smoothing technology to the polynomial filtering, so that the polynomial filtering algorithm can be applied to real-time online filtering, and the least squares method is used to perform optimal estimation of the polynomial parameters; the present invention adopts the sliding window technology to dynamically adjust the content of the filtering window, and determines the reference component of the polynomial filtering according to the historical filtering value, so as to avoid the jump phenomenon at the intersection point of the filtering window and ensure the smoothness of the filtering result; the present invention improves the effect of real-time filtering on the basis of continuous polynomial filtering; the present invention adds the concept of phase lead and lag adjustment to the five-point cubic smoothing, and the filtering effect can be adjusted by selecting the lead or lag and the number of lead or lag beats. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 It is a flow chart of a specific implementation mode of the present invention.

[0064] Figure 2 This is a comparison chart of different filtering methods. DETAILED DESCRIPTION

[0065] Reference Figure 1 , this embodiment includes the following steps:

[0066] A. Let x(t) be the data collected by the sensor at time t, and w be the length of the filter window. Then x(t-1)~x(tw) are the data collected by the sensor at w times from t-1 to tw. Offline polynomial filtering is performed on x(t-1)~x(tw);

[0067] B. Using a continuous polynomial real-time filtering method based on a five-point cubic smoothing method to perform real-time online filtering on the data x(t);

[0068] C. Construct a new sliding window and use the continuous polynomial real-time filtering method based on the five-point cubic smoothing method to perform real-time online filtering on the data x(t+1).

[0069] In step A,

[0070] Use a fourth-order polynomial to perform offline polynomial filtering on x(t-1)~x(tw), the polynomial form is y f =k0+k1t+k2t 2 +k3t 3 +k4t 4 , where k0, k1, k2, k3, k4 are the coefficients of the polynomial to be determined, t is the sequence label, the sequence label corresponding to the point x(tw) is 1, and the sequence label corresponding to the point x(t-1) is w. Establish w observation equations,

[0071]

[0072] Among them, e(tw)~e(t-1) are the errors between the polynomial regression model and the real data.

[0073] θ T =[k0 k1 k2 k3 k4]

[0074]

[0075]

[0076]

[0077] Then X = φθ + ε, and the least squares method is used to estimate θ. The goal is to minimize the sum of squares of the fitting residual ε. The sum of squares of the fitting residual is J = ε T ε=(X-φθ) T (X-φθ), the partial derivative of the objective function J with respect to θ is

[0078] Partial derivative The optimal estimate of θ is θ=(φT φ) -1 φ T X, then the value y after polynomial filtering of x(t-1)~x(tw) f (t-1)~y f (tw) is,

[0079]

[0080] In step B,

[0081] The data x(t) collected by the sensor at time t is compared with the data y obtained by offline filtering. f (t-w+1)~y f (t-1) together form a sliding window of length w, and a fourth-order polynomial is used to establish a regression model corresponding to the data in the sliding window. The structure of the fourth-order polynomial regression model is:

[0082]

[0083] Where k0, k1, k2, k3, k4 are the coefficients of the polynomial to be determined, t is the sequence label, and e(t) is the number after filtering. The residual with the data y(t) before filtering,

[0084] In the sliding window at time t, y(t) corresponds to the input data in the window, and the corresponding relationship is,

[0085]

[0086] In order to avoid the jump phenomenon at the intersection of the filter window and ensure the smoothness of the filtering result, the reference component of the polynomial filter is determined according to the historical filtering value, and the reference component k0=y(1) is set.

[0087] Use the least squares method to solve the optimal polynomial corresponding to the sliding window, let

[0088] θ T =[k1 k2 k3 k4]

[0089]

[0090]

[0091]

[0092] Then we have Y = φθ + ε, and the least squares method is used to estimate θ. The goal is to minimize the sum of squares of the fitting residual ε. The sum of squares of the fitting residual is J = ε T ε=(Y-φθ) T (Y-φθ), the partial derivative of the objective function J with respect to θ is

[0093] Partial derivative The optimal estimate of θ is θ=(φ T φ) -1 φ T Y, then the values ​​of y(1)~y(w) after polynomial filtering for

[0094]

[0095] The five-point cubic smoothing method was used to To further modify the value of , first select five points with a label interval of Δ. in The value of is unknown, and it is predicted using the polynomial obtained above. The calculation formula is:

[0096]

[0097] A cubic polynomial is selected to fit it, and the polynomial form is point The corresponding t is 1, 2, 3, 4, and 5 respectively, so we have the following formula

[0098]

[0099] The sum of squares of the fitting residuals is J = ε T ε=(Y-φθ) T (Y-φθ), use the least squares method to estimate θ, let the partial derivative The optimal estimate of θ is obtained as,

[0100]

[0101] Obtain The smoothed real-time output value y out for

[0102]

[0103] Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothing value of the one-beat lag is calculated as follows:

[0104] Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothing value of the two-beat lag is calculated as follows:

[0105]

[0106] Compared with the smoothed value The smoothed value of the phase lags by three beats, The smoothed value of is assigned to y out You can get The smoothed value of the three-beat lag is calculated as follows:

[0107]

[0108] Compared with the smoothed value The smoothed value phase is one beat ahead, The smoothed value of is assigned to y out You can get The smoothing value of the previous beat is calculated as follows:

[0109] The smoothed value y out Use leading or lagging values ​​to make adjustments based on specific circumstances, and select the best value for output.

[0110] In step C,

[0111] At time r+1, the sensor collects data x(t+1), which is consistent with y f (t-w+2)~y f (t) together form a sliding window of length w,

[0112] In the sliding window at time t+1, y(t) corresponds to the input data in the window, and the corresponding relationship is

[0113]

[0114] Two outputs are obtained: the first output is y obtained after five-point cubic smoothing out As the final output y after filtering the input x(t+1) at time t+1 out (t+1); the second output is the value after continuous polynomial filtering Update y f (t-w+2)~y f The value of (t+1) is used to construct the next sliding window;

[0115] And so on, the real-time filtering of subsequent input data is completed.

[0116] The present invention applies the polynomial filtering method to online filtering, broadening the application scope of the polynomial filtering method. The sliding window technology is adopted and the reference component of the polynomial filtering is determined according to the historical filtering value, so as to avoid the jump phenomenon at the intersection of the filtering window and ensure the smoothness of the filtering result. By adding the five-point cubic smoothing technology, the filtering effect of the continuous polynomial filtering is improved. By adding the concept of phase lead and lag adjustment in the five-point cubic smoothing, the applicability of the filtering algorithm in different application environments is enhanced.

Claims

1. A continuous polynomial real-time filtering method based on five-point cubic smoothing method, Features The following steps are involved: A. Let x(t) be the data collected by the sensor at time t, and w be the length of the filter window. Then x(t-1)~x(tw) are the data collected by the sensor at w times from t-1 to tw. Offline polynomial filtering is performed on x(t-1)~x(tw); B. Using a continuous polynomial real-time filtering method based on a five-point cubic smoothing method to perform real-time online filtering on the data x(t); C. Construct a new sliding window and use a continuous polynomial real-time filtering method based on a five-point cubic smoothing method to perform real-time online filtering on the data x(t+1); Among them, in step A, Use a fourth-order polynomial to perform offline polynomial filtering on x(t-1)~x(tw), the polynomial form is y f =k 0 +k 1 t+k 2 t 2 +k 3 t 3 +k 4 t 4 , where k 0 , k 1 , k 2 , k 3 , k 4 is the unknown coefficient of the polynomial, t is the sequence label, the sequence label corresponding to the point x(tw) is 1, the sequence label corresponding to the point x(t-1) is w, and w observation equations are established. Among them, e(tw)~e(t-1) is the error between the polynomial regression model and the real data, let θ T =[k 0 k 1 k 2 k 3 k 4 ] Then X = φθ + ε, and the least squares method is used to estimate θ. The goal is to minimize the sum of squares of the fitting residual ε. The sum of squares of the fitting residual is J = ε T ε=(X-φθ) T (X-φθ), the partial derivative of the objective function J with respect to θ is Partial derivative The optimal estimate of θ is θ=(φ T φ) -1 φ T X, then the value y after polynomial filtering of x(t-1)~x(tw) f (t-1)~y f (tw) is, In step B, The data x(t) collected by the sensor at time t is compared with the data y obtained by offline filtering. f (t-w+1)~y f (t-1) together form a sliding window of length w, and a fourth-order polynomial is used to establish a regression model corresponding to the data in the sliding window. The structure of the fourth-order polynomial regression model is: where k 0 , k 1 , k 2 , k 3 , k 4 is the unknown coefficient of the polynomial, t is the sequence label, and e(t) is the filtered data The residual with the data y(t) before filtering, In the sliding window at time t, y(t) corresponds to the input data in the window, and the corresponding relationship is, In order to avoid the jump phenomenon at the intersection of the filter window and ensure the smoothness of the filtering result, the reference component of the polynomial filter is determined according to the historical filtering value, and the reference component k is set. 0 =y(1), Use the least squares method to solve the optimal polynomial corresponding to the sliding window, let θ T =[k 1 k 2 k 3 k 4 ] Then we have Y = φθ + ε, and the least squares method is used to estimate θ. The goal is to minimize the sum of squares of the fitting residual ε. The sum of squares of the fitting residual is J = ε T ε=(Y-φθ) T (Y-φθ), the partial derivative of the objective function J with respect to θ is Partial derivative The optimal estimate of θ is θ=(φ T φ) -1 φ T Y, then the values ​​of y(1)~y(w) after polynomial filtering for The five-point cubic smoothing method was used to To further modify the value of , first select five points with a label interval of Δ. in The value of is unknown, and it is predicted using the polynomial obtained above. The calculation formula is: A cubic polynomial is selected to fit it, and the polynomial form is point The corresponding t is 1, 2, 3, 4, and 5 respectively, so we have the following formula The sum of squares of the fitting residuals is J = ε T ε=(Y-φθ) T (Y-φθ), use the least squares method to estimate θ, let the partial derivative The optimal estimate of θ is obtained as, Obtain The smoothed real-time output value y out for Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothing value of one beat lag is calculated as follows: Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothing value of the two-beat lag is calculated as follows: Compared with the smoothed value The smoothed value of The smoothed value of is assigned to y out You can get The smoothed value of the three-beat lag is calculated as follows: Compared with the smoothed value The smoothed value phase is one beat ahead, The smoothed value of is assigned to y out You can get The smoothing value of the previous beat is calculated as follows: The smoothed value y out Use leading or lagging values ​​to make adjustments based on specific circumstances, and select the best value for output.

2. The continuous polynomial real-time filtering method based on the five-point cubic smoothing method according to claim 1, Features: In step C, At time t+1, the sensor collects data x(t+1) and y f (t-w+2)~y f (t) together form a sliding window of length w, In the sliding window at time t+1, y(t) corresponds to the input data in the window, and the corresponding relationship is Two outputs are obtained: the first output is y obtained after five-point cubic smoothing out As the final output y after filtering the input x(t+1) at time t+1 out (t+1); the second output is the value after continuous polynomial filtering Update y f (t-w+2)~y f The value of (t+1) is used to construct the next sliding window; And so on, the real-time filtering of subsequent input data is completed.