A calibration method and calibration device for an alternating current sampled signal
By processing AC current signals using first-order inertial digital filtering and weighted moving average algorithms, the problem of low filtering efficiency in MCU software in existing technologies is solved, and the accurate calibration and anti-interference capability of AC current signals are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN CLOU PRECISION MEASUREMENT CO LTD
- Filing Date
- 2022-11-09
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, MCU software filtering for AC current signals suffers from slow response time, high computational load, wasted RAM resources, and a lack of suppression of periodic interference in small current signals, resulting in a large error between the sampled value and the accurate AC current value obtained by the tracing device.
The sampled data is processed using a first-order inertial digital filter and a weighted moving average algorithm. The first-order inertial digital filter removes DC drift, the weighted moving average algorithm improves signal quality, and the calibration coefficients are calculated using an adaptive frequency domain block calibration method to achieve accurate calibration of the sampled data.
It effectively saves MCU RAM resources, improves the anti-interference capability of weak current signals, realizes accurate calibration of AC current signals, and reduces the amount of computation and resource waste.
Smart Images

Figure CN115792760B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of power electronics technology and relates to a calibration method and calibration device for AC sampling signals. Background Technology
[0002] With the global publication of International Recommendation 46 (International Recommendation / Standard Requirements for Active Energy Meters), higher requirements have been placed on the sampling technical specifications of energy meters. AC current sampling includes current sampling, I / V conversion modulation, hardware filtering, ADC analog-to-digital conversion, MCU software filtering, and finally, after weighted processing, the specific value of the sampled AC current is displayed.
[0003] For sampling and outputting AC current signals at the milliampere and microampere levels, random noise is inevitably mixed in the sampled AC current signal due to the saturation ampere-turn detection characteristics of the current transformer itself and the interference of the surrounding environment. Sampling devices such as current sampling resistors and preamplifiers are inevitably subject to zero-point drift due to temperature and stress changes. During analog-to-digital conversion, the truncation error of the analog-to-digital conversion will also cause DC drift. Therefore, hardware filtering of AC current, software filtering after converting AC circuits into digital signals, and weighting processing of the sampled digital signals are crucial.
[0004] In existing technologies, MCU software filtering uses IIR filtering or FIR filtering. This filtering method has a slow integrated algorithm response time, large computational load, and excessive RAM resources, wasting MCU software resources. Furthermore, it lacks the ability to suppress periodic interference in small current signals, and the weighted sampled value still has a large error compared to the accurate value of AC current obtained by the tracing device. Summary of the Invention
[0005] The purpose of this application is to provide a calibration method and calibration device for AC sampling signals, so as to solve the technical problem that the prior art is insufficient for AC current signals in the MCU software processing process.
[0006] This application provides a calibration method for AC sampling signals, comprising:
[0007] N consecutively sampled data points are obtained, and the N sampled data points are processed using a first-order inertial digital filter and a weighted moving average algorithm to determine the N weighted data points corresponding to the N sampled data points.
[0008] The N weighted data are divided into at least two data block vectors, such that each data block vector includes M weighted data arranged in order.
[0009] Obtain the calibration deviation vector of the i-th data block vector, where the calibration deviation is the difference between the calibration target data and the weighted data;
[0010] Calculate the gradient vector based on the i-th data block vector and the calibration deviation vector;
[0011] The calibration coefficient update parameter is calculated using the i-th data block vector, and the calibration coefficient vector is calculated based on the gradient vector and the calibration coefficient update parameter.
[0012] The M weighted data of the i-th data block vector are calibrated according to the calibration coefficient vector.
[0013] Further, the step of acquiring N consecutively sampled data points, processing the N sampled data points using a first-order inertial digital filtering and weighted moving average algorithm, and determining the N weighted data points corresponding to the N sampled data points includes:
[0014] Acquire the N consecutive sampled data points obtained by the analog-to-digital converter;
[0015] The DC drift component of the N sampled data is removed by first-order inertial digital filtering to obtain N filtered data corresponding to the N sampled data.
[0016] Obtain N weighting coefficients corresponding to the N filtered data, wherein the weighting coefficients are:
[0017]
[0018] The c k The weighting coefficients for the (k+1)th filtered data, 0 ≤ k ≤ N-1, where n is the effective number of bits of the analog-to-digital converter, and T... s The sampling frequency of the analog-to-digital converter;
[0019] Based on the N weighting coefficients, N weighted data corresponding to the N filtered data are obtained, and the weighted data are:
[0020]
[0021] The y N For the Nth weighted data, x N-k This is the Nkth filtered data.
[0022] Further, the step of obtaining the calibration deviation vector of the i-th data block vector includes:
[0023] Obtain M calibration target data corresponding to the M weighted data of the i-th data block vector, wherein the calibration target data is obtained through a traceability device;
[0024] The differences between the M target calibration data and the M weighted data are arranged in order to form a calibration deviation vector.
[0025] Further, the step of calculating the gradient vector based on the i-th data block vector and the calibration deviation vector includes:
[0026] Arrange the (i-1)th data block vector and the i-th data block vector in sequence to form the first data block vector, and obtain the fast Fourier transform of the first data block vector;
[0027] The all-zero vector and the calibration deviation vector are arranged sequentially to form a second data block vector, and the fast Fourier transform of the second data block vector is obtained. The all-zero vector consists of M zeros.
[0028] The gradient vector is calculated based on the Fast Fourier Transform of the first data block vector and the Fast Fourier Transform of the second data block vector, and the gradient vector is:
[0029] Δ(j)=Y H (j)*E(j)
[0030] Δ(j) is the gradient vector, Y(j) is the Fast Fourier Transform of the first data block vector, E(j) is the Fast Fourier Transform of the second data group, and Y... H (j) The conjugate spectrum of the fast Fourier transform of the first data block vector, 1≤j≤2M.
[0031] Furthermore, the calibration coefficient update parameter is:
[0032]
[0033] μ is the calibration coefficient update parameter, and y h Let h be the weighted data of the i-th data block vector, where 1 ≤ h ≤ M.
[0034] Further, the step of calculating the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameters includes:
[0035] Obtain the inverse fast Fourier transform of the gradient vector, and arrange the first to Mth data of the inverse fast Fourier transform of the gradient vector in sequence as the relevant gradient vector;
[0036] The calibration coefficient vector is calculated based on the relevant gradient vector, and the calibration coefficient vector is:
[0037]
[0038] W(z) is the calibration coefficient vector, W(initial) is the calibration coefficient vector calculated in the previous iteration, or the calibration coefficient vector initially set by W(t), and μ is the calibration coefficient update parameter. The relevant gradient vector is V(h), which is an all-zero vector. For vectors The fast Fourier transform of 1 ≤ h ≤ M.
[0039] Further, the step of calibrating the M weighted data of the i-th data block vector according to the calibration coefficient vector includes:
[0040] The (M+1)th to the 2Mth data points of the calibration coefficient vector are arranged sequentially to form a valid calibration coefficient vector; the calibration value of the M weighted data points of the i-th data block vector is calculated based on the valid data vector, and the calibration value is:
[0041]
[0042] The p h The calibration value of the h-th weighted data in the i-th data block vector, the W h For the h-th data of the effective calibration coefficient vector, the y h Let h be the weighted data of the i-th data block vector, where 1 ≤ h ≤ M.
[0043] Furthermore, it also includes:
[0044] Determine whether the calibration value of the M weighted data of the i-th data block vector is equal to the calibration target data of the M weighted data of the i-th data block vector. If the determination result is negative, proceed to the step of obtaining the calibration deviation vector of the i-th data block vector; if the determination result is positive, end the calibration.
[0045] Based on the above-described calibration method for AC sampling signals, this application also provides a calibration apparatus for AC sampling signals, comprising:
[0046] The sampling processing module is used to acquire N consecutively sampled data points and process the N sampled data points using a first-order inertial digital filter and a weighted moving average algorithm.
[0047] A data block processing module is used to divide the N weighted data into at least two data block vectors, such that each data block vector includes M weighted data arranged in order.
[0048] The error processing module is used to obtain the calibration deviation vector of the i-th data block vector;
[0049] The gradient vector processing module is used to calculate the gradient vector based on the i-th data block vector and the calibration deviation vector.
[0050] The calibration coefficient processing module is used to calculate the calibration coefficient update parameters through the i-th data block vector, and to calculate the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameters;
[0051] The calibration module is used to calibrate the M weighted data of the i-th data block vector according to the calibration coefficient vector.
[0052] Furthermore, the device also includes:
[0053] The first judgment module is used to determine whether the calibration value of the M weighted data of the i-th data block vector is equal to the calibration target data of the M weighted data of the i-th data block vector. If the judgment result is negative, the error processing module is rerun; if the judgment result is positive, the calibration is terminated.
[0054] Compared to existing technologies, the advantages of this application are as follows:
[0055] This application provides a calibration method and apparatus for AC sampling signals. It utilizes a first-order inertial digital filter combined with a weighted moving average filtering algorithm to filter the sampled digital signal. Furthermore, by performing an addition operation and an n-bit right shift followed by an averaging operation, the computational load of the MCU software is minimized, effectively saving MCU RAM resources. In addition, this application also employs an adaptive frequency domain block calibration method based on overlapping storage, which enables accurate calculation of the calibration coefficients of weak current signals in the memory through a short adaptive time.
[0056] Based on the algorithm of MCU software, this application can further set a larger hardware filtering time constant, which improves the anti-interference ability of weak AC current signals such as mA and uA level to random noise introduced by the environment when sampling. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 The hardware module for AC current sampling provided in the embodiments of this application.
[0059] Figure 2 A flowchart of a calibration method for AC sampling signals provided in an embodiment of this application.
[0060] Figure 3 This is a flowchart of a calibration method for an AC sampling signal provided in an embodiment of this application.
[0061] Figure 4 This is a schematic diagram of a calibration device for AC sampling signals provided in an embodiment of this application.
[0062] Figure 5 This is a schematic diagram of a calibration device for AC sampling signals provided in an embodiment of this application. Detailed Implementation
[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the embodiments described in this application are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0064] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in sequences other than those illustrated or described herein.
[0065] In existing technologies, AC current sampling includes both hardware processing and software processing. The hardware processing part includes, for example,... Figure 1 As shown, the system includes a current sampling unit, an I / V conversion modulation unit, a filtering unit, an ADC analog-to-digital converter (ADC), an MCU software processing unit, and a display unit. The current sampling unit uses a precision current transformer to isolate and sample the measured current signal, and then converts the current signal into a voltage signal through a precision resistor. The I / V conversion modulation unit converts the weak small current signal into a small voltage signal and performs current amplification and gain adjustment on the small voltage signal. To ensure the signal quality and high resolution of the analog signal entering the ADC ADC unit, a hardware filtering unit is added between the I / V conversion modulation unit and the ADC conversion unit. The ADC conversion unit converts the acquired analog signal into a digital signal and sends it to the MCU data processing unit. The software processing includes the MCU data processing unit performing software filtering and weighting on the sampled data, and then displaying the acquired signal on the display unit.
[0066] Figure 2 A flowchart of the calibration method for AC sampling signals provided in the embodiments of this application is shown below. Figure 2As shown, the AC sampling signal calibration method provided in this application embodiment processes the sampling data after the ADC conversion unit sends the sampling data to the MCU data processing unit, including the following steps:
[0067] Step S100: Obtain N consecutively sampled data points, process the N sampled data points using a first-order inertial digital filter and a weighted moving average algorithm, and determine the N weighted data points corresponding to the N sampled data points. It should be noted that N is a natural number greater than 0, and the data points for one cycle during sampling are 256. Usually, at least five cycles of data points are sampled during sampling, that is, the N sampled data points are usually no less than 1280 sampled data points. However, the method provided in this application embodiment is still applicable when the number of sampled data points is less than 1280.
[0068] In some embodiments, step S100: acquiring N consecutively sampled data points, processing the N sampled data points using a first-order inertial digital filtering and weighted moving average algorithm, and determining the N weighted data points corresponding to the N sampled data points, including:
[0069] Step S110: Obtain N consecutive sampled data from the analog-to-digital converter. The main component of the ADC analog-to-digital converter unit of the AC circuit sampling hardware module is the analog-to-digital converter, which is used to convert analog signals into digital signals.
[0070] Step S120: Remove the DC drift component of N sampled data using a first-order inertial digital filter to obtain N filtered data corresponding to the N sampled data. Specifically, arrange the N sampled data into r(k) according to the sampling order, and set the DC drift component as d(k), where k is the sequence number and the value range of k is [0, N-1]. Then the DC drift component d(k) is:
[0071]
[0072] n represents the effective number of bits of the ADC conversion unit. Different analog-to-digital converters have different precision in the digital signals they convert, i.e., different effective number of bits. For example, the effective number of bits of an analog-to-digital converter can be 8 bits, 12 bits, 18 bits, 20 bits, 24 bits, 32 bits, etc. When k is 0, d(k-1) is the d(0) value corresponding to the sampled data of the last time. Or when k is 0, d(k-1) can also be the initial value set by the user when designing the algorithm.
[0073] The N filtered data after software filtering of N sampled data are:
[0074] x(k)=r(k)-d(k)
[0075] Step S130: Obtain N weighting coefficients corresponding to N filtered data points. To increase the weight of new sampled data in the moving average and improve the system's sensitivity to interference in the current sampled value, the closer the data is to the current time, the larger its value should be. The weighting factor is equivalent to a pure time lag function, and the pure time lag factor of the function is set to: 2 n *T s The weighting coefficients are:
[0076]
[0077] c k The weighting coefficients are the (k+1)th filtered data, 0 ≤ k ≤ N-1, where n is the effective number of bits of the analog-to-digital converter, and T s The sampling frequency of the analog-to-digital converter.
[0078] Step S140: Obtain N weighted data points corresponding to the N filtered data points based on the N weighted coefficients. The weighted data points are:
[0079]
[0080] y N For the Nth weighted data, x N-k This is the Nkth filtered data.
[0081] Step S200: Divide the N weighted data points into at least two data block vectors, such that each data block vector contains M weighted data points arranged in order. It should be clear that M is a natural number greater than 0, and N and M are multiples of each other. For example, when dividing the N weighted data points into two data block vectors, then...
[0082] Step S300: Obtain the calibration deviation vector of the i-th data block vector. The calibration deviation is the difference between the calibration target data and the weighted data. It should be clear that i is a natural number greater than 0 and i is less than the number of data block vectors. For example, if N weighted data are divided into two data block vectors and the calibration deviation vector of the second data block vector is obtained, i means i = 2. In addition, for AC current sampling, in addition to calculating the specific value of AC current through MCU software algorithm, the standard value of AC current, i.e., calibration target data, can be directly displayed through a more accurate traceability device.
[0083] In some embodiments, step S300: obtaining the calibration deviation vector of the i-th data block vector specifically includes:
[0084] Step S310: Obtain the M calibration target data corresponding to the M weighted data of the i-th data block vector. The calibration target data is obtained through the traceability device.
[0085] The differences between the M target calibration data and the M weighted data are arranged in order to form the calibration deviation vector. The calibration deviation vector is calculated as follows:
[0086] e(iM) = a(iM) - y(iM)
[0087] e(iM) represents a calibration deviation vector containing M data points, a(iM) represents a calibration target data vector containing M data points, and y(iM) represents the i-th data block vector containing M data points.
[0088] Step S400: Calculate the gradient vector based on the i-th data block vector and the calibration deviation vector.
[0089] In some embodiments, step S400: calculating the gradient vector based on the i-th data block vector and the calibration deviation vector specifically includes:
[0090] Step S410: Arrange the (i-1)th data block vector and the ith data block vector in sequence to form the first data block vector, and obtain the Fast Fourier Transform (FFT) of the first data block vector. The Fast Fourier Transform (FFT) of the first data block vector is:
[0091] Y(j)=diag{FFT[y((i-1)M),y(iM)] T}
[0092] Y(j) represents the Fast Fourier Transform of the first data block vector, where j ranges from [0, 2M]. T represents the transpose of the matrix. y((i-1)M) represents the (i-1)th data block vector, y(iM) represents the ith data block vector, and FFT[y((i-1)M), y(iM)] T This represents the vector [y((i-1)M), y(iM)]. T Perform a Fast Fourier Transform calculation, where diag represents a diagonal matrix.
[0093] Normally, the first data block vector is not selected, i.e., i ≠ 1. However, when the first data block vector is selected, i.e., i = 1, the (i-1)th data block vector represents the data block vector selected in the previous calculation or the (i-1)th data block vector represents the data block vector set during design.
[0094] Step S420: Arrange the all-zero vector and the calibration bias vector in sequence to form the second data block vector, and obtain the Fast Fourier Transform (FFT) of the second data block vector. The all-zero vector consists of M zeros. The Fast Fourier Transform (FFT) of the second data block vector is:
[0095] E(j) = FFT[V(h), e(iM)] T
[0096] E(j) represents the Fast Fourier Transform of the second data block vector, where j ranges from [0, 2M]. T represents the transpose of the matrix, V(h) represents the all-zero vector, and e(iM) represents the calibration bias vector. FFT[V(h), e(iM)] T This represents the vector [V(h), e(iM)]. T Perform Fast Fourier Transform calculations.
[0097] The purpose of the all-zero vector is to make the number of data in E(j) the same as that in Y(j), both reaching 2M data points. Therefore, it is achieved by padding with zeros. The vectors that need to be padded with zeros in this application embodiment all have this purpose.
[0098] Step S430: Calculate the gradient vector based on the Fast Fourier Transform of the first data block vector and the Fast Fourier Transform of the second data block vector. The gradient vector is:
[0099] Δ(j)=Y H (j)*E(j)
[0100] Δ(j) is the gradient vector, Y(j) is the Fast Fourier Transform of the first data block vector, and E(j) is the Fast Fourier Transform of the second data block vector. H (j) The conjugate spectrum of the fast Fourier transform of the first data block vector, 1≤j≤2M.
[0101] Step S500: Calculate the calibration coefficient update parameters using the i-th data block vector, and calculate the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameters.
[0102] In some embodiments, the calculation of the calibration coefficient update parameter in step S500 is as follows:
[0103]
[0104] μ is the calibration coefficient update parameter, y h Let h be the weighted data of the i-th data block vector, where 1 ≤ h ≤ M.
[0105] In some embodiments, step S500: calculating the calibration coefficient update parameter using the i-th data block vector, specifically including the calculation of the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameter:
[0106] Step S510: Obtain the inverse fast Fourier transform of the gradient vector, and arrange the first to Mth data of the inverse fast Fourier transform of the gradient vector in order as the relevant gradient vector. The gradient vector calculated in step S430 includes a total of 2M data, and step S510 only needs the first M data of the gradient vector.
[0107] Step S520: Calculate the calibration coefficient vector based on the relevant gradient vector. The calibration coefficient vector is:
[0108]
[0109] W(z) is the calibration coefficient vector, W(initial) is the calibration coefficient vector calculated in the previous iteration, or the calibration coefficient vector initially set when designing the algorithm, and μ is the calibration coefficient update parameter. For the relevant gradient vector, Let V(h) be the transpose of the relevant gradient vector, and let V(h) be a vector of all zeros. For vectors The fast Fourier transform of 1 ≤ h ≤ M.
[0110] Step S600: Calibrate the M weighted data of the i-th data block vector according to the calibration coefficient vector.
[0111] In some embodiments, step S600: calibrating the M weighted data of the i-th data block vector according to the calibration coefficient vector specifically includes:
[0112] Step S610: Arrange the (M+1)th to (2M)th data of the calibration coefficient vector in order to form a valid calibration coefficient vector. That is, in the operation of this application embodiment, the (M+1)th to (M+2)th data of the calibration coefficient vector are the calibration coefficients corresponding to the i-th data block.
[0113] Step S620: Calculate the calibration values of the M weighted data points of the i-th data block vector based on the valid data vector. The calibration values are:
[0114]
[0115] p h W is the calibration value of the h-th weighted data in the i-th data block vector. h For the h-th data point in the effective calibration coefficient vector, y h Let h be the weighted data of the i-th data block vector, where 1 ≤ h ≤ M.
[0116] In some preferred embodiments, the calibration method for the sampling signal provided in this application further includes:
[0117] Step S700: Determine whether the calibration values of the M weighted data of the i-th data block vector are equal to the calibration target data of the M weighted data of the i-th data block vector. If the determination result is no, proceed to the step of obtaining the calibration deviation vector of the i-th data block vector; if the determination result is yes, end the calibration.
[0118] It should be clarified that the AC sampling signal calibration method provided in this application embodiment is executed by program code. Because the order of some steps does not affect the calculation process and results, the corresponding program code can be programmed in various forms. The order of some steps that do not affect the calculation process and results can be arbitrarily changed. For example, the calibration coefficient update parameter only needs to be calculated before the step of updating the calibration coefficient vector. Figure 3 A flowchart of a calibration method for AC sampling signals provided in an embodiment of this application is shown below. Figure 3 As shown, the calculation of calibration coefficient update parameters can also be performed after step S200. Similarly, the weighting coefficients can also be calculated before the sampling data is acquired.
[0119] The AC sampling signal calibration method provided in this application first performs first-order digital filtering with a large inertia constant on the N sampled data converted by the ADC analog-to-digital converter to filter out zero-point drift caused by temperature changes and stress changes during use due to temperature variations in the sampling resistor and preamplifier of the sampling circuit, as well as DC offset caused by truncation error during ADC analog-to-digital conversion. Then, a weighted moving average algorithm is used to assign different weights to each sampled data, and the queue data is updated from the tail of the queue according to the first-in-first-out principle, and the arithmetic mean of the N weighted data in the queue is calculated in real time. During calibration, the reading of the traceability device is entered into the M through the display unit. The CU data processing unit performs adaptive precision calibration on the sampled data to achieve accurate measurement and calibration of the measured signal. To obtain the precise calibration coefficients of the current N sampled data, an adaptive frequency domain block calibration algorithm based on overlapping storage is adopted. The N sampled data are divided into several data blocks of length M. The calibration coefficients of the i-th data block are updated by FFT transformation and inverse FFT transformation of the sampled data in the (i-1)th data block and the i-th data block. The calculated calibration coefficients are sent to the calibration coefficient memory. The mean of the calibration values of the M data in the i-th data block vector is calculated by using the calibration coefficients. The mean of the calibration values is used as the calibration values of the N sampled data.
[0120] This application provides a calibration method for AC sampling signals, which effectively saves MCU RAM resources. It adopts an adaptive frequency domain block calibration method based on overlapping storage, and can also achieve accurate calculation of the calibration coefficient of weak current signals in memory through short adaptive time.
[0121] Furthermore, the algorithm based on MCU software in this application can further set a larger hardware filtering time constant, which improves the anti-interference capability against random noise introduced by the environment when sampling weak AC current signals such as mA and uA level. However, the calibration accuracy of the prior art is not high because selecting a larger filtering time constant will affect the final calculation accuracy. Therefore, the hardware filtering time constant can usually only be set to a smaller value.
[0122] Based on the AC sampling signal calibration method provided in the above embodiments, this application also provides an AC sampling signal calibration device. All embodiments of the AC sampling signal calibration method provided in this application are applicable to AC sampling signal calibration devices and can achieve the same or similar beneficial effects.
[0123] The calibration device for AC sampling signals provided in the embodiments of this application, such as Figure 4 As shown, it includes:
[0124] The sampling processing module 100 is used to acquire N consecutively sampled data points and process the N sampled data points using a first-order inertial digital filter and a weighted moving average algorithm.
[0125] The data block processing module 200 is used to divide N weighted data into at least two data block vectors, such that each data block vector includes M weighted data arranged in order.
[0126] Error processing module 300 is used to obtain the calibration deviation vector of the i-th data block vector;
[0127] Gradient vector processing module 400 is used to calculate the gradient vector based on the i-th data block vector and the calibration deviation vector;
[0128] The calibration coefficient processing module 500 is used to calculate the calibration coefficient update parameters through the i-th data block vector, and to calculate the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameters.
[0129] The calibration module 600 is used to calibrate the M weighted data of the i-th data block vector according to the calibration coefficient vector.
[0130] In some embodiments, such as Figure 5 As shown, the calibration device for AC sampling signals provided in this application embodiment further includes:
[0131] The first judgment module 700 is used to determine whether the calibration value of the M weighted data of the i-th data block vector is equal to the calibration target data of the M weighted data of the i-th data block vector. If the judgment result is negative, the error processing module is rerun; if the judgment result is positive, the calibration ends.
[0132] The above description, in conjunction with specific embodiments, provides a further detailed explanation of this application and should not be construed as limiting the specific implementation of this application to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications and substitutions should be considered within the scope of protection of this application.
Claims
1. A calibration method for an AC sampling signal, characterized in that, include: N consecutively sampled data points are obtained, and the N sampled data points are processed using a first-order inertial digital filter and a weighted moving average algorithm to determine the N weighted data points corresponding to the N sampled data points. The N weighted data are divided into at least two data block vectors, such that each data block vector includes M weighted data arranged in order. Obtain the calibration deviation vector of the i-th data block vector, where the calibration deviation is the difference between the calibration target data and the weighted data; Calculate the gradient vector based on the i-th data block vector and the calibration deviation vector; The calibration coefficient update parameter is calculated using the i-th data block vector, and the calibration coefficient vector is calculated based on the gradient vector and the calibration coefficient update parameter. The M weighted data of the i-th data block vector are calibrated according to the calibration coefficient vector; The step of acquiring N consecutively sampled data points, processing the N sampled data points using a first-order inertial digital filter and a weighted moving average algorithm, and determining the N weighted data points corresponding to the N sampled data points includes: Acquire the N consecutive sampled data points obtained by the analog-to-digital converter; The DC drift component of the N sampled data is removed by first-order inertial digital filtering to obtain N filtered data corresponding to the N sampled data. Obtain N weighting coefficients corresponding to the N filtered data, wherein the weighting coefficients are: The For the first The weighting coefficients of the filtered data, The The effective number of bits of the analog-to-digital converter, the The sampling frequency of the analog-to-digital converter; Based on the N weighting coefficients, N weighted data corresponding to the N filtered data are obtained, and the weighted data are: The For the Nth weighted data, the For the first k filtered data.
2. The calibration method for AC sampling signals as described in claim 1, characterized in that, The acquisition of the first The steps for calibrating the deviation vector of a data block vector include: Obtain M calibration target data corresponding to the M weighted data of the i-th data block vector, wherein the calibration target data is obtained through a traceability device; The differences between the M target calibration data and the M weighted data are arranged in order to form a calibration deviation vector.
3. The calibration method for AC sampling signals as described in claim 1, characterized in that, The step of calculating the gradient vector based on the i-th data block vector and the calibration deviation vector includes: Arrange the (i-1)th data block vector and the i-th data block vector in sequence to form the first data block vector, and obtain the fast Fourier transform of the first data block vector; The all-zero vector and the calibration deviation vector are arranged sequentially to form a second data block vector, and the fast Fourier transform of the second data block vector is obtained. The all-zero vector consists of M zeros. The gradient vector is calculated based on the Fast Fourier Transform of the first data block vector and the Fast Fourier Transform of the second data block vector, and the gradient vector is: The The gradient vector, the The fast Fourier transform of the first data block vector, the For the fast Fourier transform of the second data block vector, the The conjugate spectrum of the fast Fourier transform of the first data block vector. .
4. The calibration method for AC sampling signals as described in claim 1, characterized in that, The calibration coefficient update parameter is: The Update the parameters for the calibration coefficients, the For the i-th data block vector, the first... Weighted data, .
5. The calibration method for AC sampling signals as described in claim 1, characterized in that, The step of calculating the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameters includes: Obtain the inverse fast Fourier transform of the gradient vector, and arrange the first to Mth data of the inverse fast Fourier transform of the gradient vector in sequence as the relevant gradient vector; The calibration coefficient vector is calculated based on the relevant gradient vector, and the calibration coefficient vector is: The For the calibration coefficient vector, the The calibration coefficient vector is either the previously calculated calibration coefficient vector or the initially set calibration coefficient vector. Update the parameters for the calibration coefficients, the The relevant gradient vector, The transpose of the relevant gradient vector, the The vector is all zeros. For vectors Fast Fourier transform, .
6. The calibration method for AC sampling signals as described in claim 1, characterized in that, The step of calibrating the M weighted data of the i-th data block vector according to the calibration coefficient vector includes: The (M+1)th to the 2Mth data points of the calibration coefficient vector are arranged sequentially to form a valid calibration coefficient vector; The calibration values of the M weighted data points of the i-th data block vector are calculated based on the effective calibration coefficient vector, and the calibration values are: The For the i-th data block vector, the first... The calibration value of each weighted data, the The first of the effective calibration coefficient vectors The data, the For the i-th data block vector, the first... Weighted data, .
7. The calibration method for AC sampling signals as described in claim 6, characterized in that, Also includes: Determine whether the calibration values of the M weighted data of the i-th data block vector are equal to the calibration target data of the M weighted data of the i-th data block vector. If the determination result is not equal, proceed to obtain the calibration target data of the i-th data block vector. The steps for calibrating the deviation vector of a data block vector; If the result is yes, the calibration ends.
8. A calibration device for AC sampling signals, characterized in that, include: The sampling processing module is used to acquire N consecutively sampled data, process the N sampled data using a first-order inertial digital filter and a weighted moving average algorithm, and determine the N weighted data corresponding to the N sampled data. A data block processing module is used to divide the N weighted data into at least two data block vectors, such that each data block vector includes M weighted data arranged in order. The error processing module is used to obtain the calibration deviation vector of the i-th data block vector; The gradient vector processing module is used to calculate the gradient vector based on the i-th data block vector and the calibration deviation vector. The calibration coefficient processing module is used to calculate the calibration coefficient update parameters through the i-th data block vector, and to calculate the calibration coefficient vector based on the gradient vector and the calibration coefficient update parameters; The calibration module is used to calibrate the M weighted data of the i-th data block vector according to the calibration coefficient vector; The step of acquiring N consecutively sampled data points, processing the N sampled data points using a first-order inertial digital filter and a weighted moving average algorithm, and determining the N weighted data points corresponding to the N sampled data points includes: Acquire the N consecutive sampled data points obtained by the analog-to-digital converter; The DC drift component of the N sampled data is removed by first-order inertial digital filtering to obtain N filtered data corresponding to the N sampled data. Obtain N weighting coefficients corresponding to the N filtered data, wherein the weighting coefficients are: The For the first The weighting coefficients of the filtered data, The The effective number of bits of the analog-to-digital converter, the The sampling frequency of the analog-to-digital converter; Based on the N weighting coefficients, N weighted data corresponding to the N filtered data are obtained, and the N weighted data are: The For the Nth weighted data, the For the first k filtered data.
9. The calibration device for AC sampling signals as described in claim 8, characterized in that, Also includes: The first judgment module is used to determine whether the calibration value of the M weighted data of the i-th data block vector is equal to the calibration target data of the M weighted data of the i-th data block vector. If the judgment result is not, the error processing module is rerun. If the result is yes, the calibration ends.