CN112290907B - Analog quantity filtering method and device based on embedded system - Google Patents

Analog quantity filtering method and device based on embedded system Download PDF

Info

Publication number
CN112290907B
CN112290907B CN202010987301.3A CN202010987301A CN112290907B CN 112290907 B CN112290907 B CN 112290907B CN 202010987301 A CN202010987301 A CN 202010987301A CN 112290907 B CN112290907 B CN 112290907B
Authority
CN
China
Prior art keywords
data sequence
sampling data
value
previous
filtering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010987301.3A
Other languages
Chinese (zh)
Other versions
CN112290907A (en
Inventor
刘继伟
陈长喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhonghuan Information College Tianjin University Of Technology
Tianjin Agricultural University
Original Assignee
Zhonghuan Information College Tianjin University Of Technology
Tianjin Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhonghuan Information College Tianjin University Of Technology, Tianjin Agricultural University filed Critical Zhonghuan Information College Tianjin University Of Technology
Priority to CN202010987301.3A priority Critical patent/CN112290907B/en
Publication of CN112290907A publication Critical patent/CN112290907A/en
Application granted granted Critical
Publication of CN112290907B publication Critical patent/CN112290907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H17/02Frequency selective networks
    • H03H17/0202Two or more dimensional filters; Filters for complex signals
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H17/02Frequency selective networks
    • H03H17/0202Two or more dimensional filters; Filters for complex signals
    • H03H2017/0205Kalman filters

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)
  • Measurement Of Current Or Voltage (AREA)
  • Analogue/Digital Conversion (AREA)

Abstract

The embodiment of the invention discloses an analog quantity filtering method and a device based on an embedded system, wherein the method comprises the following steps: acquiring a mean value of a previous value sampling data sequence, wherein the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range; acquiring a mean value of a current sampling data sequence, wherein the number of sampling signals of the current sampling data sequence is the same as the number of samples of previous value sampling data; updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence; and filtering the current sampling data sequence according to the updated filter coefficient, the previous value sampling data sequence and the current sampling data sequence. The operation load of the embedded system is reduced. Meanwhile, the filter coefficient of the first-order complementary filter can be updated in real time according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence, and the accuracy of analog quantity filtering is improved while the calculation amount is considered.

Description

