Segmented adaptive SG filtering method and device based on cosine weight transition

By using a piecewise adaptive SG filtering method based on cosine weighted transition, the filtering parameters are dynamically adjusted, which solves the problems of subjectivity and adaptability in parameter selection of traditional filtering methods. This enables accurate extraction of single-phase grounding fault characteristic signals and smooth waveform transition in distribution networks, improving the accuracy and reliability of fault line selection and location.

CN121690140APending Publication Date: 2026-03-17STATE GRID FUJIAN ELECTRIC POWER CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511913790.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing filtering methods suffer from high subjectivity and poor adaptability in parameter selection when dealing with single-phase grounding faults in distribution networks. This leads to abrupt changes in waveforms at the boundary between transient and steady states, affecting the accurate extraction of fault characteristic signals.

Method used

A piecewise adaptive SG filtering method based on cosine weight transition is adopted. The filtering parameters are dynamically adjusted through local feature indices. In the transient stage, it adapts to high-order polynomials and short windows, and in the steady-state stage, it adapts to low-order polynomials and long windows. At the boundary, a cosine weight function is used for weighted fusion to achieve smooth waveform transition.

Benefits of technology

It achieves adaptive dynamic matching of filtering parameters, effectively overcomes the defects of traditional filtering methods, improves the integrity of fault characteristic signals and the reliability of noise reduction, is suitable for medium-voltage distribution networks with distributed power sources, and is adaptable to single-phase grounding fault scenarios under different grounding resistances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121690140A_ABST
    Figure CN121690140A_ABST
Patent Text Reader

Abstract

The invention provides a segmented adaptive SG filtering method and device based on cosine weight transition. The method comprises the following steps: obtaining a noisy fault signal of a power distribution network; extracting local feature indexes of the signals, wherein the local feature indexes comprise an average gradient representing the change frequency of the signals and a composite feature index representing the noise level; dynamically determining a window length and a polynomial order of SG filtering based on the local feature indexes; the transient stage is the first 1 / 2 period of the post-fault signal, the steady-state stage is the subsequent part of the post-fault signal, an overlapping region is arranged at the junction of the transient stage and the steady-state stage, the overlapping region is a 1 / 2 period following the transient stage, and a cosine weight function is adopted to perform weighted fusion on filtering results of the two stages in the overlapping region; and splicing the filtering results of the non-overlapping region and the overlapping region of the transient stage and the non-overlapping region of the steady stage, and outputting a filtered fault feature signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power distribution network fault signal processing technology, and specifically relates to a piecewise adaptive SG filtering method and device based on cosine weight transition. Background Technology

[0002] With the rapid development of power distribution networks, their scale is constantly expanding, and their topology is becoming increasingly complex, leading to more complex single-phase grounding faults. Statistics show that single-phase grounding faults account for over 70% of all power distribution network faults, impacting power supply reliability. Distributed generation (DG) is profoundly affecting the transient characteristics of faults in new power systems. DG generates high-frequency harmonics and noise that influence the transient process signal of single-phase grounding faults, thus affecting fault location accuracy. Therefore, efficient filtering techniques are needed to accurately reconstruct the characteristic information after a fault occurs for precise fault location.

[0003] There are many methods for noise filtering, such as wavelet analysis, morphological filtering, empirical mode decomposition (EMD), and singular value decomposition (SVD). Among these, discrete wavelet transform (DIW) faces challenges in selecting suitable wavelet basis functions and suffers from issues such as non-uniqueness of the number of decomposition levels and threshold selection; improper selection can severely impact denoising performance. Morphological filtering struggles to determine its structuring elements, thus affecting denoising effectiveness. EMD suffers from non-unique threshold selection, endpoint effects, and mode aliasing. Singular value decomposition (SVD) decomposes noisy signals and reconstructs the signal by selecting appropriate singular value thresholds. However, the selection of singular value thresholds is influenced by human factors; an inappropriate threshold can severely distort the denoised waveform, affecting the denoising effect.

[0004] While existing Savitzky-Golay (SG) filtering algorithms do not require frequency domain transformation and can directly process time-domain data, the polynomial order and window length of traditional SG filters are fixed values. This makes them unsuitable for the different characteristics of the transient and steady-state phases of fault signals. The transient phase requires preservation of detailed features, while the steady-state phase requires enhanced noise suppression. Fixed parameters easily lead to the loss of transient details or incomplete filtering of steady-state noise, and waveform abrupt changes are prone to occur at the boundary between transient and steady-state states. Therefore, there is an urgent need for a filtering method that can adaptively adjust parameters and achieve smooth transitions to accurately extract the characteristics of single-phase grounding faults in distribution networks. Summary of the Invention

[0005] To address the shortcomings and deficiencies of existing technologies, this invention provides a piecewise adaptive SG filtering method and device based on cosine weighted transition, aiming to solve the problems of strong subjectivity in parameter selection, poor adaptability, and easy abrupt changes in waveform at the boundary between transient and steady states in traditional filtering methods, and to accurately extract fault characteristic signals of distribution networks.

