Sampled data processing method, processing system and processing equipment
By determining the interval segmentation point parameters and distribution density parameters in the interpolation method, efficiently dividing the sampling interval and performing interpolation resampling, the problem of high computational complexity of the existing interpolation method is solved, and efficient and continuous signal reconstruction is achieved.
Patent Information
- Application Number
- CN202411905904.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-15
AI Technical Summary
Existing interpolation methods such as linear interpolation and Lagrange interpolation are difficult to effectively reduce the complexity of interpolation calculations under high-precision requirements and complex calculations, resulting in poor signal reconstruction results.
By determining the distribution density parameters of interval segmentation point parameters and interpolation point data, efficiently divide the sampling intervals and interpolation resample each interval to reduce the complexity of interpolation calculation.
It improves the efficiency and real-time nature of signal reconstruction, generates continuous and smooth interpolation sequences, and significantly improves the continuity and accuracy of data.
Smart Images

Figure CN119834807A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric energy meters, and in particular to a method, a system and a device for processing sampled data. Background Art
[0002] In the field of power metering, in order to accurately reconstruct power signals, perform harmonic analysis and data smoothing, it is usually necessary to resample discrete sampling points through an interpolation algorithm to restore continuous signals and improve signal accuracy and continuity.
[0003] Currently, the commonly used interpolation methods include linear interpolation and Lagrange interpolation algorithm. The linear interpolation method is simple to calculate, but the accuracy is low and cannot meet the high-precision requirements; although the Lagrange interpolation algorithm has high accuracy, it is computationally complex, especially when there are many interpolation points, it is prone to overfitting, resulting in poor signal reconstruction effect. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, system and device for processing sampled data, which can efficiently divide the sampling intervals and perform interpolation and resampling on each interval, thereby reducing the complexity of interpolation calculations and improving the continuity and accuracy of data.
[0005] In a first aspect, an embodiment of the present invention provides a method for processing sampling data, comprising: obtaining a sampling value sequence of an input signal; the sampling value sequence includes sampling point data of a preset number of sampling data; based on the preset number of sampling data and the preset number of interpolation data, determining the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data; based on the interval segmentation point parameters, dividing the sampling value sequence into multiple sampling intervals; based on the distribution density parameters, interpolating and resampling each sampling interval respectively to obtain interpolation point data; based on the interpolation point data, generating an interpolation sequence; the interpolation sequence includes interpolation point data of a preset number of interpolation data.
[0006] Furthermore, the method also includes: performing harmonic analysis on the interpolation sequence through a preset Fourier transform method to obtain harmonic analysis results; the harmonic analysis results include the amplitude and phase values corresponding to each harmonic; based on the harmonic analysis results, calculating power harmonic parameters; the power harmonic parameters include each harmonic voltage, each harmonic current and total harmonic active power.
[0007] Furthermore, after the step of obtaining a sampling value sequence of the input signal, the method also includes: generating a sampling data curve based on the sampling value sequence; the horizontal axis of the sampling data curve is used to characterize the sampling order, and the vertical axis of the sampling data curve is used to characterize the sampling point data corresponding to the sampling order; the minimum value of the horizontal axis of the sampling data curve is 0, and the maximum value is the preset number of sampling data - 1.
[0008] Furthermore, before the step of determining the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data based on the preset number of sampling data and the preset number of interpolation data, the method also includes: determining the interpolation scaling ratio based on the ratio of the preset number of sampling data and the preset number of interpolation data; determining the initial interpolation point horizontal coordinate sequence corresponding to the interpolation point data in the sampling data curve based on the preset number of interpolation data; the initial interpolation point horizontal coordinate sequence includes the initial interpolation point horizontal coordinates of the preset number of interpolation data, the minimum value of the initial interpolation point horizontal coordinate is 0, and the maximum value is the preset number of interpolation data-1; multiplying the interpolation scaling ratio by the initial interpolation point horizontal coordinate sequence to obtain the interpolation point horizontal coordinate sequence corresponding to the interpolation point data; the interpolation point horizontal coordinate sequence includes the interpolation point horizontal coordinates of the preset number of interpolation data.
[0009] Further, based on the preset number of sampling data and the preset number of interpolation data, the step of determining the interval segmentation point parameter corresponding to the sampling value sequence and the distribution density parameter corresponding to the interpolation point data includes: calculating the least common multiple of the preset number of sampling data and the preset number of interpolation data; the interval segmentation point parameter is calculated by the following formula: Where a is the interval segmentation point parameter, S is the least common multiple, and N is the number of preset interpolation data; the distribution density parameter is calculated by the following formula: Among them, b is the distribution density parameter, and M is the preset number of sampling data.
[0010] Furthermore, based on the interval segmentation point parameter, the step of dividing the sampling value sequence into multiple sampling intervals includes: marking an interpolation segmentation point at each interval segmentation point parameter, and an initial sampling interval is formed between every two interpolation segmentation points; and extending the sampling intervals except the first sampling interval so that the starting point of the current sampling interval coincides with the end point of the previous sampling interval to obtain the sampling interval.
[0011] Furthermore, based on the distribution density parameters, each sampling interval is interpolated and resampled respectively to obtain the step of interpolation point data, including: based on the distribution density parameters, determining the interpolation point horizontal coordinate corresponding to each sampling interval; when the sampling interval is the first sampling interval, based on the first interpolation point horizontal coordinate corresponding to the first sampling interval and the preset first Lagrange interpolation polynomial, calculating the interpolation point data corresponding to the first interpolation point horizontal coordinate; when the sampling interval is other sampling intervals, based on the other interpolation point horizontal coordinates corresponding to each other sampling interval and the preset second Lagrange interpolation polynomial, calculating the interpolation point data corresponding to each other interpolation point horizontal coordinate.
[0012] Furthermore, the first Lagrange interpolation polynomial is preset as:
[0013] Among them, L1(Bx) is the interpolation point data, Bx is the horizontal coordinate of the interpolation point, Ay i is the ordinate of the sampling data curve, Ax i Ax is the horizontal coordinate of the sampling data curve corresponding to the node being processed in the current sampling interval; j is the horizontal coordinate of the sampling data curve corresponding to other nodes; the preset second Lagrange interpolation polynomial is: Among them, Ax min It is the minimum value of the horizontal axis of the sampling data curve in the current interval.
[0014] In a second aspect, an embodiment of the present invention provides a sampling data processing system, comprising: a sampling module, used to obtain a sampling value sequence of an input signal; the sampling value sequence includes sampling point data of a preset number of sampling data; an interval segmentation module, used to determine the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data based on the preset number of sampling data and the preset number of interpolation data; the interval segmentation module is also used to divide the sampling value sequence into multiple sampling intervals based on the interval segmentation point parameters; an interpolation point data acquisition module is used to interpolate and resample each sampling interval based on the distribution density parameters to obtain interpolation point data; the interpolation point data acquisition module is also used to generate an interpolation sequence based on the interpolation point data; the interpolation sequence includes interpolation point data of a preset number of interpolation data.
[0015] In a third aspect, an embodiment of the present invention provides a processing device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described above when executing the computer program.
[0016] The embodiment of the present invention provides a method, system and device for processing sampled data, including: obtaining a sampled value sequence of an input signal; the sampled value sequence includes sampled point data of a preset number of sampled data; based on the preset number of sampled data and the preset number of interpolated data, determining the interval segmentation point parameters corresponding to the sampled value sequence and the distribution density parameters corresponding to the interpolated point data; based on the interval segmentation point parameters, dividing the sampled value sequence into a plurality of sampled intervals; based on the distribution density parameters, interpolating and resampling each sampled interval respectively to obtain interpolated point data; based on the interpolated point data, generating an interpolated sequence; the interpolated sequence includes interpolated point data of a preset number of interpolated data. In this method, by determining the interval segmentation point parameters and the distribution density parameters of the interpolated point data, the sampled intervals can be efficiently divided and each interval can be interpolated and resampled, which can reduce the complexity of the interpolation calculation, thereby improving the efficiency and real-time performance of signal reconstruction, and then generating a continuous and smooth interpolated sequence, significantly improving the continuity and accuracy of the data.
[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A flow chart of a method for processing sampled data provided by an embodiment of the present invention;
[0021] Figure 2 A flow chart of a method for calculating a sequence of abscissas of interpolation points provided by an embodiment of the present invention;
[0022] Figure 3 A flow chart of a method for calculating power harmonic parameters provided by an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of a sampling data curve provided by an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of sampling points and interpolation points provided by an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of a sampling interval provided in an embodiment of the present invention;
[0026] Figure 7 A schematic diagram of a sampled data curve after interpolation provided by an embodiment of the present invention;
[0027] Figure 8 A schematic diagram of a sampling data processing system provided by an embodiment of the present invention;
[0028] Fig. 9 A schematic diagram of another sampling data processing system provided by an embodiment of the present invention.
[0029] Icon: 1-sampling module; 2-interval segmentation module; 3-interpolation point data acquisition module; 4-calculation and analysis module. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] In the field of power metering, interpolation algorithms can be used for signal reconstruction, that is, through known discrete sampling points, interpolation algorithms are used to estimate the values of unknown sampling points to obtain a continuous signal representation. This is very important in digital signal processing and communication systems, and can help restore the continuity and accuracy of the original signal. Interpolation algorithms are of great significance in the field of signal sampling, and can help improve the accuracy and continuity of signals, thereby having a positive impact on aspects such as signal processing and analysis.
[0032] The general linear interpolation has a large loss of precision, and the precision of the interpolated data cannot meet the requirements. The current mainstream implementation method is the Lagrange interpolation algorithm, which is widely used to solve polynomial interpolation problems. Lagrange interpolation has been widely used in numerical analysis and engineering fields. In the field of metrology, it is often necessary to interpolate experimental data to obtain the estimated value of missing data points, or to smooth the data for further analysis and modeling.
[0033] However, when there are many interpolation points, Lagrange interpolation has high requirements for chip operation and poor practicality. The main reasons are:
[0034] High computational complexity: The computational complexity of the Lagrange interpolation algorithm is high, especially when there are many data points. This will cause the algorithm to run for a long time, thus affecting the real-time performance of the interpolation.
[0035] Overfitting problem: The Lagrange interpolation algorithm may have the problem of overfitting. Overfitting will cause the interpolation function to fluctuate excessively between data points, thus affecting the accuracy of the interpolation result.
[0036] In addition, most of the existing technical solutions select algorithms such as linear and Lagrange interpolation algorithms based on the scenario and computing power. In different situations, a large number of manual parameter adjustments and algorithm comparisons are required, which lack regularity and efficiency.
[0037] The processing method of sampled data provided in this embodiment can reduce the computational complexity through interval segmentation and interpolation resampling mechanism, thereby improving interpolation efficiency and real-time performance; at the same time, based on distribution density parameters and multi-segment interpolation method, it ensures the smoothness and reconstruction accuracy of the signal. A signal processing flow with wide applicability, good interpolation effect and strong adaptability is realized, providing a high-precision and efficient solution for signal reconstruction, harmonic analysis and subsequent data processing.
[0038] To facilitate understanding of this embodiment, the embodiment of the present invention is described in detail below.
[0039] Embodiment 1:
[0040] Figure 1 A flow chart of a method for processing sampled data provided by an embodiment of the present invention.
[0041] Reference Figure 1 , the processing method of sampling data includes:
[0042] Step S101, obtaining a sampling value sequence of an input signal; the sampling value sequence includes sampling point data of a preset number of sampling data.
[0043] Here, the input signal is sampled by a sampling circuit to obtain a complete cycle or a sequence of sampling values of multiple cycles. The input signal may be a current signal or a voltage signal, etc.
[0044] The sampling value sequence includes a preset number M of continuous sampling points.
[0045] In one embodiment, after step S101, the method further includes:
[0046] A sampling data curve is generated based on the sampling value sequence; the horizontal axis of the sampling data curve is used to represent the sampling order, and the vertical axis of the sampling data curve is used to represent the sampling point data corresponding to the sampling order; the minimum value of the horizontal axis of the sampling data curve is 0, and the maximum value is the preset number of sampling data-1.
[0047] Here, the sampling data curve is used to visualize the sampling point distribution and signal change trend.
[0048] The sampling data curve is represented by a function graph consisting of M discrete sampling points, and the position of each point is represented by the horizontal coordinate Ax m and the vertical coordinate Ay m Decide.
[0049] Among them, the horizontal axis Ax m Indicates the order of sampling points in the sampling sequence, which is used to describe the distribution of the signal in time or space (that is, the position of the sampling point in the sampling period, with a value range of 0, 1, ..., M-1).
[0050] Ax m The minimum value is 0, indicating that the sampling sequence starts from the first sampling point. The maximum value is M-1, indicating the end point of the sampling data, corresponding to the preset number of sampling data minus 1. The horizontal axis interval is 1, reflecting the uniform distribution of the sampling points in the sampling period.
[0051] The horizontal axis can intuitively reflect the timing changes or spatial distribution of the signal in the entire sampling period.
[0052] Vertical coordinate Ay m Indicates the signal value corresponding to the sampling point, which is used to describe the amplitude change of the signal (that is, the input signal value corresponding to the sampling point).
[0053] Each ordinate value corresponds one-to-one to the abscissa of the sampling point, forming the complete information of the sampling point.
[0054] The vertical axis reflects the change of signal strength or amplitude with the sampling order, which is used to show the dynamic characteristics of the input signal.
[0055] Arrange the sampling points in the order of the horizontal coordinates, use the data of each sampling point as the vertical coordinate, and connect these points through broken lines or interpolation polynomials to form a sampling data curve.
[0056] Step S102, based on a preset number of sampling data and a preset number of interpolation data, determining interval segmentation point parameters corresponding to the sampling value sequence and distribution density parameters corresponding to the interpolation point data.
[0057] Here, according to the number M of sampling points in the sampling value sequence and the number N of preset interpolation data points, the interval segmentation point parameter a and the distribution density parameter b corresponding to the interpolation point data are calculated.
[0058] The interval split point parameter is used to divide the interval, indicating the sampling point interval between every two split points. The distribution density parameter is used to determine the distribution density of the interpolation points in each interval.
[0059] The preset number of sampling data and the preset number of interpolation data are both preset according to actual conditions, and the optimal value of the preset number of sampling data is 3 times the preset number of interpolation data.
[0060] In one embodiment, step S102 includes:
[0061] Calculate the least common multiple of the preset number of sampling data and the preset number of interpolation data.
[0062] Here, the least common multiple is used to coordinate the distribution relationship between the interpolation points and the sampling points, unify the ratio of interval segmentation and interpolation point distribution, ensure a uniform distribution between the sampling points and the interpolation points, and avoid data omission or redundancy.
[0063] The interval segmentation point parameters are calculated using the following formula (1):
[0064]
[0065] Wherein, a is the interval segmentation point parameter, S is the least common multiple, N is the number of preset interpolation data, and a+1 is the number of sampling points contained in each sampling interval.
[0066] Here, the larger a is, the more sampling points the interval covers, and the higher the order of the Lagrangian difference polynomial is.
[0067] The distribution density parameter is calculated by the following formula (2):
[0068]
[0069] Wherein, b is the distribution density parameter, M is the preset number of sampling data, and b+1 is the number of interpolation points contained in each sampling interval.
[0070] Here, the larger the value of b, the denser the distribution of interpolation points and the finer the interpolation result.
[0071] For example, when M=320, N=256, S=1280, a=4, b=3.
[0072] In one embodiment, referring to Figure 2 Before step S102, the method further includes:
[0073] Step S201, determining an interpolation scaling ratio based on a ratio between a preset number of sampling data and a preset number of interpolation data.
[0074] Here, the interpolation scaling ratio K is the proportional relationship between the number of sampling points and the number of interpolation points, and is used to uniformly scale the horizontal coordinate distribution of the interpolation points so that the horizontal coordinates of the interpolation points correspond to the horizontal coordinates of the sampling points.
[0075] For example, when M=320, N=256, K=1.25.
[0076] Step S202, based on the preset number of interpolation data, determine the initial interpolation point horizontal coordinate sequence corresponding to the interpolation point data in the sampling data curve; the initial interpolation point horizontal coordinate sequence includes the initial interpolation point horizontal coordinates of the preset number of interpolation data, the minimum value of the initial interpolation point horizontal coordinate is 0, and the maximum value is the preset number of interpolation data-1.
[0077] Here, the initial interpolation point abscissa sequence is used to determine the position of the interpolation point in the sampled data curve.
[0078] Initial interpolation point horizontal coordinate sequence Bx cStarting from 0, it increases in integer sequence. The minimum value is 0, indicating the starting point of the interpolation point, and the maximum value is N-1, indicating the end point of the interpolation point. The initial interpolation point horizontal coordinate sequence is Bx c =[Bx0,Bx1,Bx2,Bx3,...,Bx N-1 ].
[0079] The initial interpolation point abscissa sequence is only used to generate the abscissa of the interpolation point, which is subsequently transformed by the interpolation scaling ratio K.
[0080] Step S203, multiplying the interpolation scaling ratio by the initial interpolation point horizontal coordinate sequence to obtain an interpolation point horizontal coordinate sequence corresponding to the interpolation point data; the interpolation point horizontal coordinate sequence includes interpolation point horizontal coordinates of a preset number of interpolation data.
[0081] Here, the interpolation scaling ratio K is used to uniformly scale the initial interpolation point horizontal coordinate sequence to generate the interpolation point horizontal coordinate sequence Bx n =[KBx0,KBx1,KBx2,KBx3,...,KBx N-1 ].
[0082] The interpolation point abscissa in each interpolation point abscissa sequence is calculated by scaling the initial interpolation point abscissa by K.
[0083] For example, when M = 320, N = 256, K = 1.25. The initial interpolation point horizontal coordinate sequence is Bx c [0,1,2,…,255].
[0084] Interpolation point horizontal coordinate sequence Bx n is [0,1.25,2.5,…,318.75].
[0085] Step S103: dividing the sampling value sequence into a plurality of sampling intervals based on the interval segmentation point parameters.
[0086] In one embodiment, step S103 includes:
[0087] Each interval segmentation point parameter marks an interpolation segmentation point, and an initial sampling interval is formed between every two interpolation segmentation points.
[0088] Here, the interpolation segmentation point is a specific position point extracted from the sampling value sequence according to the interval segmentation point parameter a, marking the boundary of each sampling interval.
[0089] The initial sampling interval is composed of a sequence of sampling values between two adjacent interpolation segmentation points, and each sampling interval contains a+1 sampling points.
[0090] Ax kis the horizontal coordinate of the segmentation point, and the initial sampling interval range can be expressed as: [Ax k ,Ax k+a ].
[0091] The sampling intervals other than the first sampling interval are extended so that the starting point of the current sampling interval coincides with the ending point of the previous sampling interval, thereby obtaining the sampling interval.
[0092] Here, based on the first sampling interval, the starting points of other sampling intervals are adjusted to coincide with the end points of the previous interval. The first sampling interval remains unchanged.
[0093] By marking the interpolation segmentation points and expanding the intervals, the range of all sampling intervals is finally determined, and each sampling interval is used for subsequent interpolation calculations. After expansion, the sampling intervals except the first sampling interval contain a+2 sampling points. The boundaries of the expanded intervals overlap to ensure that there are no data gaps between adjacent intervals.
[0094] The expanded sampling interval (except the first sampling interval) can be expressed as: [Ax k-1 ,Ax k+a ].
[0095] Specifically, M=320, N=256, S=1280, and a=4 is calculated.
[0096] Starting from the first point Ax0 of the sample value sequence, the segmentation points are marked according to the interval of the interval segmentation point parameter a: Ax k =[Ax0,Ax4,Ax9,Ax 14 ,...,Ax 319 ]. The interval between each segmentation point is a+1=5.
[0097] In the initial sampling interval, the first sampling interval is: [Ax0, Ax4], the second sampling interval is: [Ax5, Ax9], and the third sampling interval is: [Ax 10 ,Ax 14 ], and so on.
[0098] After the initial sampling interval is expanded, the second sampling interval is [Ax4, Ax9], and the third sampling interval is: [Ax9, Ax 14 ], and so on.
[0099] Step S104: Based on the distribution density parameter, interpolation resampling is performed on each sampling interval to obtain interpolation point data.
[0100] Here, in each sampling interval, interpolation resampling is performed based on a preset Lagrange interpolation polynomial according to the distribution density parameter b, and the abscissa and ordinate of the interpolation point are calculated.
[0101] In one embodiment, step S104 includes:
[0102] Based on the distribution density parameter, the horizontal coordinate of the interpolation point corresponding to each sampling interval is determined.
[0103] Here, the distribution density parameter b represents the distribution density of the interpolation point in each sampling interval, and is used to determine the horizontal coordinate of the interpolation point.
[0104] In the first sampling interval, b+1 interpolation points are evenly distributed, and in the second sampling interval, b+2 difference points are evenly distributed.
[0105] Based on the distribution density parameter and the interpolation point abscissa sequence, the interpolation point abscissas within the sampling interval (except the first sampling interval) are determined.
[0106] For example: when the first sampling interval is [Ax0, Ax4], and the distribution density parameter b = 3, the abscissa Bx of the interpolation point in the first sampling interval is n =[0,1.25,2.5,3.75].
[0107] When the sampling interval is the first sampling interval, interpolation point data corresponding to the first interpolation point abscissa is calculated based on the first interpolation point abscissa corresponding to the first sampling interval and a preset first Lagrange interpolation polynomial.
[0108] Here, the first sampling interval uses a low-order Lagrange interpolation polynomial to calculate the interpolation point data to reduce the computational complexity.
[0109] The preset first Lagrange interpolation polynomial is shown in the following formula (3):
[0110]
[0111] Among them, L1(Bx) is the interpolation point data, Bx is the horizontal coordinate of the interpolation point, Ay i is the ordinate of the sampling data curve, Ax i Ax is the horizontal coordinate of the sampling data curve corresponding to the node being processed in the current sampling interval; j It is the horizontal coordinate of the sampling data curve corresponding to other nodes.
[0112] When the sampling interval is another sampling interval, interpolation point data corresponding to the abscissa of each other interpolation point is calculated based on the abscissa of the other interpolation points corresponding to each other sampling interval and a preset second Lagrange interpolation polynomial.
[0113] Here, other sampling intervals may use higher-order Lagrange interpolation polynomials to improve interpolation accuracy. The higher-order interpolation polynomials ensure smoothness and accuracy of interpolation points, especially at interval boundaries.
[0114] The preset second Lagrange interpolation polynomial is shown in the following formula (4):
[0115]
[0116] Among them, Ax min It is the minimum value of the horizontal axis of the sampling data curve in the current interval.
[0117] Bx in the current sampling interval n Substitute L1(Bx) or L2(Bx) to calculate the ordinate of each interpolation point in the current sampling interval By n (i.e. interpolation point data).
[0118] Step S105 : generating an interpolation sequence based on the interpolation point data; the interpolation sequence includes interpolation point data of a preset number of interpolation data.
[0119] Here, the interpolation points in each sampling interval are merged into a complete interpolation sequence.
[0120] In one embodiment, referring to Figure 3 , the method further comprises:
[0121] Step S301, performing harmonic analysis on the interpolation sequence by using a preset Fourier transform method to obtain a harmonic analysis result; the harmonic analysis result includes the amplitude and phase value corresponding to each harmonic.
[0122] Here, the preset Fourier transform method may be FFT (Fast Fourier Transform) or DFT (Discrete Fourier Transform).
[0123] The interpolation sequence is converted from a time domain signal to a frequency domain signal through a preset Fourier transform method and decomposed into different frequency components (fundamental wave and harmonic wave) for analyzing the spectral characteristics of the signal.
[0124] The amplitude indicates the strength of each harmonic and is used to quantify the impact of harmonics on the signal. The amplitude of the fundamental wave (1st harmonic) is usually the largest, and the amplitudes of other harmonics decrease.
[0125] Phase represents the relative phase difference of each harmonic and is used to describe the relative position of the harmonics in time.
[0126] Step S302, based on the harmonic analysis result, calculate the power harmonic parameters; the power harmonic parameters include each harmonic voltage, each harmonic current and total harmonic active power.
[0127] Here, based on the harmonic analysis results, the key harmonic indicators in the power system are calculated, including harmonic voltage, harmonic current and total harmonic active power.
[0128] Each harmonic voltage and current describes the contribution of each harmonic component to the system voltage and current, and is used to analyze the characteristics of specific harmonics and their impact on system operation.
[0129] Total harmonic active power represents the overall impact of harmonics on system power and is an important indicator for evaluating system power quality.
[0130] By analyzing the amplitude and phase of each harmonic, the degree of harmonic pollution in the power system can be evaluated and the main harmonic sources can be determined. According to the harmonic parameters, a reasonable filter design scheme can be formulated to suppress harmonics of specific frequencies and improve the stability of the power system. By monitoring harmonic parameters in real time, power equipment can be dynamically adjusted to optimize the operating status. By monitoring harmonic characteristics, faults can be discovered and located in a timely manner to avoid equipment damage or grid failure.
[0131] The above embodiment is further described below in conjunction with some specific implementation methods.
[0132] The sampling value sequence of the input signal is obtained through the sampling circuit. The number of sampling data is M = 320, and the horizontal coordinate of each sampling point is Ax m , the corresponding ordinate is Ay m , where m = 0, 1, ..., 319. The sequence of these sampling points is used for signal reconstruction.
[0133] Reference Figure 4 The sampled data curve is generated based on the sampled value sequence. The horizontal axis: represents the time or the order of the sampling points (0 to 320 sampling points). The vertical axis: represents the signal amplitude. The sampled data curve is obtained through sampling. The sampling points are discrete, but because the data points are dense, the waveform looks close to continuous. Figure 4 The sampling data distribution of the original signal is displayed, reflecting the volatility and periodicity characteristics of the sampled signal.
[0134] The number of interpolation data is set to N=256, and the interpolation scaling ratio calculated based on M and N is K=1.25.
[0135] Through the interpolation scaling ratio, the horizontal coordinate sequence of the interpolation points is determined as: Bx n is [0,1.25,2.5,…,318.75].
[0136] The least common multiple of M and N is calculated to be S=1280, and the interval segmentation point parameter a=4 and the distribution density parameter b=3 are determined.
[0137] Based on the interval segmentation point parameter a=4, the sampling value sequence is divided into multiple initial sampling intervals, and the other sampling intervals except the first sampling interval are expanded to obtain multiple sampling intervals: [Ax0, Ax4], [Ax4, Ax9], [Ax9, Ax 14 ],...,[Ax 314 ,Ax 319 ].
[0138] Reference Figure 5 , shows the data points before and after interpolation, mainly distinguishing the two by different colors and coordinates. The blue points are sampling points before interpolation, and the red hollow points are interpolation points after interpolation. The horizontal axis represents the position of the data points, and the vertical axis represents the signal amplitude. The interpolation point data points after interpolation are denser than the sampling points and are distributed between the sampling points. Every 5 sampling points will have a point with exactly the same coordinates after interpolation. Through the interpolation method, new points are added between the sampling points to obtain a dense data distribution, and smooth intermediate data is added on the basis of maintaining the original points.
[0139] Reference Figure 6 , marks the sampling interval during interpolation calculation, and the red rectangular box marks each sampling interval and the distribution of interpolation points. The sampling points are divided into multiple small sampling intervals (for example, the points in the box). Lagrange interpolation is performed inside each sampling interval, and the newly added interpolation points (red hollow points) are distributed between the sampling points. The interpolation in each sampling interval maintains local smoothness, reduces the computational complexity and improves the interpolation accuracy. The global interpolation is split into multiple sampling intervals to reduce the overfitting problem of high-order polynomial interpolation. Each interval is moderately expanded outward to improve the boundary accuracy of the interpolation. Through the sampling interval, the interpolation calculation can be completed more efficiently and stably.
[0140] Based on the sampling interval, determine that the horizontal coordinate of the interpolation point corresponding to the first sampling interval is Bx n =[0,1.25,2.5,3.75].
[0141] Substitute the interpolation point abscissa corresponding to the first sampling interval into the preset first Lagrange interpolation polynomial, and calculate the ordinate corresponding to the abscissa of each interpolation point By n .
[0142] Based on the sampling interval, determine the interpolation point abscissas corresponding to other sampling intervals as the interpolation point abscissa sequence Bx n is [5, 6.25, 7.5, 8.75], … [315, 316.25, 317.5, 318.75].
[0143] Substitute the horizontal coordinates of the interpolation points corresponding to other sampling intervals into the preset second Lagrange interpolation polynomial, and calculate the vertical coordinate corresponding to the horizontal coordinate of each interpolation point Byn .
[0144] After interpolation, we get Figure 7 , refer to Figure 7 The sampling points and the interpolated points after the difference are shown. The horizontal axis represents the order or time axis of the sampling points (the unit is the sampling point index). The vertical axis is the signal amplitude corresponding to the sampling point. Before interpolation (blue curve):
[0145] The sampled data points consist of 320 sample points, which appear as discrete points on the waveform (the individual points are not highlighted in the figure). After interpolation (orange curve):
[0146] Based on the piecewise Lagrange interpolation algorithm, the new data is obtained by resampling, and the number of interpolated points is 256. The orange curve is a smoother waveform, densely distributed between the original sampling points.
[0147] After interpolation, the data points are more continuous and smoother, which is basically consistent with the original sampling data, without obvious overfitting or fluctuation distortion.
[0148] The sampling point data and the interpolated data curve almost overlap, proving the accuracy and high fidelity of the interpolation.
[0149] The interpolated waveform provides denser and smoother sampling points for the subsequent Fourier transform, which helps to accurately extract harmonic parameters (amplitude and phase) for power quality analysis.
[0150] Through interpolation, the data information between the original sampling points is supplemented, and the accuracy of signal reconstruction is improved. The interpolated curve is more continuous and smooth, which is conducive to subsequent frequency domain analysis (such as Fourier transform).
[0151] Through interpolation resampling, signal reconstruction from 320 original sampling points to 256 interpolation points was successfully achieved. The interpolated waveform was highly consistent with the original waveform, laying a data foundation for further harmonic analysis.
[0152] The interpolation point data of all sampling intervals are combined to generate a complete interpolation sequence, and the interpolation sequence is subjected to fast Fourier transform (FFT) to obtain the amplitude and phase of each harmonic. According to the results of Fourier transform, the harmonic voltage, harmonic current and total harmonic active power are calculated. The measured 41st harmonic amplitude error is 1.897586×10 -5 , reducing the 41st harmonic error to less than one ten-thousandth, optimizing the use of hardware resources and meeting the accuracy requirements of power metering.
[0153] The embodiment of the present invention provides a method for processing sampling data, including: obtaining a sampling value sequence of an input signal; the sampling value sequence includes sampling point data of a preset number of sampling data; based on the preset number of sampling data and the preset number of interpolation data, determining the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data; based on the interval segmentation point parameters, dividing the sampling value sequence into multiple sampling intervals; based on the distribution density parameters, interpolating and resampling each sampling interval respectively to obtain interpolation point data; based on the interpolation point data, generating an interpolation sequence; the interpolation sequence includes interpolation point data of a preset number of interpolation data. In this method, by determining the interval segmentation point parameters and the distribution density parameters of the interpolation point data, the sampling interval can be efficiently divided and each interval can be interpolated and resampled, which can reduce the complexity of the interpolation calculation, thereby improving the efficiency and real-time performance of signal reconstruction, and then generating a continuous and smooth interpolation sequence, significantly improving the continuity and accuracy of the data.
[0154] Embodiment 2:
[0155] Figure 8 A schematic diagram of a sampling data processing system provided by an embodiment of the present invention.
[0156] Reference Figure 8 , the sampling data processing system includes:
[0157] The sampling module 1 is used to obtain a sampling value sequence of an input signal; the sampling value sequence includes sampling point data of a preset number of sampling data.
[0158] The interval segmentation module 2 is used to determine the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data based on the preset number of sampling data and the preset number of interpolation data.
[0159] The interval segmentation module 2 is further used to divide the sampling value sequence into multiple sampling intervals based on the interval segmentation point parameters.
[0160] The interpolation point data acquisition module 3 is used to perform interpolation resampling on each sampling interval based on the distribution density parameter to obtain interpolation point data.
[0161] The interpolation point data acquisition module 3 is further used to generate an interpolation sequence based on the interpolation point data; the interpolation sequence includes interpolation point data of a preset number of interpolation data.
[0162] In one embodiment, the sampling module 1 is further used for:
[0163] A sampling data curve is generated based on the sampling value sequence; the horizontal axis of the sampling data curve is used to represent the sampling order, and the vertical axis of the sampling data curve is used to represent the sampling point data corresponding to the sampling order; the minimum value of the horizontal axis of the sampling data curve is 0, and the maximum value is the preset number of sampling data-1.
[0164] In one embodiment, the interval segmentation module 2 is further used for:
[0165] The interpolation scaling ratio is determined based on the ratio of the preset number of sampling data to the preset number of interpolation data.
[0166] Based on the preset number of interpolation data, determine the initial interpolation point horizontal coordinate sequence corresponding to the interpolation point data in the sampling data curve; the initial interpolation point horizontal coordinate sequence includes the initial interpolation point horizontal coordinates of the preset number of interpolation data, and the minimum value of the initial interpolation point horizontal coordinate is 0, and the maximum value is the preset number of interpolation data-1.
[0167] The interpolation scaling ratio is multiplied by the initial interpolation point horizontal coordinate sequence to obtain an interpolation point horizontal coordinate sequence corresponding to the interpolation point data; the interpolation point horizontal coordinate sequence includes interpolation point horizontal coordinates of a preset number of interpolation data.
[0168] In one embodiment, the interval segmentation module 2 is further used for:
[0169] Calculate the least common multiple of the preset number of sampling data and the preset number of interpolation data.
[0170] The interval split point parameters are calculated using the following formula:
[0171]
[0172] Among them, a is the interval segmentation point parameter, S is the lowest common multiple, and N is the number of preset interpolation data.
[0173] The distribution density parameter is calculated by the following formula:
[0174]
[0175] Among them, b is the distribution density parameter, and M is the preset number of sampling data.
[0176] In one embodiment, the interval segmentation module 2 is further used for:
[0177] Each interval segmentation point parameter marks an interpolation segmentation point, and an initial sampling interval is formed between every two interpolation segmentation points.
[0178] The sampling intervals other than the first sampling interval are extended so that the starting point of the current sampling interval coincides with the ending point of the previous sampling interval to obtain the sampling interval.
[0179] In one embodiment, the interpolation point data acquisition module 3 is further used for:
[0180] Based on the distribution density parameter, the horizontal coordinate of the interpolation point corresponding to each sampling interval is determined.
[0181] When the sampling interval is the first sampling interval, interpolation point data corresponding to the first interpolation point abscissa is calculated based on the first interpolation point abscissa corresponding to the first sampling interval and a preset first Lagrange interpolation polynomial.
[0182] When the sampling interval is another sampling interval, interpolation point data corresponding to the abscissa of each other interpolation point is calculated based on the abscissa of the other interpolation points corresponding to each other sampling interval and a preset second Lagrange interpolation polynomial.
[0183] In one embodiment, the interpolation point data acquisition module 3 is further used for:
[0184] The first Lagrange interpolation polynomial is preset as:
[0185]
[0186] Among them, L1(Bx) is the interpolation point data, Bx is the horizontal coordinate of the interpolation point, Ay i is the ordinate of the sampling data curve, Ax i Ax is the horizontal coordinate of the sampling data curve corresponding to the node being processed in the current sampling interval; j is the horizontal coordinate of the sampling data curve corresponding to other nodes;
[0187] The preset second Lagrange interpolation polynomial is:
[0188]
[0189] Among them, Ax min It is the minimum value of the horizontal axis of the sampling data curve in the current interval.
[0190] In one embodiment, referring to Fig. 9 The sampling data processing system further includes: a calculation and analysis module 4, the calculation and analysis module 4 is used to:
[0191] The harmonic analysis of the interpolation sequence is performed by a preset Fourier transform method to obtain a harmonic analysis result; the harmonic analysis result includes the amplitude and phase value corresponding to each harmonic.
[0192] Based on the harmonic analysis results, the power harmonic parameters are calculated; the power harmonic parameters include each harmonic voltage, each harmonic current and total harmonic active power.
[0193] An embodiment of the present invention provides a system for processing sampling data. In this method, by determining the interval segmentation point parameters and the distribution density parameters of the interpolation point data, the sampling interval can be efficiently divided and each interval can be interpolated and resampled, which can reduce the complexity of the interpolation calculation, thereby improving the efficiency and real-time performance of signal reconstruction, and further generating a continuous and smooth interpolation sequence, significantly improving the continuity and accuracy of the data.
[0194] An embodiment of the present invention further provides a processing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the sampling data processing method provided in the above embodiment are implemented.
[0195] The computer program product provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0196] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0197] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0198] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0199] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0200] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for processing sampling data, characterized in that: include: Get the sampling value sequence of the input signal; The sampling value sequence includes sampling point data of a preset number of sampling data; Based on the preset number of sampling data and the preset number of interpolation data, determining interval segmentation point parameters corresponding to the sampling value sequence and distribution density parameters corresponding to the interpolation point data; Based on the interval segmentation point parameter, the sampling value sequence is divided into a plurality of sampling intervals; Based on the distribution density parameter, interpolation resampling is performed on each sampling interval to obtain the interpolation point data; Based on the interpolation point data, an interpolation sequence is generated; the interpolation sequence includes the interpolation point data of the preset number of interpolation data.
2. The method for processing sampling data according to claim 1, characterized in that: The method further comprises: Performing harmonic analysis on the interpolation sequence by a preset Fourier transform method to obtain a harmonic analysis result; the harmonic analysis result includes the amplitude and phase value corresponding to each harmonic; Based on the harmonic analysis results, power harmonic parameters are calculated; the power harmonic parameters include each harmonic voltage, each harmonic current and total harmonic active power.
3. The method for processing sampling data according to claim 1, characterized in that: After the step of acquiring a sampling value sequence of the input signal, the method further comprises: A sampling data curve is generated based on the sampling value sequence; the horizontal coordinate of the sampling data curve is used to represent the sampling order, and the vertical coordinate of the sampling data curve is used to represent the sampling point data corresponding to the sampling order; the minimum value of the horizontal coordinate of the sampling data curve is 0, and the maximum value is the preset number of sampling data-1.
4. The method for processing sampling data according to claim 3, characterized in that: Before the step of determining the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data based on the preset number of sampling data and the preset number of interpolation data, the method further includes: Determining an interpolation scaling ratio based on a ratio of the preset number of sampling data to the preset number of interpolation data; Based on the preset number of interpolation data, determining an initial interpolation point abscissa sequence corresponding to the interpolation point data in the sampling data curve; the initial interpolation point abscissa sequence includes the abscissas of the initial interpolation points of the preset number of interpolation data, the minimum value of the initial interpolation point abscissa is 0, and the maximum value is the preset number of interpolation data-1; The interpolation scaling ratio is multiplied by the initial interpolation point horizontal coordinate sequence to obtain an interpolation point horizontal coordinate sequence corresponding to the interpolation point data; the interpolation point horizontal coordinate sequence includes the interpolation point horizontal coordinates of the preset number of interpolation data.
5. The method for processing sampling data according to claim 4, characterized in that: The step of determining the interval segmentation point parameters corresponding to the sampling value sequence and the distribution density parameters corresponding to the interpolation point data based on the preset number of sampling data and the preset number of interpolation data includes: Calculating the least common multiple of the preset number of sampling data and the preset number of interpolation data; The interval segmentation point parameter is calculated by the following formula: Wherein, a is the interval segmentation point parameter, S is the least common multiple, and N is the number of preset interpolation data; The distribution density parameter is calculated by the following formula: Wherein, b is the distribution density parameter, and M is the preset number of sampling data.
6. The method for processing sampling data according to claim 5, characterized in that: The step of dividing the sampling value sequence into a plurality of sampling intervals based on the interval segmentation point parameter comprises: Each interval segmentation point parameter marks an interpolation segmentation point, and an initial sampling interval is formed between each two interpolation segmentation points; The sampling intervals other than the first sampling interval are extended so that the starting point of the current sampling interval coincides with the ending point of the previous sampling interval, thereby obtaining the sampling interval.
7. The method for processing sampling data according to claim 6, characterized in that: The step of performing interpolation resampling on each of the sampling intervals based on the distribution density parameter to obtain the interpolation point data comprises: Based on the distribution density parameter, determining the abscissa of the interpolation point corresponding to each of the sampling intervals; When the sampling interval is the first sampling interval, based on the first interpolation point abscissa corresponding to the first sampling interval and a preset first Lagrange interpolation polynomial, the interpolation point data corresponding to the first interpolation point abscissa is calculated; When the sampling interval is the other sampling interval, the interpolation point data corresponding to the abscissa of each other interpolation point is calculated based on the abscissa of each other interpolation point corresponding to the other sampling interval and a preset second Lagrange interpolation polynomial.
8. The method for processing sampling data according to claim 7, characterized in that: The preset first Lagrange interpolation polynomial is: Wherein, L1(Bx) is the interpolation point data, Bx is the horizontal coordinate of the interpolation point, Ay i is the ordinate of the sampling data curve, Ax i Ax is the horizontal coordinate of the sampling data curve corresponding to the node being processed in the current sampling interval; j is the horizontal coordinate of the sampling data curve corresponding to other nodes; The preset second Lagrange interpolation polynomial is: Among them, Ax min is the minimum value of the horizontal coordinate of the sampling data curve in the current interval.
9. A sampling data processing system, characterized in that: include: A sampling module, used to obtain a sampling value sequence of an input signal; the sampling value sequence includes sampling point data of a preset number of sampling data; An interval segmentation module, used to determine interval segmentation point parameters corresponding to the sampling value sequence and distribution density parameters corresponding to the interpolation point data based on the preset number of sampling data and the preset number of interpolation data; The interval segmentation module is further used to divide the sampling value sequence into a plurality of sampling intervals based on the interval segmentation point parameter; An interpolation point data acquisition module, used to perform interpolation resampling on each of the sampling intervals based on the distribution density parameter to obtain the interpolation point data; The interpolation point data acquisition module is further used to generate an interpolation sequence based on the interpolation point data; the interpolation sequence includes the interpolation point data of the preset number of interpolation data.
10. A processing device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and is characterized in that when the processor executes the computer program, the method for processing sampling data described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Audio signal processing method, system, equipment and medium
CN121483281A