High-precision AD acquisition method based on SOC adaptive filtering
By adopting the SOC adaptive filtering method with ZYNQ architecture in the AD acquisition system, combined with the adaptive filtering and trend abnormality judgment algorithm, the problems of low accuracy and poor integration in complex signal processing of traditional AD acquisition systems are solved, and high precision is achieved , low-cost AD acquisition and real-time exception handling.
Patent Information
- Application Number
- CN202410721754.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-11-22
AI Technical Summary
Traditional AD acquisition systems have low accuracy and poor integration when processing complex and variable signals. Traditional filtering algorithms are susceptible to environmental noise and system errors, and lack adaptive adjustment capabilities.
Adoptional filtering method based on ZYNQ architecture is adopted, and real-time filtering processing is performed when data is collected using adaptive filtering algorithm and trend abnormality judgment algorithm. Data communication is carried out between the PS and PL terminals through the APB bus communication protocol, and adaptive adjustment is performed. Filter coefficients and optimize memory usage through sliding chunking algorithms and temporary storage space.
It improves the accuracy and system integration of AD data acquisition, reduces system costs, can better process complex signals, reduces dependence on computer-side processing, and enhances real-time processing capabilities of abnormal data.
Smart Images

Figure CN119010899A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data acquisition, and in particular relates to a high-precision AD acquisition method based on SOC adaptive filtering. Background Art
[0002] Traditional AD acquisition systems usually convert analog signals into digital signals and perform filtering after acquiring them to eliminate noise signal interference. However, traditional signal filtering methods usually transmit the acquired data to the computer for processing, and traditional filtering algorithms, such as average filtering algorithms, are easily affected by various factors, including environmental noise, abnormal values, and system errors, making it difficult to accurately process complex signals. In addition, traditional filtering algorithms usually require pre-setting parameters or filter coefficients, and lack the ability to adaptively adjust the characteristics of real-time signals, so the processing effect is poor when facing complex and changeable signals.
[0003] For example, Chinese patent publication number CN103604984A, publication date February 26, 2014, the name of the invention is a method for improving AD acquisition accuracy based on least squares method. The application discloses a method for improving AD acquisition accuracy based on least squares method. The disadvantage is that the least squares method has a high algorithm complexity, which will greatly consume on-chip resources, and requires the host computer to synchronously input standard signals for calibration, which has poor system integration. Summary of the invention
[0004] In view of this, the present invention provides a high-precision AD acquisition method based on SOC adaptive filtering, which overcomes the shortcomings of low AD acquisition accuracy and poor integration in the prior art.
[0005] In order to achieve the above technical objectives, the specific technical solutions adopted by the present invention are:
[0006] A high-precision AD acquisition method based on SOC adaptive filtering, the SOC is based on the ZYNQ architecture, the ZYNQ includes an ARM processor core and an FPGA, the ARM is a PS end, and the FPGA is a PL end; the high-precision AD acquisition method based on SOC adaptive filtering includes the following steps:
[0007] S1: setting the PS end and the PL end to perform data communication according to the APB bus communication protocol, the PS end sends a collection instruction to the PL end based on the APB bus communication protocol and receives AD collection data from the PL end;
[0008] S2: After receiving the AD collected data, the PS end uses an adaptive filtering algorithm to perform algorithm filtering on the AD collected data;
[0009] S3: Use a trend anomaly judgment algorithm to perform numerical analysis on the filtered AD acquisition data, filter out prominent abnormal data points that appear instantaneously in the entire data stream, and discard or report the abnormal data points.
[0010] Furthermore, the adaptive filtering algorithm is implemented by sequentially calculating based on the following formulas:
[0011] X(t)=AX(t-1)+W(t)
[0012] Z(t)=HX(t)+V(t)
[0013] X(t|t-1)=AX(t-1|t-1)
[0014] P(t|t-1)=AP(t-1|t-1)A+Q
[0015] X(t|t)=X(t|t-1)+K g (t)[Z(t)-HX(t|t-1)]
[0016] K g (t)=P(t|t-1)H / [HP(t|t-1)H+R]
[0017] P(t|t)=(IK g (t)H)P(t|t-1)
[0018] in:
[0019] X(t) represents the true value of the system at time t; W(t) represents the process noise of the system at time t; A is the system parameter; Z(t) represents the measured value of AD acquisition at time t; H represents the system measurement parameter value; V(t) represents the measured value of AD system noise; X(t|t-1) represents the predicted result value at the current moment when the state value at the previous moment is known; X(t-1|t-1) represents the best result of the previous state; P(t|t-1) and P(t-1|t-1) represent the variance at the corresponding moment of state X(t|t-1) and X(t-1|t-1) respectively; A ’ is the transposed matrix of A; Q represents the covariance of the system process noise; K g is the adaptive filter gain.
[0020] Furthermore, when using the adaptive filtering algorithm, a sliding block algorithm is used to iterate the AD acquisition data:
[0021] If AD collects N data points, the memory of the first n data points is selected as the temporary storage space, and the first n data points are filtered using the adaptive filtering algorithm. After filtering, the first data point is removed, and the n+1th data point is allowed to enter the temporary storage space to execute the adaptive filtering algorithm again, and then the above operations are performed on the n+2th to Nth data points in sequence.
[0022] Furthermore, the implementation method of the trend anomaly judgment algorithm is:
[0023] Select an odd number of AD data points to perform difference calculation on adjacent values, and record the difference as D i Right now:
[0024] D i =(X i -X i+1 )
[0025] Let S + Record D i is the number of positive moments, S - Record D i The number of negative + >S - There is an upward trend when S + - There is a downward trend from time to time; the basis for judging abnormal data points is the rate of increase or decrease trend: if the rate of increase or decrease trend at a certain moment changes dramatically compared with the previous moment or the next moment, it is judged as an abnormal value.
[0026] Furthermore, the high-precision AD acquisition method based on SOC adaptive filtering also includes S4: executing S2-S3 in a loop.
[0027] Furthermore, the block iteration is specifically as follows:
[0028] The sliding block algorithm is used to iterate the AD collected data. If AD collects N data points, the memory of the first five data points is selected as the temporary storage space, and the adaptive filtering algorithm is used to filter the first five data points. After filtering, the first data point is eliminated, and the sixth data point is allowed to enter the temporary storage space to execute the adaptive filtering algorithm again, and then the above operations are performed on the 7th to Nth data points in sequence.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] Compared with the traditional AD acquisition method, which requires the AD acquisition data to be transmitted to the computer for processing, the present invention does not require the computer, adopts the integrated ZYNQ architecture, and performs filtering processing synchronously when acquiring data, thereby reducing the cost of the system and improving the integration of the system;
[0031] Traditional filtering algorithms usually require pre-setting of parameters or filtering coefficients, and lack the ability to adaptively adjust real-time signal characteristics. The adaptive filtering algorithm designed in the present invention does not require pre-setting of filtering coefficients, and can adaptively correct filtering coefficients, which can better handle complex and changeable signal types, while improving the accuracy of AD acquisition data.
[0032] Compared with the traditional AD acquisition method, the present invention integrates a trend anomaly judgment algorithm and can process erroneous data in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 It is a schematic diagram of the internal structure of SOC;
[0035] Figure 2 This is a flow chart of the implementation of the adaptive filtering high-precision AD acquisition method based on SOC;
[0036] Figure 3 This is a flow chart of the implementation of the adaptive filtering algorithm based on SOC;
[0037] Figure 4 This is a comparison chart of the filtering effect when the amplitude is 0.5V;
[0038] Figure 5 This is a comparison chart of the filtering effect when the amplitude is 1.1V. DETAILED DESCRIPTION
[0039] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0040] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0041] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0042] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0043] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0044] In one embodiment of the present invention, a high-precision AD acquisition method based on SOC adaptive filtering is proposed. Figure 1-Figure 5 The SOC is based on the ZYNQ architecture, the ZYNQ includes an ARM processor core and an FPGA, the ARM is the PS end, and the FPGA is the PL end; the high-precision AD acquisition method based on SOC adaptive filtering includes the following steps:
[0045] S1: setting the PS end and the PL end to perform data communication according to the APB bus communication protocol, the PS end sends a collection instruction to the PL end based on the APB bus communication protocol and receives AD collection data from the PL end;
[0046] S2: After receiving the AD collected data, the PS end uses an adaptive filtering algorithm to perform algorithm filtering on the AD collected data;
[0047] S3: Use a trend anomaly judgment algorithm to perform numerical analysis on the filtered AD acquisition data, filter out prominent abnormal data points that appear instantaneously in the entire data stream, and discard or report the abnormal data points.
[0048] In this embodiment, the adaptive filtering algorithm is implemented by sequentially calculating based on the following formulas:
[0049] X(t)=AX(t-1)+W(t)
[0050] Z(t)=HX(t)+V(t)
[0051] X(t|t-1)=AX(t-1|t-1)
[0052] P(t|t-1)=AP(t-1|t-1)A'+Q
[0053] X(t|t)=X(t|t-1)+K g (t)[Z(t)-HX(t|t-1)]
[0054] K g (t)=P(t|t-1)H' / [HP(t|t-1)H'+R]
[0055] P(t|t)=(IK g (t)H)P(t|t-1)
[0056] in:
[0057] X(t) represents the true value of the system at time t; W(t) represents the process noise of the system at time t; A is the system parameter; Z(t) represents the measured value of AD acquisition at time t; H represents the system measurement parameter value; V(t) represents the measured value of AD system noise; X(t|t-1) represents the predicted result value at the current moment when the state value at the previous moment is known; X(t-1|t-1) represents the best result of the previous state; P(t|t-1) and P(t-1|t-1) represent the variance at the corresponding moment of state X(t|t-1) and X(t-1|t-1) respectively; A ’ is the transposed matrix of A; Q represents the covariance of the system process noise; K g is the adaptive filter gain.
[0058] Furthermore, when using the adaptive filtering algorithm, a sliding block algorithm is used to iterate the AD acquisition data:
[0059] If AD collects N data points, the memory of the first n data points is selected as the temporary storage space, and the first n data points are filtered using the adaptive filtering algorithm. After filtering, the first data point is removed, and the n+1th data point is allowed to enter the temporary storage space to execute the adaptive filtering algorithm again, and then the above operations are performed on the n+2th to Nth data points in sequence.
[0060] In this embodiment, the implementation method of the trend abnormality judgment algorithm is:
[0061] Select an odd number of AD data points to perform difference calculation on adjacent values, and record the difference as D iRight now:
[0062] D i =(X i -X i+1 )
[0063] Let S + Record D i is the number of positive moments, S - Record D i The number of negative + >S - There is an upward trend when S + - There is a downward trend from time to time; the basis for judging abnormal data points is the rate of increase or decrease trend: if the rate of increase or decrease trend at a certain moment changes dramatically compared with the previous moment or the next moment, it is judged as an abnormal value.
[0064] In this embodiment, the high-precision AD acquisition method based on SOC adaptive filtering further includes S4: executing S2-S3 in a loop.
[0065] In this embodiment, the block iteration is specifically as follows:
[0066] The sliding block algorithm is used to iterate the AD collected data. If AD collects N data points, the memory of the first five data points is selected as the temporary storage space, and the adaptive filtering algorithm is used to filter the first five data points. After filtering, the first data point is eliminated, and the sixth data point is allowed to enter the temporary storage space to execute the adaptive filtering algorithm again, and then the above operations are performed on the 7th to Nth data points in sequence.
[0067] This embodiment uses temporary storage space to reduce memory space requirements; loop iteration leads to higher algorithm accuracy; algorithm complexity and space complexity are reduced, the operating efficiency of the CPU is improved, and system consumption is reduced.
[0068] The high-precision AD acquisition method based on SOC adaptive filtering provided in this embodiment uses an adaptive filtering algorithm as the core algorithm to improve the AD acquisition accuracy. Due to chip characteristics and other influencing factors, the voltage collected by the AD chip usually has a certain error with the actual voltage. The actual analog quantity collected is digitally filtered through the adaptive filtering algorithm, and the trend anomaly judgment algorithm is used to process the abnormal values and correct the data. The two work together to obtain a relatively accurate sampling value.
[0069] The SOC described in this embodiment is based on the ZYNQ architecture. The ZYNQ internally integrates an ARM processor core and an FPGA, wherein the ARM processor core is called the PS end and the FPGA is called the PL end. The entire AD acquisition core is divided into two parts. The PS end is responsible for issuing instructions, receiving and processing data, and the PL end is responsible for the conversion and acquisition of AD data. The internal structure of the SOC is shown in the figure below. Figure 1 shown.
[0070] The present invention uses the adaptive filtering algorithm as the core algorithm of AD acquisition. After the system is powered on, the PS end sends an acquisition instruction, the PL end starts the acquisition conversion, and stores the received data in the buffer waiting for the PS end to obtain it. The entire acquisition process is mainly divided into the following steps:
[0071] S1: According to the APB bus communication protocol, the PS end inside ZYNQ communicates with the PL end. The PS end sends acquisition instructions and reads AD acquisition data from the buffer of the PL end.
[0072] S2: After acquiring the collected data, the PS uses an adaptive filtering algorithm to perform algorithm filtering on the AD collected data;
[0073] S3: After algorithm filtering, the PS uses a trend anomaly judgment algorithm to analyze the filtered AD collection data and discards or reports abnormal values.
[0074] Furthermore, in step S2, a model is first established based on the correlation between the value of the AD acquisition system at time t and the value at the moment before time t:
[0075] X(t)=AX(t-1)+W(t) (9)
[0076] In formula (9), W(t) represents the process noise of the system at time t. A is the system parameter itself, and formula (10) represents the actual measurement value of the system, that is,
[0077] Z(t)=HX(t)+V(t) (10)
[0078] In formula (10), Z(t) represents the measured value of AD acquisition at time t, H represents the system measurement parameter value, and V(t) represents the measured value of AD system noise. In this system, V(t) is usually Gaussian distributed, and the variance is represented by Q and R respectively. According to the principle of adaptive filtering, the optimal output value of the system can be estimated by combining the variance values represented by Q and R.
[0079] X(t|t-1)=AX(t-1|t-1) (11)
[0080] In formula (11), X(t|t-1) represents the predicted result value at the current moment when the state value at the previous moment is known, and X(t-1|t-1) represents the best result of the previous state. It can be seen from formula (11) that the system result has been updated. The next step is to update the system variance. Here, it is assumed that the variance is represented by P:
[0081] P(t|t-1)=AP(t-1|t-1)A'+Q (12)
[0082] In formula (12), P(t|t-1) and P(t-1|t-1) represent the variance of states X(t|t-1) and X(t-1|t-1) at the corresponding time, respectively. ’ is the transposed matrix of A, and Q represents the covariance of the system process noise. (11) and (12) can be used to make a relatively complete prediction of the system. Based on the predicted value obtained in the above formula and the actual value collected by the current system, the optimal state value X(t|t) at time t can be obtained according to formula (13), that is:
[0083]
[0084] In formula (14), P(t|t-1) and P(t-1|t-1) represent the states X(t|t-1) and K respectively. g is the adaptive filter gain:
[0085]
[0086] In this process, the variance value of the state at time t needs to be continuously updated, namely:
[0087] P(t|t)=(IK g (t)H)P(t|t-1) (15)
[0088] Furthermore, in step S3, an odd number of data points are selected for
[0089] Adjacent values are subtracted and the difference is recorded as D i Right now:
[0090] D i =(X i -X i+1 ) (16)
[0091] Let S + Record D i is the number of positive moments, S - Record D i When S + >S -When the rate of increase or decrease is higher, there is an upward trend, and vice versa. The judgment of abnormal values is based on the rate of increase or decrease. If the rate of increase or decrease at a certain moment changes dramatically compared with the previous moment or the next moment, it is judged as an abnormal value and the packet is discarded or reported.
[0092] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A high-precision AD acquisition method based on SOC adaptive filtering, wherein the SOC is based on the ZYNQ architecture, the ZYNQ includes an ARM processor core and an FPGA, the ARM is a PS end, and the FPGA is a PL end; characterized in that: The high-precision AD acquisition method based on SOC adaptive filtering comprises the following steps: S1: setting the PS end and the PL end to perform data communication according to the APB bus communication protocol, the PS end sends a collection instruction to the PL end based on the APB bus communication protocol and receives AD collection data from the PL end; S2: After receiving the AD collected data, the PS end uses an adaptive filtering algorithm to perform algorithm filtering on the AD collected data; S3: Use a trend anomaly judgment algorithm to perform numerical analysis on the filtered AD acquisition data, filter out prominent abnormal data points that appear instantaneously in the entire data stream, and discard or report the abnormal data points.
2. The high-precision AD acquisition method based on SOC adaptive filtering according to claim 1 is characterized in that: The adaptive filtering algorithm is implemented based on the following formulas: X(t)=AX(t-1)+W(t) Z(t)=HX(t)+V(t) X(t|t-1)=AX(t-1|t-1) P(t|t-1)=AP(t-1|t-1)A'+Q X(t|t)=X(t|t-1)+K g (t)[Z(t)-HX(t|t-1)] K g (t)=P(t|t-1)H’ / [HP(t|t-1)H’+R] P(t|t)=(I-K g (t)H)P(t|t-1) in: X(t) represents the true value of the system at time t; W(t) represents the process noise of the system at time t; A is the system's own parameter; Z(t) represents the measured value of AD acquisition at time t; H represents the system measurement parameter value; V(t) represents the measured value of AD system noise; X(t|t-1) represents the predicted result value at the current moment when the state value at the previous moment is known; X(t-1|t-1) represents the best result of the previous state; P(t|t-1) and P(t-1|t-1) represent the variances at the corresponding moments of states X(t|t-1) and X(t-1|t-1) respectively; A' is the transposed matrix of A; Q represents the covariance of the system process noise; K g is the adaptive filter gain.
3. The high-precision AD acquisition method based on SOC adaptive filtering according to claim 2 is characterized in that: When using the adaptive filtering algorithm, the sliding block algorithm is used to iterate the AD acquisition data: If AD collects N data points, the memory of the first n data points is selected as the temporary storage space, and the first n data points are filtered using the adaptive filtering algorithm. After filtering, the first data point is removed, and the n+1th data point is allowed to enter the temporary storage space to execute the adaptive filtering algorithm again, and then the above operations are performed on the n+2th to Nth data points in sequence.
4. The high-precision AD acquisition method based on SOC adaptive filtering according to claim 3 is characterized in that: The implementation method of the trend anomaly judgment algorithm is: Select an odd number of AD data points to perform difference calculation on adjacent values, and record the difference as D i Right now: D i =(X i -X i+1 ) Let S + Record D i is the number of positive moments, S - Record D i The number of negative + >S - There is an upward trend when S + - There is a downward trend from time to time; the basis for judging abnormal data points is the rate of increase or decrease trend: if the rate of increase or decrease trend at a certain moment changes dramatically compared with the previous moment or the next moment, it is judged as an abnormal value. 5. The high-precision AD acquisition method based on SOC adaptive filtering according to claim 4 is characterized in that: The high-precision AD acquisition method based on SOC adaptive filtering also includes S4: executing S2-S3 in a loop.
6. The high-precision AD acquisition method based on SOC adaptive filtering according to claim 5 is characterized in that: The block iteration is specifically as follows: The sliding block algorithm is used to iterate the AD collected data. If AD collects N data points, the memory of the first five data points is selected as the temporary storage space, and the adaptive filtering algorithm is used to filter the first five data points. After filtering, the first data point is eliminated, and the sixth data point is allowed to enter the temporary storage space to execute the adaptive filtering algorithm again, and then the above operations are performed on the 7th to Nth data points in sequence.