[0006] This method first performs normalization preprocessing on noisy fault signals in the distribution network to eliminate differences in data magnitude. Then, it extracts local feature indicators of the signal, including the average gradient representing the frequency of signal changes, the standard deviation representing the noise level, and a composite feature indicator that comprehensively reflects the relative relationship between the severity of signal changes and the noise level. Based on these feature indicators, the SG filter parameters are dynamically adjusted. For the transient stage of the fault signal, a high-order polynomial and short-window configuration are applied to preserve detailed features to the greatest extent, while for the steady-state stage, a low-order polynomial and long-window configuration are applied to enhance noise suppression. An overlapping region is set at the boundary between the transient and steady-state stages. By mapping the positional information within the region to angle parameters to construct a cosine weight function, the filtering results of the two stages are dynamically weighted and fused to achieve a smooth waveform transition. Finally, the processing results of the non-overlapping and overlapping regions are spliced ​​together to output the fault feature signal after filtering out high-frequency harmonics and noise.

[0007] This invention eliminates the need for subjective selection of basis functions, thresholds, and other parameters. It achieves automated adaptation through the dynamic correlation between feature indicators and filtering parameters. Its polynomial order is limited to a reasonable integer range, and the sensitivity coefficient is flexibly selected based on noise intensity. The overlapping region is reasonably divided according to the fault signal period. This ensures excellent noise reduction performance while possessing a simple algorithm flow and low computational complexity. It can be directly applied to medium-voltage distribution networks with distributed power sources, adapting to single-phase grounding fault scenarios under different grounding resistances, and providing accurate data support for fault line selection and location.

[0008] The present invention specifically employs the following technical means:

[0009] A piecewise adaptive SG filtering method based on cosine weight transition includes:

[0010] Acquire noisy fault signals in the power distribution network;

[0011] Local feature indices are extracted from the signal, including the average gradient characterizing the frequency of signal change, the standard deviation characterizing the noise level, and a composite feature index composed of the ratio of the average gradient to the standard deviation.

[0012] Based on the local feature index, the window length and polynomial order of the SG filter are dynamically determined. The determination of the window length is positively correlated with the standard deviation, and the determination of the polynomial order is positively correlated with the composite feature index. The transient stage is adapted to the configuration of high-order polynomial and short window, and the steady-state stage is adapted to the configuration of low-order polynomial and long window.

[0013] The transient phase is the first half-cycle of the signal after the fault, and the steady-state phase is the subsequent part of the signal after the fault. An overlapping region is set at the boundary between the transient phase and the steady-state phase. The overlapping region is the half-cycle immediately following the transient phase. A cosine weighting function is used to weight and fuse the filtering results of the two phases in the overlapping region.

[0014] The filtering results of the non-overlapping region, overlapping region, and non-overlapping region of the transient stage are spliced ​​together to output the filtered fault characteristic signal.

[0015] Furthermore, before extracting the local feature index, the noisy fault signal is subjected to normalization preprocessing. The normalization preprocessing is to normalize the noisy fault signal to the [0,1] interval according to the difference between its maximum and minimum values. The average gradient is the average of the absolute values ​​of the differences between the signal values ​​of all adjacent sampling points in the preprocessed signal. The standard deviation is the standard deviation of the preprocessed signal. The composite feature index is the ratio of the average gradient to the standard deviation.

[0016] Furthermore, the window length is dynamically determined as follows: a weight value is obtained by multiplying the standard deviation and a sensitivity coefficient using the hyperbolic tangent function, and then calculated by combining the preset minimum and maximum window lengths.

[0017] Furthermore, the polynomial order is determined by multiplying the composite feature index by 5 and then adding 1, followed by rounding, and the result is restricted to an integer range of 1 to 7.

[0018] Furthermore, the construction and fusion process of the cosine weight function is as follows: the corresponding angle parameters are obtained by mapping the position information of each point in the overlapping area; the dynamically changing weights are assigned to the filtering results of the transient and steady-state stages based on the angle parameters; and the filtering results of the two stages are multiplied by the corresponding weights and then summed to obtain the filtering results of the overlapping area.

[0019] Furthermore, the method is applicable to single-phase grounding fault signal processing in medium-voltage distribution networks with distributed power supply access, and is adaptable to fault scenarios under different grounding resistances.

[0020] Furthermore, in the process of dynamically determining the SG filter parameters, the method does not require subjective selection of basis functions, decomposition layers, or threshold parameters, but only achieves automatic adaptation of filter parameters through extracted local feature indices.

[0021] And, a piecewise adaptive SG filter device based on cosine weight transition, comprising:

[0022] The signal acquisition module is used to collect noisy fault signals in the power distribution network;

[0023] The feature extraction module is used to extract local feature indicators of the signal. The local feature indicators include the average gradient representing the frequency of signal change, the standard deviation representing the noise level, and a composite feature indicator composed of the ratio of the average gradient to the standard deviation.