Analog quantity filtering method and device based on embedded system
Technical Field
The invention relates to the technical field of analog signal processing, in particular to an analog quantity filtering method and device based on an embedded system.
Background
In an intelligent control system, a sensor is an important device for sensing and measuring various variable quantities, and noise in the use of the sensor directly influences the intelligence. The sensor noise mainly comes from interference inside and outside the system. In the sensor loop, the intensity of noise is related to the superposition mode of signals and noise.
At present, methods such as kalman filtering and mean filtering are usually adopted for filtering noise, that is, a kalman algorithm is adopted to filter analog quantity data after AD conversion, or a certain number of analog quantity values after AD conversion are averaged to obtain a result.
In the process of implementing the invention, the inventor finds the following technical problems: kalman filtering is a common filtering algorithm, and key parameters influencing the filtering effect are estimation of a process noise matrix and an observation noise matrix, and when the process noise matrix and the observation noise matrix are reasonably designed, the Kalman filtering can achieve a satisfactory effect. However, often, appropriate filter parameters cannot be obtained, so that kalman filtering is difficult to achieve a good effect, and even filtering divergence is caused, so that analog quantity data after AD conversion cannot be used. Moreover, the Kalman filtering needs to introduce matrix operation, and for an embedded system, the operation amount is large, so that the normal operation of the embedded system is influenced.
The average filtering algorithm is also a common filtering algorithm, and filters the influence of random noise by averaging a certain number of analog quantities after AD conversion. However, there is a problem in that, when the number of AD conversion results for averaging is small, it is difficult to filter out the influence of random noise, particularly random noise having a large fluctuation range, by the averaging filter algorithm. On the other hand, when the number of the AD conversion results of the average value is large, on the one hand, the measurement result is seriously delayed, and the measurement real-time performance is influenced; on the other hand, the average value calculation requires a large amount of stored Float type data, so that the embedded system resource which is originally caught is more tense. The improved average filtering algorithm and the sliding average filtering algorithm have similar problems.
Disclosure of Invention
The embodiment of the invention provides an analog quantity filtering method and device based on an embedded system, and aims to solve the technical problem that the analog quantity filtering method in the prior art occupies a large amount of resources of the embedded system.
In a first aspect, an embodiment of the present invention provides an analog filtering method based on an embedded system, including:
acquiring a mean value of a previous value sampling data sequence, wherein the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range;
acquiring a mean value of a current sampling data sequence, wherein the number of sampling signals of the current sampling data sequence is the same as the number of samples of previous value sampling data;
updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence;
and filtering the current sampling data sequence according to the updated filter coefficient, the previous value sampling data sequence and the current sampling data sequence.
Further, the updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sample data sequence and the mean value of the current sample data sequence includes:
the filter coefficients are updated as follows:
a=a+(PresentVakye-PreValue)*a*k/PresentVakye
wherein, a is a filter coefficient, K is a correction coefficient, the interval is between 0% and 100%, PreValue is a mean value of a previous value sampling data sequence, and PresentVakye is a mean value of a current sampling data sequence.
Further, the obtaining of the mean value of the previous value sampling data sequence includes:
and carrying out maximum and minimum value filtering on the sampling signals of the previous value sampling data sequence to obtain a filtering previous value sampling data sequence, and calculating the average value of the maximum and minimum value filtered previous value sampling data sequence.
Further, the obtaining a mean value of the current sample data sequence includes:
and carrying out maximum and minimum value filtering on the sampling signals of the current sampling data sequence to obtain a filtered current sampling data sequence, and calculating the average value of the filtered current sampling data sequence with the maximum and minimum values.
Furthermore, the number of the sampling signals of the previous value sampling data sequence is set according to the sampling frequency, so that the time difference value corresponding to the initial data of the previous value sampling data sequence and the initial data of the current sampling data sequence meets a preset time difference value threshold.
Further, before obtaining the mean of the previous-value sample data sequence, the method further includes:
and setting the filter coefficient of the initial first-order complementary filter.
Further, the filtering the current sample data sequence according to the updated filter coefficient, the previous value sample data sequence and the current sample data sequence includes:
the filtering is performed in the following way:
the result of filtering is PresentVakye a + PreValue (1-a)
In a second aspect, an embodiment of the present invention further provides an analog filtering apparatus based on an embedded system, including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a mean value of a previous value sampling data sequence, and the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range;
the second acquisition module is used for acquiring the mean value of the current sampling data sequence, and the number of sampling signals of the current sampling data sequence is the same as the number of sampling signals of the previous value sampling data;
the updating module is used for updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence;
and the filtering module is used for filtering the current sampling data sequence according to the updated filtering coefficient, the previous value sampling data sequence and the current sampling data sequence.
Further, the update module is configured to:
the filter coefficients are updated as follows:
a=a+(PresentVakye-PreValue)*a*k/PresentVakye
wherein, a is a filter coefficient, K is a correction coefficient, the interval is between 0% and 100%, PreValue is a mean value of a previous value sampling data sequence, and PresentVakye is a mean value of a current sampling data sequence.
Further, the first obtaining module includes:
and the first maximum filtering unit is used for carrying out maximum and minimum filtering on the sampling signals of the previous value sampling data sequence to obtain a filtered previous value sampling data sequence and calculating the average value of the maximum and minimum filtered previous value sampling data sequence.
Further, the second obtaining module includes:
and the second maximum and minimum unit is used for carrying out maximum and minimum filtering on the sampling signal of the current sampling data sequence to obtain a filtered current sampling data sequence, and calculating the average value of the filtered current sampling data sequence with the maximum and minimum values.
Furthermore, the number of the sampling signals of the previous value sampling data sequence is set according to the sampling frequency, so that the time difference value corresponding to the initial data of the previous value sampling data sequence and the initial data of the current sampling data sequence meets a preset time difference value threshold.
Further, the apparatus further comprises: and setting the filter coefficient of the initial first-order complementary filter.
Further, the filtering module is configured to:
the filtering is performed as follows:
the result of filtering is presentvackye a + PreValue (1-a).
According to the analog quantity filtering method and device based on the embedded system, the collected previous value sampling data sequence and the collected current sampling data sequence with short time interval are used for calculating the mean value of the previous value sampling data sequence and the mean value of the current sampling data sequence, and because the time interval between the previous value sampling data sequence and the current sampling data sequence is very short, the previous value sampling data sequence and the current sampling data sequence can be respectively considered as related reference quantities, and a first-order complementary filter is used for filtering calculation. Because the first-order complementary filter is simpler in operation and fewer in steps related to floating-point operation, the operation load of the embedded system is reduced. Meanwhile, the filter coefficient of the first-order complementary filter can be updated in real time according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence, and the accuracy of analog quantity filtering is improved while the calculation amount is considered.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments thereof, made with reference to the following drawings:
fig. 1 is a schematic flowchart of an analog filtering method based on an embedded system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an analog filtering method based on an embedded system according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an analog filtering apparatus based on an embedded system according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flowchart of an embodiment of a method for filtering an analog quantity based on an embedded system according to the present invention, where the embodiment is applicable to a situation where an analog quantity is filtered based on an embedded system, and the method can be executed by an analog quantity filtering apparatus based on an embedded system and can be integrated in an embedded system, and specifically includes the following steps:
and S110, acquiring a mean value of a previous value sampling data sequence, wherein the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range.
The embedded system is a special computer system which takes application as a center, is based on modern computer technology and can flexibly cut software and hardware modules according to user requirements, functions, reliability, cost, volume, power consumption, environment and the like.
The embedded system is composed of hardware and software and is a device capable of operating independently. The software content of the software only comprises a software running environment and an operating system thereof. The hardware content includes various contents including a signal processor, a memory, a communication module, and the like. Compared with a general computer processing system, the embedded system has great difference, and cannot realize large-capacity storage function because a large-capacity medium matched with the embedded system is not available. Meanwhile, due to the requirements of application, the operation function of the computer is greatly different from that of a common computer.
In an embedded system, an A/D or D/A module is mainly used for measurement and control. Since the sensor has noise inside and outside the system, it needs to be filtered.
In this embodiment, filtering may be performed using a first order complementary filter. The first-order complementary filter has the advantages of small operation amount and high response speed. The method is suitable for filtering of the embedded system. The conventional first-order complementary filter usually performs filtering calculation with different types of signals, or with signals of the same type that are respectively processed differently as operation factors. In this embodiment, the previous value and the current value may be calculated as the operation factors, respectively, in consideration of the fact that the previous and subsequent sampling time intervals are short.
Meanwhile, in consideration of the scale factor in the first-order complementary filter, the update adjustment is required according to the actually sampled signal. Therefore, it is necessary to acquire a previous-value sample data series and a current sample data series.
In this embodiment, a filter length n (n is not less than 3) may be preset, where the filter length represents the number of analog quantities obtained after AD conversion of each processing by the filter algorithm, where n is too large and causes a large delay in the filter, and n is too small and causes a large amount of noise to be mixed in. And acquiring a previous value sampling data sequence, and calculating to obtain a mean value of the previous value sampling data sequence.
Optionally, the number of sampling signals of the previous value sampling data sequence is set according to a sampling frequency, so that a time difference value corresponding to the previous value sampling data sequence and the current sampling data sequence meets a preset time difference value threshold. To meet the time interval requirement between the two.
And S120, acquiring the mean value of the current sampling data sequence, wherein the number of sampling signals of the current sampling data sequence is the same as the number of samples of the previous value sampling data.
And S130, updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence.
The filter coefficients indicate the confidence level of the previous sampled data sequence and the current sampled data sequence. Therefore, it needs to be updated according to the real-time change of the sampling data sequence, so as to realize that the filtered value can be closer to the actual result.
The filter coefficient of the first-order complementary filter is updated according to the mean value of the previous sample data sequence and the mean value of the current sample data sequence, and the filter coefficient can be updated in the following way:
a=a+(PresentVakye-PreValue)*a*k/PresentVakye
wherein, a is a filter coefficient, K is a correction coefficient, the interval is between 0% and 100%, PreValue is a mean value of a previous value sampling data sequence, and PresentVakye is a mean value of a current sampling data sequence.
Wherein, K can be adjusted manually according to actual change degree. And calculating the ratio of the difference value of the mean value of the current sampling data sequence and the mean value of the previous value sampling data sequence to the mean value of the current sampling data sequence and the product of the filter coefficient and the correction coefficient, and updating the filter coefficient.
And S140, filtering the current sampling data sequence according to the updated filter coefficient, the previous value sampling data sequence and the current sampling data sequence.
The filtering of the current sample data sequence according to the updated filter coefficient, the previous sample data sequence and the current sample data sequence may be performed in the following manner:
the result of filtering is presentvackye a + PreValue (1-a).
In this embodiment, the filtering of the acquired analog quantity can be continuously performed by repeating all the steps. Accordingly, before obtaining the mean of the sequence of previous value sample data, the method further comprises: and setting the filter coefficient of the initial first-order complementary filter. Since there are no updated filter coefficients in the initial stage, an initial filter coefficient can be set manually. The starting filter coefficient may be set between 0-1.
In this embodiment, the average value of the previous sample data sequence and the average value of the current sample data sequence are calculated by using the previous sample data sequence and the current sample data sequence which have short time intervals, and since the time intervals of the previous sample data sequence and the current sample data sequence are very short, the previous sample data sequence and the current sample data sequence can be respectively regarded as related references, and a first-order complementary filter is used for filtering calculation. Because the first-order complementary filter is simpler in operation and fewer in steps related to floating-point operation, the operation load of the embedded system is reduced. Meanwhile, the filter coefficient of the first-order complementary filter can be updated in real time according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence, and the accuracy of analog quantity filtering is improved while the calculation amount is considered.
Example two
Fig. 2 is a schematic flowchart of an analog filtering method based on an embedded system according to a second embodiment of the present invention. In this embodiment, the obtaining of the mean value of the current sample data sequence is specifically optimized as follows: carrying out maximum and minimum value filtering on a sampling signal of the current sampling data sequence; and calculating the average value of the current sampling data sequence after the maximum and minimum values are filtered. And optimizing the pre-acquisition value sample data sequence mean specifically as follows: carrying out maximum and minimum value filtering on a sampling signal of the previous value sampling data sequence; and calculating the mean value of the maximum and minimum value filtered previous value sampling data sequence.
Correspondingly, the analog quantity filtering method based on the embedded system provided by the embodiment specifically includes:
s210, maximum and minimum value filtering is carried out on the sampling signals of the previous value sampling data sequence to obtain a first filtering previous value sampling data sequence, the average value of the maximum and minimum value filtered previous value sampling data sequence is calculated, and the number of the sampling signals of the previous value sampling data sequence is within the range of a preset number threshold value.
It can be seen from the above first-order complementary filtering formula that, compared with kalman filtering, the first-order complementary filtering follows faster but has poor interference rejection because of its simpler operation. In order to avoid the influence of accidental noise on the filtering result, in this embodiment, the maximum and minimum filtering may be used to eliminate the obvious noise data. So that the filtering result is more accurate.
Correspondingly, in this embodiment, maximum and minimum filtering is performed on the sampling signal of the previous value sampling data sequence to obtain a filtered previous value sampling data sequence, and the mean of the maximum and minimum filtered previous value sampling data sequence is calculated.
S220, maximum and minimum value filtering is carried out on the sampling signals of the current sampling data sequence to obtain a filtered current sampling data sequence, and the average value of the filtered current sampling data sequence with the maximum and minimum values is calculated.
Correspondingly, the maximum and minimum value filtering is carried out on the current sampling data sequence, the filtered current sampling data sequence is obtained, and the average value of the filtered current sampling data sequence with the maximum and minimum values is calculated.
And S230, updating the filter coefficient of the first-order complementary filter according to the maximum and minimum value filtered previous value sample data sequence mean value and the current sample data sequence mean value.
And S240, filtering the current sampling data sequence according to the updated filter coefficient, the filtered current sampling data sequence and the filtered current sampling data sequence.
In this embodiment, the obtaining of the mean value of the current sample data sequence is specifically optimized as follows: carrying out maximum and minimum value filtering on a sampling signal of the current sampling data sequence; and calculating the average value of the current sampling data sequence after the maximum and minimum values are filtered. And optimizing the pre-acquisition value sample data sequence mean specifically as follows: carrying out maximum and minimum value filtering on a sampling signal of the previous value sampling data sequence; and calculating the average value of the maximum-minimum value filtered previous value sampling data sequence. The method can reduce the interference of noise on the first-order complementary filtering, reduce the filtering deviation caused by the noise, and reduce the deviation of the influence of the noise on the filtering result on the premise of keeping the high following speed of the first-order complementary filtering.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an analog filtering apparatus based on an embedded system according to a fourth embodiment of the present invention, and as shown in fig. 3, the apparatus includes:
a first obtaining module 310, configured to obtain a mean value of a previous value sampling data sequence, where the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range;
a second obtaining module 320, configured to obtain a mean value of a current sample data sequence, where the number of sample signals of the current sample data sequence is the same as the number of samples of previous sample data;
the updating module 330 is configured to update the filter coefficient of the first-order complementary filter according to the mean value of the previous sample data sequence and the mean value of the current sample data sequence;
and a filtering module 340, configured to filter the current sample data sequence according to the updated filter coefficient, the previous sample data sequence, and the current sample data sequence.
In the analog quantity filtering apparatus based on the embedded system provided in this embodiment, the collected previous value sampling data sequence and the collected current sampling data sequence with a short time interval are used to calculate the mean value of the previous value sampling data sequence and the mean value of the current sampling data sequence. Because the first-order complementary filter is simpler in operation and fewer in steps related to floating-point operation, the operation load of the embedded system is reduced. Meanwhile, the filter coefficient of the first-order complementary filter can be updated in real time according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence, and the accuracy of analog quantity filtering is improved while the calculation amount is considered.
On the basis of the foregoing embodiments, the update module is configured to:
the filter coefficients are updated as follows:
a=a+(PresentVakye-PreValue)*a*k/PresentVakye
wherein, a is a filter coefficient, K is a correction coefficient, the interval is between 0% and 100%, PreValue is a mean value of a previous value sampling data sequence, and PresentVakye is a mean value of a current sampling data sequence.
On the basis of the foregoing embodiments, the first obtaining module includes:
and the first maximum filtering unit is used for carrying out maximum and minimum filtering on the sampling signals of the previous value sampling data sequence to obtain a filtered previous value sampling data sequence and calculating the average value of the maximum and minimum filtered previous value sampling data sequence.
On the basis of the foregoing embodiments, the second obtaining module includes:
and the second maximum and minimum unit is used for carrying out maximum and minimum filtering on the sampling signal of the current sampling data sequence to obtain a filtered current sampling data sequence, and calculating the average value of the filtered current sampling data sequence with the maximum and minimum values.
On the basis of the above embodiments, the number of sampling signals of the previous value sampling data sequence is set according to a sampling frequency, so that a time difference value corresponding to initial data of the previous value sampling data sequence and initial data of the current sampling data sequence satisfies a preset time difference value threshold.
On the basis of the above embodiments, the apparatus further includes: and setting the filter coefficient of the initial first-order complementary filter.
On the basis of the foregoing embodiments, the filtering module is configured to:
the filtering is performed in the following way:
the result of filtering is presentvackye a + PreValue (1-a).
The analog quantity filtering device based on the embedded system provided by the embodiment of the invention can execute the analog quantity filtering method based on the embedded system provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or the portions contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for causing an embedded controller to execute the method according to the embodiments of the present invention.
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An analog quantity filtering method based on an embedded system is characterized by comprising the following steps:
acquiring a mean value of a previous value sampling data sequence, wherein the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range;
acquiring a mean value of a current sampling data sequence, wherein the number of sampling signals of the current sampling data sequence is the same as the number of samples of previous value sampling data;
updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence;
and filtering the current sampling data sequence according to the updated filter coefficient, the previous value sampling data sequence and the current sampling data sequence.
2. The method of claim 1, wherein updating the filter coefficients of the first-order complementary filter according to the mean value of the previous sampled data sequence and the mean value of the current sampled data sequence comprises:
the filter coefficients are updated as follows:
a=a+(PresentVakye-PreValue)*a*k/PresentVakye
wherein, a is a filter coefficient, K is a correction coefficient, the interval is between 0% and 100%, PreValue is a mean value of a previous value sampling data sequence, and PresentVakye is a mean value of a current sampling data sequence.
3. The method of claim 1, wherein obtaining the pre-value sample data sequence mean comprises:
and carrying out maximum and minimum value filtering on the sampling signals of the previous value sampling data sequence to obtain a filtering previous value sampling data sequence, and calculating the average value of the maximum and minimum value filtered previous value sampling data sequence.
4. The method of claim 1, wherein obtaining the current sample data sequence mean comprises:
and carrying out maximum and minimum value filtering on the sampling signal of the current sampling data sequence to obtain a filtered current sampling data sequence, and calculating the average value of the filtered current sampling data sequence with the maximum and minimum values.
5. The method according to claim 1, wherein the number of sampling signals of the previous sampled data sequence is set according to a sampling frequency, so that a time difference value corresponding to initial data of the previous sampled data sequence and initial data of the current sampled data sequence satisfies a preset time difference value threshold.
6. The method of claim 1, wherein prior to obtaining the mean of the sequence of previous value sample data, the method further comprises:
and setting the filter coefficient of the initial first-order complementary filter.
7. The method of claim 2, wherein filtering the current sample data sequence according to the updated filter coefficients, the previous sample data sequence, and the current sample data sequence comprises:
the filtering is performed as follows:
the result of filtering = PresentVakye a + PreValue (1-a).
8. An analog quantity filtering device based on an embedded system is characterized by comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a mean value of a previous value sampling data sequence, and the number of sampling signals of the previous value sampling data sequence is within a preset number threshold range;
the second acquisition module is used for acquiring the mean value of the current sampling data sequence, and the number of sampling signals of the current sampling data sequence is the same as the number of sampling signals of the previous value sampling data;
the updating module is used for updating the filter coefficient of the first-order complementary filter according to the mean value of the previous sampling data sequence and the mean value of the current sampling data sequence;
and the filtering module is used for filtering the current sampling data sequence according to the updated filtering coefficient, the previous value sampling data sequence and the current sampling data sequence.
9. The apparatus of claim 8, wherein the update module is configured to:
the filter coefficients are updated as follows:
a=a+(PresentVakye-PreValue)*a*k/PresentVakye
wherein, a is a filter coefficient, K is a correction coefficient, the interval is between 0% and 100%, PreValue is a mean value of a previous value sampling data sequence, and PresentVakye is a mean value of a current sampling data sequence.
10. The apparatus of claim 8, wherein the first obtaining module comprises:
and the setting unit is used for setting the number of sampling signals of the previous value sampling data sequence according to the sampling frequency so that the time difference value corresponding to the previous value sampling data sequence and the current sampling data sequence meets a preset time difference value threshold.
CN202010987301.3A 2020-09-18 2020-09-18 Analog quantity filtering method and device based on embedded system Active CN112290907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010987301.3A CN112290907B (en) 2020-09-18 2020-09-18 Analog quantity filtering method and device based on embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010987301.3A CN112290907B (en) 2020-09-18 2020-09-18 Analog quantity filtering method and device based on embedded system

