Method, system and device for simplifying Hilbert transform based on filter coefficient
The Hilbert transform method with downsampling and simplified filter coefficients solves the problems of large Hilbert transform calculation amount and poor accuracy in power systems, and realizes efficient and accurate reactive energy calculation.
Patent Information
- Application Number
- CN202510802134.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-10-17
AI Technical Summary
In the existing power system, the Hilbert transform has a large amount of calculation and poor accuracy, which makes it difficult to meet the needs of real-time voltage phase shift calculation, especially when calculating reactive power.
The Hilbert transform method based on simplified filter coefficients is adopted. Through downsampling and the symmetry of filter coefficients, the calculation formula is simplified and the Hilbert transform of three-phase voltage is dispersed into different sampling interrupts, which reduces the amount of calculation and improves the operation speed.
It significantly reduces the computational complexity of the Hilbert transform, improves the accuracy and speed of reactive energy calculation, realizes a real-time 90-degree phase shift of the voltage signal, and supports high-precision reactive energy calculation.
Smart Images

Figure CN120811322A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of analysis and processing of sampling signals of power systems, and in particular relates to a method, system and device for simplifying Hilbert transform based on filter coefficients. Background Art
[0002] During power system operation, a large number of electrical signals are generated. Accurately and rapidly analyzing and processing these signals is crucial to ensuring stable operation. As an important time-domain and frequency-domain analysis method, the Hilbert transform has played a significant role in power system low-frequency oscillation analysis, harmonic analysis, high-voltage transmission line protection, and fault diagnosis.
[0003] Currently, full-wave reactive energy calculations generally use a moving point approach to phase-shift the voltage. For scenarios requiring high reactive energy accuracy, a Hilbert transform is used to phase-shift the voltage. For even harmonics, this shifting point shifts the quarter-cycle of the fundamental wave no longer aligns 90 degrees with the harmonic. For odd harmonics, shifting the quarter-cycle of the fundamental wave results in inaccurate four-quadrant reactive energy calculations. The Hilbert transform used in existing technologies is computationally intensive and suffers from poor accuracy. Performing a real-time Hilbert transform on the voltage would not only be difficult to implement with the hardware, but would also reduce the accuracy of reactive energy calculations. Summary of the Invention
[0004] In view of the deficiencies of the prior art, the present invention discloses a method, system and device for simplifying Hilbert transform based on filter coefficients.
[0005] A method for simplifying Hilbert transform based on filter coefficients, comprising the following steps:
[0006] Obtain three-phase voltage sampling points and determine the sampling rate after downsampling based on the sampling frequency;
[0007] Calculate the filter coefficients of the Hilbert transform based on the downsampled sampling rate;
[0008] Set the Hilbert transform timer for each phase voltage;
[0009] When the Hilbert transform timer of a phase voltage reaches a preset value, the Hilbert transform of this phase voltage is calculated according to the Hilbert transform filter coefficient;
[0010] The new three-phase voltage is collected in real time, and the filter coefficient of the Hilbert transform of each phase voltage is calculated in turn and the Hilbert transform is performed.
[0011] As an implementable embodiment, the sampling rate after downsampling is 1 / 4 of the original sampling rate.
[0012] As an implementable mode, the filter coefficients of the Hilbert transform are calculated based on the sampling rate after down-sampling, and a filter order is selected according to the sampling rate;
[0013] The filter coefficient calculation formula of the Hilbert transform is:
[0014]
[0015] wherein, represents the order of the filter, represents the current order of the filter, represents the radian corresponding to 180 degrees, represents the filter coefficient of the first order of the Hilbert transform.
[0016] As an implementable mode, the filter coefficients of the Hilbert transform have symmetry, and the value in the middle interval of the filter coefficients of the Hilbert transform is 0.
[0017] As an implementable mode, a Hilbert transform timer of each phase voltage is set, the initial value of the A-phase voltage timer , the initial value of the A-phase voltage timer , the initial value of the C-phase voltage timer .
[0018] As an implementable mode, when the Hilbert transform timer of a certain phase voltage reaches a preset value, the Hilbert transform of the phase voltage is calculated according to the filter coefficients of the Hilbert transform, including the following steps:
[0019] setting the preset value;
[0020] the timer of each phase voltage is increased by 1 after collecting data each time;
[0021] when the timer of a certain phase voltage reaches the preset value, the Hilbert transform of the phase voltage is performed, and the value of the timer of the phase voltage is set to 0;
[0022] the Hilbert transforms of the three phase voltages are dispersed into different sampling interrupts.
[0023] As an implementable mode, the calculation formula of the Hilbert transform is:
[0024]
[0025] wherein, is the output value of the Hilbert transform, is the filter coefficient of the Hilbert transform, is the filter coefficient index of the Hilbert transform, is one half of the filter order, is a down-sampled voltage of the real-time buffer, is the first value of the buffer voltage, is the array size of the buffer, .
[0026] A system for simplifying Hilbert transform based on filter coefficients, comprising: a sampling rate determination module, a filter coefficient calculation module, a timer setting module, a Hilbert transform module, a cyclic transform module,
[0027] The sampling rate determination module is configured to obtain three-phase voltage sampling points and determine a down-sampled sampling rate according to a sampling frequency.
[0028] The filter coefficient calculation module is configured to calculate filter coefficients of Hilbert transform based on the down-sampled sampling rate.
[0029] The timer setting module is configured to set a Hilbert transform timer for each phase voltage.
[0030] The Hilbert transform module is configured to calculate Hilbert transform of a certain phase voltage according to the filter coefficients of Hilbert transform when the Hilbert transform timer of the certain phase voltage reaches a preset value.
[0031] The cyclic transform module is configured to collect new three-phase voltages in real time, calculate filter coefficients of Hilbert transform of each phase voltage in sequence, and perform Hilbert transform.
[0032] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following method:
[0033] Obtain three-phase voltage sampling points and determine a down-sampled sampling rate according to a sampling frequency.
[0034] Calculate filter coefficients of Hilbert transform based on the down-sampled sampling rate.
[0035] Set a Hilbert transform timer for each phase voltage.
[0036] Calculate Hilbert transform of a certain phase voltage according to the filter coefficients of Hilbert transform when the Hilbert transform timer of the certain phase voltage reaches a preset value.
[0037] Collect new three-phase voltages in real time, calculate filter coefficients of Hilbert transform of each phase voltage in sequence, and perform Hilbert transform.
[0038] An apparatus for simplifying Hilbert transform based on filter coefficients comprises a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the following method when executing the computer program:
[0039] Obtaining three-phase voltage sampling points, and determining a sampling rate after decimation according to a sampling frequency;
[0040] Based on the sampling rate after decimation, calculating filter coefficients of Hilbert transform;
[0041] Setting a Hilbert transform timer for each phase voltage;
[0042] When the Hilbert transform timer of a certain phase voltage reaches a preset value, calculating the Hilbert transform of the phase voltage according to the filter coefficients of Hilbert transform;
[0043] Real-time acquisition of new three-phase voltage, and sequential calculation of filter coefficients of Hilbert transform of each phase voltage and Hilbert transform.
[0044] The present application has the following technical effects:
[0045] 1. The technical solution of the present application reduces the order of Hilbert transform by decimation, and simplifies the calculation formula of Hilbert transform according to the symmetry of Hilbert transform coefficients, greatly reducing the calculation amount of Hilbert transform and solving the problem that real-time Hilbert transform of voltage is difficult to meet the hardware requirements;
[0046] 2. The technical solution of the present application improves the operation speed of Hilbert transform and the calculation efficiency by real-time acquisition of three-phase voltage and simplification of Hilbert transform, and realizes phase shift of 90 degrees for all integer frequency of voltage signals by Hilbert transform of voltage, thereby improving the calculation accuracy of reactive power;
[0047] 3. The present application disperses the Hilbert transform of three-phase voltage into different sampling interrupts for calculation, further reducing the calculation amount in each sampling interrupt, thereby realizing real-time phase shift of 90 degrees for three-phase voltage using Hilbert transform, and providing method support for the accuracy of reactive power calculation. BRIEF DESCRIPTION OF DRAWINGS
[0048] The following drawings are examples of the specific embodiments of the present application:
[0049] Figure 1 is a method flow diagram of the present application based on filter coefficient simplification of Hilbert transform;
[0050] Figure 2is the system overall structure schematic diagram based on the filter coefficient simplified Hilbert transform of the embodiment of the present application;
[0051] Figure 3 is the waveform diagram before and after the A-phase voltage Hilbert transform of the embodiment of the present application;
[0052] Figure 4 is the waveform diagram before and after the B-phase voltage Hilbert transform of the embodiment of the present application;
[0053] Figure 5 is the waveform diagram before and after the C-phase voltage Hilbert transform of the embodiment of the present application. DETAILED DESCRIPTION
[0054] The present application is further described below in conjunction with the accompanying drawings and embodiments, the following embodiments are the explanation of the present application and the present application is not limited to the following embodiments.
[0055] Embodiment 1:
[0056] A method for simplifying Hilbert transform based on filter coefficient, as shown in the figure, comprising the following steps: Figure 1
[0057] S100, obtaining three-phase voltage sampling points, determining the sampling rate after downsampling according to the sampling frequency;
[0058] S200, calculating the filter coefficient of Hilbert transform based on the sampling rate after downsampling;
[0059] S300, setting the Hilbert transform timer of each phase voltage;
[0060] S400, when the Hilbert transform timer of a certain phase voltage reaches the preset value, calculating the Hilbert transform of this phase voltage according to the filter coefficient of Hilbert transform;
[0061] S500, real-time acquisition of new three-phase voltage, sequentially calculating the filter coefficient of Hilbert transform of each phase voltage and performing Hilbert transform.
[0062] The technical solution of the present invention reduces the order of the Hilbert transform by downsampling, and simplifies the calculation formula of the Hilbert transform based on the symmetry of the Hilbert transform coefficient, greatly reducing the calculation amount of the Hilbert transform and solving the problem that the hardware for performing the Hilbert transform on the voltage in real time is difficult to meet. The technical solution of the present invention improves the operation speed of the Hilbert transform and the calculation efficiency by real-time acquisition of the three-phase voltage and simplifying the Hilbert transform, and improves the calculation accuracy of the reactive electric energy by performing the Hilbert transform on the voltage. The present invention disperses the Hilbert transform of the three-phase voltage into different sampling interrupts for calculation, further reducing the calculation amount in each sampling interrupt, thereby realizing real-time phase shift of the three-phase voltage by 90 degrees using the Hilbert transform, and providing method support for the accuracy of reactive electric energy calculation.
[0063] In this embodiment, step S100 obtains three-phase voltage sampling points and determines the sampling rate after downsampling according to the sampling frequency, which specifically includes the following steps:
[0064] S110: Obtain three-phase voltage sampling points;
[0065] S120: Determine a downsampled sampling rate according to the sampling frequency of the device. The downsampled sampling rate is 1 / 4 of the original sampling rate. In this embodiment, the sampling frequency of the device is 25600, and the downsampled sampling rate is 6400.
[0066] In this embodiment, step S200 calculates the Hilbert transform filter coefficients based on the downsampled sampling rate, and determines an appropriate filter order based on the sampling rate. A low filter order selected at a high sampling rate can result in large and varying amplitude attenuation at each frequency point after a 90-degree phase shift. Therefore, an appropriate filter order is selected based on the sampling rate to ensure that the amplitude attenuation at each frequency point after the phase shift is within the accuracy range.
[0067] The Hilbert transform filter coefficient calculation formula is:
[0068]
[0069] in, represents the order of the filter, Indicates the current order of the filter, Indicates the radian corresponding to 180 degrees, Indicates the filter In this embodiment, the sampling rate is 6400 and the filter order is 257.
[0070] In this embodiment, step S300 sets the Hilbert transform timer for each phase voltage, which specifically includes the following steps:
[0071] Set the Hilbert transform timer for each phase voltage, Phase voltage timer initial value , Phase voltage timer initial value , C phase voltage timer initial value .
[0072] In this embodiment, when the Hilbert transform timer of a phase voltage reaches a preset value, step S400 calculates the Hilbert transform of the phase voltage according to the Hilbert transform filter coefficient, which specifically includes the following steps:
[0073] S410: Set a preset value. In this embodiment, the preset value is 4.
[0074] S420: Each time data is collected, the timers of the three-phase voltages are incremented by 1;
[0075] S430: When a phase voltage timer reaches a preset value of 4, perform Hilbert transform on the phase voltage and set the phase voltage timer value to 0;
[0076] S440: Distribute the Hilbert transform of the three-phase voltage to different sampling interrupts, change the simultaneous phase shift of the three-phase voltage to the phase shift of the three-phase voltage in batches, disperse the calculation amount, and avoid calculating the phase shift of the three-phase voltage simultaneously in one interrupt.
[0077] The calculation formula of the Hilbert transform is:
[0078]
[0079] in, is the output value of Hilbert transform, is the filter coefficient of Hilbert transform, is the filter coefficient index of Hilbert transform, is half of the filter order, is the downsampled voltage cached in real time, The buffer voltage Value, cache The array size is .
[0080] In this embodiment, after the Hilbert transform of phase C is performed, , , At the same time, the newly collected three-phase voltages are cached separately. The comparison diagrams of the three-phase voltages before and after Hilbert transform are as follows: Figures 3-5 As shown in the figure, it can be seen that the three-phase voltages are phase-shifted by 90 degrees.
[0081] In the embodiment, step S500 collects new three-phase voltages in real time, and sequentially calculates filter coefficients of Hilbert transform of each-phase voltage and performs Hilbert transform.
[0082] The technical solution of the present application reduces the order of Hilbert transform by downsampling, and simplifies the calculation formula of Hilbert transform according to the symmetry of Hilbert transform coefficients, greatly reduces the calculation amount of Hilbert transform, and solves the problem that real-time Hilbert transform of voltage is difficult to meet the hardware requirements. The technical solution of the present application improves the operation speed of Hilbert transform by real-time collection of three-phase voltages and simplification of Hilbert transform, improves the calculation efficiency, and improves the calculation accuracy of reactive power by Hilbert transform of voltage. The present application disperses the Hilbert transform of three-phase voltage into different sampling interrupts for calculation, further reduces the calculation amount in each sampling interrupt, and realizes real-time phase shift of 90 degrees for three-phase voltage by Hilbert transform, thereby providing a method support for the accuracy of reactive power calculation.
[0083] Embodiment 2:
[0084] A system for simplifying Hilbert transform based on filter coefficients, comprising: a sampling rate determination module 100, a filter coefficient calculation module 200, a timer setting module 300, a Hilbert transform module 400, a cyclic transform module 500,
[0085] The sampling rate determination module 100 is configured to obtain three-phase voltage sampling points and determine the sampling rate after downsampling according to the sampling frequency.
[0086] The filter coefficient calculation module 200 is configured to calculate the filter coefficients of Hilbert transform based on the sampling rate after downsampling.
[0087] The timer setting module 300 is configured to set the Hilbert transform timer of each-phase voltage.
[0088] The Hilbert transform module 400 is configured to calculate the Hilbert transform of the voltage of the phase when the Hilbert transform timer of the voltage of the phase reaches the preset value according to the filter coefficients of Hilbert transform.
[0089] The cyclic transform module 500 is configured to collect new three-phase voltages in real time, sequentially calculate the filter coefficients of Hilbert transform of each-phase voltage, and perform Hilbert transform.
[0090] Various changes and modifications made without departing from the spirit and scope of the present application, all equivalent technical solutions also belong to the scope of the present application.
[0091] The various embodiments in the specification are described in progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts among the various embodiments can be mutually referred to.
[0092] Those skilled in the art will appreciate that embodiments of the application can be supplied as a method, a device, or a computer program product. Thus, the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code.
[0093] The present application is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal device produce the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks.
[0094] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including instruction apparatus that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks.
[0095] These computer program instructions can also be loaded into a computer or other programmable data processing terminal device, so that a series of operation steps are performed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks.
[0096] It should be noted that:
[0097] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, the appearances of the phrase "one embodiment" or "an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment.
[0098] Furthermore, it is noted that the specific embodiments described in the specification are merely illustrative of the application and that changes can be made in the shape, size, and arrangement of parts, as well as in the details of the steps or steps of the methods described herein, without departing from the scope of the application as defined in the claims or the patent monopoly to be obtained thereon. Any equivalent or similar changes that are made in the construction, features, or principles of the application described herein are included in the scope of the patent protection.
Claims
1. A method for simplifying Hilbert transform based on filter coefficients, characterized in that: The following steps are involved: Obtain three-phase voltage sampling points and determine the sampling rate after downsampling based on the sampling frequency; Calculate the filter coefficients of the Hilbert transform based on the downsampled sampling rate; Set the Hilbert transform timer for each phase voltage; When the Hilbert transform timer of a phase voltage reaches a preset value, the Hilbert transform of this phase voltage is calculated according to the Hilbert transform filter coefficient; The new three-phase voltage is collected in real time, and the filter coefficient of the Hilbert transform of each phase voltage is calculated in turn and the Hilbert transform is performed.
2. The method for simplifying the Hilbert transform based on filter coefficients according to claim 1, wherein: The sampling rate after downsampling is 1 / 4 of the original sampling rate.
3. The method for simplifying the Hilbert transform based on filter coefficients according to claim 1, wherein: The Hilbert transform filter coefficients are calculated based on the down-sampled sampling rate, and the filter order is selected according to the sampling rate; The Hilbert transform filter coefficient calculation formula is: ; in, represents the order of the filter, Indicates the current order of the filter, Indicates the radian corresponding to 180 degrees, Indicates the filter The filter coefficients of the Hilbert transform of order .
4. The method for simplifying the Hilbert transform based on filter coefficients according to claim 3, wherein: The filter coefficients of the Hilbert transform are symmetrical, and the filter coefficients of the Hilbert transform are separated by a value of 0.
5. The method for simplifying Hilbert transform based on filter coefficients according to claim 1, wherein: Set the Hilbert transform timer for each phase voltage, Phase voltage timer initial value , Phase voltage timer initial value , C phase voltage timer initial value .
6. The method for simplifying Hilbert transform based on filter coefficients according to claim 1, wherein: When the Hilbert transform timer of a phase voltage reaches a preset value, the Hilbert transform of the phase voltage is calculated according to the Hilbert transform filter coefficient, including the following steps: Set preset values; Each time data is collected, the timers of the three-phase voltages are incremented by 1; When a phase voltage timer reaches a preset value, the Hilbert transform is performed on the phase voltage, and the phase voltage timer value is set to 0; The Hilbert transform of the three-phase voltage is distributed into different sampling interrupts.
7. The method for simplifying Hilbert transform based on filter coefficients according to claim 3 or 6, characterized in that: The calculation formula of the Hilbert transform is: ; in, is the output value of Hilbert transform, is the filter coefficient of Hilbert transform, is the filter coefficient index of Hilbert transform, is half of the filter order, is the downsampled voltage cached in real time, The buffer voltage Value, cache The array size is .
8. A system based on simplified Hilbert transform of filter coefficients, characterized in that: include: Sampling rate determination module, filter coefficient calculation module, timer setting module, Hilbert transform module, cyclic transform module, The sampling rate determination module is used to obtain the three-phase voltage sampling points and determine the sampling rate after downsampling according to the sampling frequency; The filter coefficient calculation module is used to calculate the filter coefficient of the Hilbert transform based on the sampling rate after downsampling; The timer setting module is used to set the Hilbert transform timer of each phase voltage; The Hilbert transform module is configured to calculate the Hilbert transform of a phase voltage according to a Hilbert transform filter coefficient when the Hilbert transform timer of the phase voltage reaches a preset value; The cyclic transformation module is used to collect new three-phase voltages in real time, calculate the filter coefficients of the Hilbert transform of each phase voltage in sequence, and perform the Hilbert transform.
9. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A device for simplifying Hilbert transform based on filter coefficients, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.