[0024] The parameter adaptation module is used to dynamically determine the window length and polynomial order of the SG filter based on the local feature index, wherein the window length is positively correlated with the standard deviation and the polynomial order is positively correlated with the composite feature index. It configures a high-order polynomial and a short window for the transient stage and a low-order polynomial and a long window for the steady-state stage. The transient stage is the first 1 / 2 cycle of the signal after the fault, and the overlapping region is the 1 / 2 cycle immediately following the transient stage.

[0025] The fusion transition module is used to set an overlapping region at the boundary between the transient and steady-state stages, and to perform weighted fusion of the filtering results of the two stages in the overlapping region through a cosine weighting function.

[0026] The signal output module is used to splice the filtering results of transient non-overlapping region, overlapping region and steady-state non-overlapping region, and output the filtered fault characteristic signal.

[0027] And a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method described above.

[0028] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0029] Compared with the prior art, the present invention and its preferred embodiments have at least the following beneficial effects:

[0030] It achieves adaptive dynamic matching of filtering parameters, effectively overcoming the shortcomings of fixed parameters and poor adaptability of traditional SG filtering. By extracting local feature indicators of the signal, it accurately matches the differentiated requirements of the transient and steady-state stages of the fault signal. In the transient stage, it preserves the detailed features of the fault to the greatest extent, and in the steady-state stage, it enhances the suppression effect of high-frequency harmonics and noise, thus taking into account both the integrity of fault features and the reliability of noise reduction.

[0031] By using a cosine weighted transition fusion mechanism, the waveform abrupt change problem caused by parameter switching between transient and steady-state stages is solved. The nonlinear characteristics of the cosine function are used to achieve a smooth transition of the two-stage filtering results, which significantly improves the integrity and continuity of the filtered signal and avoids interference from signal distortion on fault feature extraction.

[0032] Without the need for subjective selection of parameters such as basis functions, decomposition layers, or thresholds, automatic adaptation is achieved through the dynamic correlation between local feature indicators and filtering parameters. This reduces the impact of human factors on the filtering effect, improves the versatility and ease of operation of the method, and ensures the stability and consistency of the filtering effect in different scenarios.

[0033] The method has a simple process, low computational complexity, and strong engineering applicability. It can be directly adapted to the fault signal processing scenario of medium-voltage distribution network with distributed power supply access. It can handle single-phase grounding faults under different grounding resistances, provide accurate and reliable data support for fault line selection and location, and help improve the power supply reliability of distribution network. Attached Figure Description

[0034] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0035] Figure 1 This is a flowchart of a piecewise adaptive SG filtering method based on cosine weight transition according to an embodiment of the present invention;

[0036] Figure 2 This is a schematic diagram of the hyperbolic tangent function tanh according to an embodiment of the present invention;

[0037] Figure 3 This is a schematic diagram of a 10kV photovoltaic grid connection model grounded via an arc suppression coil, according to an embodiment of the present invention.

[0038] Figure 4 The following is a comparison of the filtering effects of the zero-sequence current of a single-phase ground fault with a 3000-ohm resistor after being mixed with noise with a relative signal-to-noise ratio of 15 according to an embodiment of the present invention; wherein, (a) is the zero-sequence current of the four lines after being mixed with noise, and (b) is the zero-sequence current of the four lines after being filtered by the method of the present invention.

[0039] Figure 5 The following is a comparison of the filtering effects of the zero-sequence current after a single-phase ground fault with a 3000-ohm resistor is mixed with noise with a relative signal-to-noise ratio of 3 in an embodiment of the present invention; wherein, (a) is the zero-sequence current of the four lines after being mixed with noise, and (b) is the zero-sequence current of the four lines after being filtered by the method of the present invention.

[0040] Figure 6 This is a schematic diagram of the signal used for filtering in an embodiment of the present invention; wherein, (a) is the zero-sequence current of a single-phase ground fault through a 500-ohm resistor, and (b) is the zero-sequence current after noise is added to a single-phase ground fault through a 500-ohm resistor.

[0041] Figure 7The diagram shows a comparison of the denoising effects of different filtering methods in the embodiments of the present invention; where (a) is the wavelet transform filtering effect, (b) is the Kalman filtering effect, (c) is the mean filtering effect, and (d) is the filtering effect of the method of the present invention. Detailed Implementation

[0042] To make the features and advantages of the present invention more apparent and understandable, specific embodiments are described below in detail:

[0043] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0044] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0045] The purpose of this invention is to overcome the shortcomings of existing filtering methods, such as strong subjectivity in parameter selection, poor adaptability, and uneven waveform transition. It provides a piecewise adaptive SG filtering method based on cosine weighted transition. This method normalizes noisy fault signals; calculates the average gradient, standard deviation, and composite feature index of the normalized signal; dynamically determines the window length and polynomial order of the SG filter based on the extracted local feature index, adapting to higher-order polynomials and short windows in the transient stage, and lower-order polynomials and long windows in the steady-state stage; sets an overlapping region at the boundary between the transient and steady-state stages, and uses a cosine weighted function to weight and fuse the filtering results of the two stages to achieve a smooth waveform transition; splices the filtering results of the non-overlapping region with the fused results of the overlapping region, outputting the fault feature signal after filtering out high-frequency harmonics and noise. Through adaptive parameter adjustment and smooth transition mechanisms, while filtering out high-frequency harmonics and noise, it preserves the transient details of the fault signal to the greatest extent, providing accurate data support for fault line selection and location.

[0046] To achieve the above objectives, the present invention provides the following solution:

[0047] A piecewise adaptive SG filtering method based on cosine weight transition is proposed. The implementation of this method includes the following steps:

[0048] S1, Signal preprocessing: Normalize the noisy fault signal to eliminate the difference in data magnitude and obtain a normalized signal;

[0049] S2, Local Feature Index Extraction: Calculate the average gradient, standard deviation and composite feature index of the normalized signal, which respectively characterize the signal change frequency, noise level and the comprehensive characteristics of change severity-noise level;

[0050] S3, Adaptive parameter selection: Based on the local feature index extracted in step S2, dynamically determine the window length and polynomial order of the SG filter. In the transient stage, adapt to high-order polynomials and short windows, and in the steady-state stage, adapt to low-order polynomials and long windows.

[0051] S4, Cosine Weighted Transition Fusion: An overlapping region is set at the boundary between the transient and steady-state stages, and the filtering results of the two stages are weighted and fused using a cosine weighting function to achieve a smooth waveform transition;

[0052] S5, Filtered signal output: The filtering results of the non-overlapping area are spliced ​​with the fusion results of the overlapping area, and the fault characteristic signal after filtering out high-frequency harmonics and noise is output.

[0053] Furthermore, the calculation formula for signal normalization processing in S1 is as follows:

[0054]

[0055] Wherein, sig is the noisy fault signal, sig_max is the maximum value of sig, sig_min is the minimum value of sig, and normalized_sig is the normalized signal, with a value range of [0,1].

[0056] Furthermore, the formula for calculating the average gradient in S2 is:

[0057]

[0058] Where n is the length of the normalized signal normalized_sig, |s i+1 -s i | represents the absolute change in the signal at the i-th adjacent position, and mean_grad is used to characterize the overall frequency of signal change.

[0059] Furthermore, the formula for calculating the standard deviation in S2 is:

[0060]

[0061] Where N is the number of data points in the normalized signal, and μ is the mean of the normalized signal. std is used to characterize the signal noise level.

[0062] Furthermore, the definition formula for the composite feature index in S2 is as follows:

[0063]

[0064] Where mean_grad is the average gradient, std is the standard deviation, and complexity is used to comprehensively reflect the ratio between the drastic change in the signal and the noise level.

[0065] Furthermore, the formula for calculating the window length in S3 is:

[0066] framelen=min_window+round[(max_window-min_window)*tanh(k*std)]

[0067] Wherein, min_window is the minimum window length, max_window is the maximum window length, k is the sensitivity coefficient, std is the standard deviation, tanh is the hyperbolic tangent function, and round is the rounding function; the window length is dynamically adjusted according to the noise level, the higher the noise, the closer it is to max_window, and the lower the noise, the closer it is to min_window.

[0068] Furthermore, the formula for calculating the polynomial order in S3 is:

[0069] order=max(1,min(7,round(5*complexity+1)))

[0070] Wherein, complexity is a composite feature index, max is the maximum value function, min is the minimum value function, and round is the rounding function; the polynomial order is limited to [1,7] and increases with the increase of complexity.

[0071] Furthermore, the specific steps of cosine weight transition fusion in S4 include:

[0072] (1) Select the first 1 / 2 cycle of the signal after the fault as the transient part, the next 1 / 2 cycle as the overlapping region, and the remaining signals as the steady-state part. Set an overlapping region with a width of L at the end of the transient phase and the beginning of the steady-state phase.

[0073] (2) Map the distance x from a point within the overlapping region to the left boundary to the angle parameter θ. The calculation formula is as follows: ;

[0074] (3) Design the weights W1 for the transient stage filtering result and W2 for the steady-state stage filtering result, with the following formulas: , ;

[0075] (4) The weighted fusion yields the filtered result P of the overlapping region, and the formula is:

[0076]

[0077] Where P1 is the filtering result in the transient stage and P2 is the filtering result in the steady-state stage.

[0078] According to the embodiments provided above, the technical effects are as follows:

[0079] (1) Adaptive parameter matching: The filtering parameters are dynamically adjusted by extracting local feature indicators of the signal. In the transient stage, high-order polynomials and short windows are used to preserve feature details, while in the steady-state stage, low-order polynomials and long windows are used to enhance noise suppression, thus adapting to the characteristic requirements of different stages of the fault signal.

[0080] (2) Smooth transition without sudden changes: Cosine weight fusion is adopted at the junction of transient and steady state. The nonlinear characteristics of the cosine function are used to realize weighted transition, avoid waveform sudden changes caused by parameter switching, and improve signal integrity;

[0081] (3) Excellent noise reduction effect: Compared with traditional methods such as wavelet transform and Kalman filtering, this method does not require subjective selection of parameters such as basis function and threshold. While filtering out high-frequency harmonics and noise, it retains fault feature information to the maximum extent, thereby improving the accuracy of fault selection and location.

[0082] (4) Strong engineering practicality: The algorithm process is simple and the computational complexity is low. It can be directly applied to the single-phase grounding fault signal processing of medium-voltage distribution networks with distributed power supply access, and is suitable for fault scenarios under different grounding resistances.

[0083] This invention focuses on the feature extraction technology for single-phase grounding faults under the interference of high-frequency harmonics and noise after distributed generation (DG) is connected to a medium-voltage distribution network. DG generates high-frequency harmonics, which, along with noise, are superimposed on the fault signal, affecting the detection of transient process signals and thus impacting fault location and fault selection. This invention proposes a piecewise adaptive SG filtering method based on cosine weighted transition. This method adaptively determines the window length and polynomial order for transient and steady-state stages using the standard deviation and composite feature index of the signal for SG filtering. Cosine weights are used at the transient-steady-state boundary to achieve a smooth transition, resulting in a signal after filtering out high-frequency harmonics and noise. Comparison with other filtering methods shows that the method in this embodiment can achieve adaptive parameter selection and has better filtering performance.

[0084] The SG filtering algorithm is a smoothing filtering algorithm based on local least squares. It can directly process time-domain data without frequency-domain transformation. After discretization, its core is a sliding window weighted average. However, unlike other algorithms, its weighting coefficients are not constant, but are obtained through high-order polynomial least squares fitting within the sliding window.

[0085] The basic principle of the SG filtering algorithm:

[0086] (1) Perform polynomial least squares fitting on the local data within the sliding window, and estimate the value of the center point through the fitted polynomial. For each point in the signal, select a sliding window of size 2m+1 with that point as the center, indicating that the window contains the center point and m neighboring points on the left and right.

[0087] (2) Set the fitting order k (k < m). Use a k-1 order polynomial. Solve for the least squares fitted curve for the data within the window.

[0088] (3) Least squares solution. By minimizing the fitting error Calculate the polynomial coefficients; the center point of the fitted value is the smoothed result. Filtering is essentially a weighted average, and the weight coefficients are uniquely determined by the polynomial order k and the window half-width m.

[0089] Key parameters of the SG filtering algorithm:

[0090] (1) Polynomial order k

[0091] Low order (e.g., k=3): strong noise suppression, but may lead to excessive smoothing of the signal, loss of detail information or introduction of spurious fluctuations.

[0092] Higher order (e.g., k=7): weak fitting ability, preserves details, but noise suppression is insufficient, and the filtering results may not be smooth enough.

[0093] (2) Window length 2m+1

[0094] Short window: can better preserve detailed information, but noise reduction capability is weakened.

[0095] Long window: Significant smoothing effect, but may lose signal details.

[0096] The specific steps of the SG filtering algorithm are as follows:

[0097] Let the filter window size be n = 2m + 1, and the measurement points be... Let i = (-m, -m + 1, ..., 0, 1, ..., m-1, m), and use a polynomial of degree k-1 to fit the data points within the window:

[0098] (1)

[0099] Where x is the data to be fitted, y is the fitted output data, and a is the parameter to be solved.

[0100] Essentially, it involves solving a (k-1)th degree equation to obtain the output value y. The dependent variable is y, the independent variable is x, and the parameter is a.

[0101] This results in n = 2m + 1 equations, forming a system of k linear equations. For the system to have a solution, n ≥ k (usually n > k). The fitting parameters 'a' are determined using the least squares method, and then the filtered value 'y' is obtained.

[0102] The above formula is too complex and inconvenient to understand. Therefore, we assume a five-point cubic smoothing formula, i.e., m=2, n=2×2+1=5, k=3, and substitute it into formula (1) to get:

[0103] (2)

[0104] Converted to matrix form:

[0105] (3)

[0106] Where Y represents the output value to be solved, and X represents the observed value.

[0107] Least square solution of A for:

[0108] (4)

[0109] Then the filtered value for:

[0110] (5)

[0111] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0112] like Figure 1 As shown, the piecewise adaptive SG filtering method based on cosine weight transition provided in this embodiment of the invention includes:

[0113] S1, Signal preprocessing:

[0114] The noisy fault signal is normalized to eliminate differences in data magnitude and obtain a normalized signal; specifically, this includes:

[0115] (1) The role of normalization:

[0116] Eliminating the magnitude difference in data is used for subsequent calculations of gradient, mean, and standard deviation, so that these characteristic indicators reflect the relative changes in signal shape and the relative intensity of noise, and are independent of the original absolute values.

[0117] (2) Normalization method:

[0118] Find the maximum value (sig_max) and minimum value (sig_min) of the signal (sig);

[0119] Formula used:

[0120] (6)

[0121] The signal is normalized to the interval [0, 1]. The normalized signal normalized_sig is obtained.

[0122] S2, Local Feature Index Extraction:

[0123] Calculate the average gradient, standard deviation, and composite characteristic index of the normalized signal to characterize the signal's frequency of change, noise level, and the combined characteristics of "degree of change - noise level," respectively; specifically including:

[0124] (1) Average Gradient

[0125] The formula for calculating the average gradient is:

[0126] (7)

[0127] Where n is the length of the normalized signal normalized_sig; Let be the absolute change in the signal at the i-th adjacent position.

[0128] The effect of average gradient: It reflects the overall frequency of signal change; the larger the value, the more drastic the signal change.

[0129] (2) Standard Deviation

[0130] Formula for calculating standard deviation:

[0131] (8)

[0132] Where N is the number of data points; The mean, .

[0133] The role of standard deviation: It characterizes the noise level; the larger the value, the greater the noise.

[0134] (3) Complexity

[0135] Define it as .

[0136] Its function is to comprehensively reflect the degree of change and the noise level. If the complexity value is large, the signal change is relatively drastic and the noise is relatively small. If the complexity value is small, the signal change is relatively gradual and the noise is relatively large.

[0137] S3, Adaptive parameter selection:

[0138] Based on the local feature indices extracted in step S2, the window length and polynomial order of the SG filter are dynamically determined. Specifically, the transient stage adapts to higher-order polynomials and short windows, while the steady-state stage adapts to lower-order polynomials and long windows.

[0139] (1) Selection of window length (framelen)

[0140] First, limit the maximum window length (max_window) and the minimum window length (min_window). Then, use the formula...

[0141] framelen=min_window+round[(max_window-min_window) *tanh(k* std)] (9)

[0142] The optimal window length was calculated.

[0143] Here, k is the sensitivity coefficient, used to represent the data within the sensitivity interval [-2.5, 2.5] of the hyperbolic tangent function tanh. A suitable positive real number is selected based on the standard deviation during calculation. In strong noise environments, the standard deviation is larger, resulting in a smaller k value, typically between 4 and 8; while in weak noise environments, the standard deviation is smaller, resulting in a larger k value, typically between 9 and 13.

[0144] The graph of tanh (hyperbolic tangent function) is as follows: Figure 2 As shown:

[0145] Dynamic adjustment: The noise level is converted into a weight in the range [0,1) using tanh(k*std). The greater the noise (std↑), the closer the weight is to 1 and the closer the window length is to max_window; the smaller the noise (std↓), the closer the weight is to 0 and the closer the window length is to min_window.

[0146] (2) Choice of polynomial order

[0147] By formula:

[0148] order = max(1, min(7,round(5* complexity + 1))) (10)

[0149] The optimal order was calculated.

[0150] The complexity range is (0, 1.2), so a slope of 5 and an intercept of 1 are chosen to map the complexity range (0, 1.2) to orders 1 to 7.

[0151] Dynamic adjustment: Based on composite features, the order is calculated by round(5 * complexity+1). The higher the order, the more drastic the signal changes and the less noise (complexity↑); the lower the order, the more gradual the signal changes and the more noise (complexity).

[0152] S4, Cosine Weighted Transition Fusion:

[0153] An overlapping region is set at the boundary between the transient and steady-state stages, and a cosine weighting function is used to weight and fuse the filtering results of the two stages to achieve a smooth waveform transition.

[0154] Because higher polynomial orders (k) have weaker fitting capabilities but retain more details, they also suffer from insufficient noise suppression. Lower orders, on the other hand, offer stronger noise suppression but may lead to over-smoothing of the signal, resulting in the loss of detail. A window length of 2m+1 better preserves detail with short windows but weakens noise reduction. Long windows provide significant smoothing but may lose signal details. Therefore, a higher-order polynomial and short window approach is chosen for the transient phase, while a lower-order polynomial and long window approach is chosen for noise filtering in the steady-state phase.

[0155] Since different parameter choices can cause abrupt changes in the waveform, cosine weighting is used to ensure a smooth transition. The cosine weighting method is used in signal processing and other fields to achieve smooth transitions in overlapping regions. Its core principle is to utilize the nonlinear characteristics of the cosine function to dynamically weight and fuse two waveforms within the overlapping region. The key lies in the nonlinear variation of the weights with position, resulting in a more natural transition. The following is a detailed analysis of the underlying principles:

[0156] Coordinate mapping

[0157] The first half-cycle of the signal after the fault is selected as the transient portion, the subsequent half-cycle as the transition region (overlapping region), and its width L is half the signal period. The remaining signal is the steady-state portion. The width L of the overlapping region is mapped to the angle interval [0, π]. Let x be the distance from a point within the overlapping region to the left boundary; define the normalized position parameter. ( (From 0 to π).

[0158] (2) Weight function design

[0159] Previous image weights: When x=0 (left boundary), =0, =1; when x=L

[0160] (Right boundary) =π, =0.

[0161] Weights of the next image: When x=0 (left boundary), =0, =0; when x=L

[0162] (Right boundary) =π, =1.

[0163] (3) Fusion Formula

[0164] The final overlapping waveform P is a weighted synthesis of the corresponding two waveforms P1 and P2:

[0165] (11)

[0166] S5, Filtered signal output:

[0167] The filtering results of non-overlapping regions are spliced ​​together with the fusion results of overlapping regions to output the fault characteristic signal after filtering out high-frequency harmonics and noise.

[0168] Simulation analysis of the method in the embodiments of the present invention:

[0169] 1. Denoising effect of piecewise adaptive SG filtering with cosine weight transition

[0170] This test example uses ATP to build a 10kV photovoltaic grid connection model grounded via an arc suppression coil. The model is as follows: Figure 3 As shown, a single-phase ground fault with a 3000-ohm resistor was simulated by building a model. The zero-sequence current waveform under this condition was acquired. Noise with a signal-to-noise ratio of 15 and 3 relative to its own zero-sequence current was generated and added to the signal respectively.

[0171] Noise reduction effect image:

[0172] (1) Filtering the zero-sequence current doped with noise with a self-influence ratio of 15:

[0173] According to formulas (9) and (10), the parameters can be calculated as follows: the order of the transient part is 5 and the window length is 43; the order of the steady-state part is 2 and the window length is 47.

[0174] The system is set to experience a single-phase ground fault via a 3000-ohm resistor on line 4 at 0.1 seconds. The zero-sequence current of the faulty line and the zero-sequence currents of the remaining three lines are mixed with noise of a relative signal-to-noise ratio of 15, and then filtered using the method proposed in this invention. The filtering effect is as follows: Figure 4 As shown.

[0175] (2) Filter the zero-sequence current that is doped with noise with a self-inflation ratio of 3:

[0176] According to formulas (9) and (10), the parameters can be calculated as follows: the order of the transient part is 5 and the window length is 57; the order of the steady-state part is 3 and the window length is 61.

[0177] The system is set to experience a single-phase ground fault via a 3000-ohm resistor on line 4 at 0.1 seconds. The zero-sequence current of the faulty line and the zero-sequence currents of the remaining three lines are mixed with noise of a relative signal-to-noise ratio of 3, and then filtered using the method proposed in this invention. The filtering effect is as follows. Figure 5 As shown.

[0178] 2. Comparison of denoising performance between traditional methods and piecewise adaptive SG filtering algorithm with cosine weight transition

[0179] Using the 10kV photovoltaic access model grounded through an arc suppression coil constructed above via ATP, the zero-sequence current superimposed noise of a single-phase ground fault via a 500-ohm resistor was filtered using wavelet transform, Kalman filtering, and mean filtering algorithms, respectively. The resulting graphs were compared with the method of this invention. The signals used for filtering are as follows: Figure 6 As shown.

[0180] Four methods were used to filter the zero-sequence current doped with noise, and the filtering effects were compared. Figure 7 As shown in Table 1, the computation time for filtering using four different filtering algorithms is also presented.

[0181] Table 1 Filtering calculation time for different filtering methods

[0182]

[0183] Figure 7 It can be seen that wavelet transform makes the signal too smooth, losing signal details. The signal after Kalman filtering is not smooth enough and the data is not accurate enough. The signal after mean filtering is also not smooth enough. The filtering method proposed in this invention adaptively selects filtering parameters for transient and steady-state stages, which not only preserves the details of the transient part, but also makes the data more accurate, while shortening the calculation time.

[0184] Compared with existing technologies, the advantages of the present invention include:

[0185] (1) The piecewise adaptive SG filtering algorithm based on cosine weight transition is suitable for extracting the characteristics of single-phase grounding faults under noise interference of distributed power sources connected to medium-voltage distribution networks. Simulation experiments have verified its feasibility and superiority in filtering out high-frequency harmonics and superimposed noise generated by distributed power sources.

[0186] (2) The biggest advantage of the piecewise adaptive SG filtering algorithm based on cosine weight transition is that it can adaptively select different parameters for denoising in the transient and steady-state stages, ensuring the preservation of more details in the transient stage and good denoising effect in the steady-state stage.

[0187] (3) Compared with traditional denoising methods, this algorithm is superior to traditional denoising methods in terms of denoising effect and performance, and simplifies the denoising process and shortens the calculation time, providing an optional solution for practical applications in smart grids.

[0188] Based on the same inventive concept, this invention also provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the programs include program instructions, and the processor executes the program instructions stored in the memory. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, used to implement one or more instructions, specifically for loading and executing one or more instructions stored in a computer storage medium to implement the above-described method.

[0189] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, performs the above-described method. This storage medium can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0190] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0191] The foregoing has shown and described the basic principles, main features, and advantages of this disclosure. Those skilled in the art should understand that this disclosure is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this disclosure. Various changes and modifications can be made to this disclosure without departing from its spirit and scope, and all such changes and modifications fall within the scope of this disclosure as claimed.

[0192] This invention is not limited to the preferred embodiment described above. Anyone inspired by this invention can derive other forms of piecewise adaptive SG filtering method and apparatus based on cosine weight transition. All equivalent variations and modifications made within the scope of the claims of this invention shall fall within the scope of this invention.

Claims

1. A piecewise adaptive SG filtering method based on cosine weight transition, characterized in that, include: Acquire noisy fault signals in the power distribution network; Local feature indices are extracted from the signal, including the average gradient characterizing the frequency of signal change, the standard deviation characterizing the noise level, and a composite feature index composed of the ratio of the average gradient to the standard deviation. Based on the local feature index, the window length and polynomial order of the SG filter are dynamically determined. The determination of the window length is positively correlated with the standard deviation, and the determination of the polynomial order is positively correlated with the composite feature index. The transient stage is adapted to the configuration of high-order polynomial and short window, and the steady-state stage is adapted to the configuration of low-order polynomial and long window. The transient phase is the first half-cycle of the signal after the fault, and the steady-state phase is the subsequent part of the signal after the fault. An overlapping region is set at the boundary between the transient phase and the steady-state phase. The overlapping region is the half-cycle immediately following the transient phase. A cosine weighting function is used to weight and fuse the filtering results of the two phases in the overlapping region. The filtering results of the non-overlapping region, overlapping region, and non-overlapping region of the transient stage are spliced ​​together to output the filtered fault characteristic signal.

2. The piecewise adaptive SG filtering method based on cosine weight transition according to claim 1, characterized in that: Before extracting the local feature index, the noisy fault signal is subjected to normalization preprocessing. The normalization preprocessing is to normalize the noisy fault signal to the [0,1] interval according to the difference between its maximum and minimum values. The average gradient is the average of the absolute values ​​of the differences between the signal values ​​of all adjacent sampling points in the preprocessed signal. The standard deviation is the standard deviation of the preprocessed signal. The composite feature index is the ratio of the average gradient to the standard deviation.

3. The piecewise adaptive SG filtering method based on cosine weight transition according to claim 1, characterized in that: The window length is dynamically determined as follows: a weight value is obtained by multiplying the standard deviation and a sensitivity coefficient using the hyperbolic tangent function, and then calculated by combining the preset minimum and maximum window lengths.

4. The piecewise adaptive SG filtering method based on cosine weight transition according to claim 1, characterized in that: The polynomial order is determined by multiplying the composite feature index by 5, adding 1, and then rounding down, with the result limited to an integer range of 1 to 7.

5. The piecewise adaptive SG filtering method based on cosine weight transition according to claim 1, characterized in that: The construction and fusion process of the cosine weight function is as follows: the corresponding angle parameters are obtained by mapping the position information of each point in the overlapping area; the dynamically changing weights are assigned to the filtering results of the transient and steady-state stages based on the angle parameters; and the filtering results of the two stages are multiplied by the corresponding weights and then summed to obtain the filtering results of the overlapping area.

6. The piecewise adaptive SG filtering method based on cosine weight transition according to claim 1, characterized in that: The method is applicable to single-phase grounding fault signal processing in medium-voltage distribution networks with distributed power sources, and is adaptable to fault scenarios with different grounding resistances.

7. The piecewise adaptive SG filtering method based on cosine weight transition according to claim 1, characterized in that: The method, in the process of dynamically determining SG filter parameters, does not require subjective selection of basis functions, decomposition layers, or threshold parameters, but achieves automatic adaptation of filter parameters only through extracted local feature indices.

8. A piecewise adaptive SG filter device based on cosine weight transition, characterized in that, include: The signal acquisition module is used to collect noisy fault signals in the power distribution network; The feature extraction module is used to extract local feature indicators of the signal. The local feature indicators include the average gradient representing the frequency of signal change, the standard deviation representing the noise level, and a composite feature indicator composed of the ratio of the average gradient to the standard deviation. The parameter adaptation module is used to dynamically determine the window length and polynomial order of the SG filter based on the local feature index, wherein the window length is positively correlated with the standard deviation and the polynomial order is positively correlated with the composite feature index. It configures a high-order polynomial and a short window for the transient stage and a low-order polynomial and a long window for the steady-state stage. The transient stage is the first 1 / 2 cycle of the signal after the fault, and the overlapping region is the 1 / 2 cycle immediately following the transient stage. The fusion transition module is used to set an overlapping region at the boundary between the transient and steady-state stages, and to perform weighted fusion of the filtering results of the two stages in the overlapping region through a cosine weighting function. The signal output module is used to splice the filtering results of transient non-overlapping region, overlapping region and steady-state non-overlapping region, and output the filtered fault characteristic signal.

9. A computer device, characterized in that, It includes a processor and a memory storing a computer program, wherein when the processor executes the computer program, it implements the method of any one of claims 1-7.

10. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-7.

Citation Information

Cited By

  • A full-automatic electronic scale high-precision detection system

    CN122329468A