Publications (2)

Publication Number Publication Date
CN112290907A CN112290907A (en) 2021-01-29
CN112290907B true CN112290907B (en) 2022-07-01

Family

ID=74420556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010987301.3A Active CN112290907B (en) 2020-09-18 2020-09-18 Analog quantity filtering method and device based on embedded system

Country Status (1)

Country Link
CN (1) CN112290907B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106972840A (en) * 2017-02-28 2017-07-21 深圳市鼎阳科技有限公司 A kind of sampling rate converting method and device
CN107395158A (en) * 2017-07-14 2017-11-24 歌尔科技有限公司 Data calibration method and device
CN109104080A (en) * 2018-07-18 2018-12-28 安徽省航嘉智源科技有限公司 Adjusting method, storage medium and terminal are filtered in a kind of power conversion device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7922665B2 (en) * 2006-09-28 2011-04-12 Nellcor Puritan Bennett Llc System and method for pulse rate calculation using a scheme for alternate weighting

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106972840A (en) * 2017-02-28 2017-07-21 深圳市鼎阳科技有限公司 A kind of sampling rate converting method and device
CN107395158A (en) * 2017-07-14 2017-11-24 歌尔科技有限公司 Data calibration method and device
CN109104080A (en) * 2018-07-18 2018-12-28 安徽省航嘉智源科技有限公司 Adjusting method, storage medium and terminal are filtered in a kind of power conversion device

Also Published As

Publication number Publication date
CN112290907A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN110492868B (en) Multi-parameter variable-step LMS self-adaptive filtering method
CN111006691B (en) Sensor drift correction method and device, readable storage medium, electronic device and unmanned aerial vehicle
CN109729032B (en) Method and device for correcting frequency offset estimation value and computer readable storage medium
CN112290907B (en) Analog quantity filtering method and device based on embedded system
CN108809272B (en) Polynomial Kalman filtering method and filter
CN114866069A (en) First-order lag filtering system with high sensitivity dynamic adjustment
CN107943142A (en) A kind of temperature controlled method of low temperature radiometer based on Kalman filtering
CN108831496B (en) echo suppression method and device, storage medium and electronic equipment
CN109725188B (en) Current measuring method and device
CN116707491A (en) FIR low-pass digital filtering method for reducing resource consumption
CN114111846B (en) Compensation method and device suitable for Hall sensor and storage medium
CN106814608B (en) Predictive control adaptive filtering algorithm based on posterior probability distribution
CN112398454B (en) Method and device for adjusting amplification factor of analog amplification circuit
CN109756205B (en) Phasor calculation compensation method and system for median filtering flat-top distortion
US11333678B2 (en) Method for offset calibration of a yaw rate sensor signal of a yaw rate sensor, system and computer program
CN113225047A (en) TVLP-MF-based dynamic checkweigher rapid filtering method and system
CN114330850A (en) Abnormal relative tendency generation method and system for climate prediction
CN112748682B (en) Signal sampling processing method, device, equipment and storage medium
CN113497633A (en) Method for improving IP2 index of zero intermediate frequency and low intermediate frequency architecture receiver and architecture thereof
CN115882823A (en) Software filtering method of fA-level weak current signal, electronic device and storage medium
CN117879540B (en) Magnetic compass sensor self-adaptive signal filtering method based on improved Kalman filtering
CN114650203B (en) Single-frequency amplitude noise suppression measurement method
CN114740146B (en) Formaldehyde detection method and formaldehyde detection device
CN111399018B (en) Smoothing processing method and device for carrier phase in GNSS
CN117833914A (en) Low-pass filtering method and system for quick response of analog signal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant