[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113962243A - Truth table-based median filtering method, system and related device - Google Patents

Truth table-based median filtering method, system and related device Download PDF

Info

Publication number
CN113962243A
CN113962243A CN202010621823.1A CN202010621823A CN113962243A CN 113962243 A CN113962243 A CN 113962243A CN 202010621823 A CN202010621823 A CN 202010621823A CN 113962243 A CN113962243 A CN 113962243A
Authority
CN
China
Prior art keywords
comparison
input data
truth table
value
establishing
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.)
Pending
Application number
CN202010621823.1A
Other languages
Chinese (zh)
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.)
Peitian Robot Technology Co Ltd
Original Assignee
Peitian Robot Technology Co Ltd
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 Peitian Robot Technology Co Ltd filed Critical Peitian Robot Technology Co Ltd
Priority to CN202010621823.1A priority Critical patent/CN113962243A/en
Publication of CN113962243A publication Critical patent/CN113962243A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/02Preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The application provides a median filtering method based on a truth table, which comprises the following steps: acquiring input data; establishing a comparison truth table between every two input data; establishing an extremum lookup table of the input data according to the comparison truth table; comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the magnitude sequence of the input data; and deleting the extreme values in the input data according to the size sequence. According to the filtering method and the filtering device, a truth table is established by carrying out logic comparison on filtered data, the extreme value of the data is rapidly determined through logic judgment and is screened out, parallel comparison of the data is realized, data sequencing is rapidly determined, time consumption is low, and filtering operation efficiency is greatly improved. The application also provides a truth table-based median filtering system, a computer-readable storage medium and an electronic device, which have the beneficial effects.

Description

Truth table-based median filtering method, system and related device
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method, a system and a related apparatus for median filtering based on a truth table.
Background
In a servo system or other digital control platforms, because of factors such as a discretized sampling mode, a physical design principle of various sensors, environmental influences and the like, a signal noise problem inevitably exists, and the introduction of noise can cause the control performance of the system to be influenced, therefore, in order to eliminate the noise problem, a corresponding filtering means needs to be introduced into the digital control platform, wherein a basic filtering mode is a median value + mean value combined filtering mode, firstly, extreme values (a maximum value and a minimum value) are detected and screened out through the median value filtering mode, the maximum interference and the minimum interference of external noise are reduced, and then, the fluctuation of a processed signal is reduced as much as possible through the mean value filtering summation and averaging mode, so that a better filtering effect is achieved.
Common control platforms, such as DSP and ARM, need to implement median filtering, and often need to sort the filtered data by size through a correlation algorithm (such as bubbling, fast sorting, merging sorting, etc.), and remove the maximum value and the minimum value. Due to the fact that the comparison times of the sequencing method are more, efficiency is not high for a control platform of serial computing, and related filtering work can be completed by dozens of to dozens of system clocks. For a control system with high real-time requirement, the operation time is relatively more, and the efficiency is not high.
Disclosure of Invention
An object of the present application is to provide a truth table based median filtering method, system, computer-readable storage medium, and electronic device, which can improve median filtering efficiency.
In order to solve the above technical problem, the present application provides a median filtering method based on a truth table, and the specific technical scheme is as follows:
acquiring input data;
establishing a comparison truth table between every two input data;
establishing an extremum lookup table of the input data according to the comparison truth table;
comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the magnitude sequence of the input data;
and deleting the extreme values in the input data according to the size sequence.
Optionally, the establishing of the extremum lookup table of the input data according to the comparison truth table includes:
obtaining the first comp value from the comparison truth table;
and calculating a second comp value of the first comp value under different extreme value combinations to obtain an extreme value lookup table.
Optionally, the establishing of the comparison truth table between every two input data includes:
and utilizing FGPA to parallelly calculate a comparison truth value between every two input data and establishing a comparison truth table.
Optionally, the establishing of the extremum lookup table of the input data according to the comparison truth table includes:
and establishing an extremum lookup table of the input data by using the case branch of the FGPA and according to the comparison truth table.
The present application further provides a truth table based median filtering system, including:
the acquisition module is used for acquiring input data;
the comparison module is used for establishing a comparison truth table between every two input data;
the extreme value searching module is used for establishing an extreme value searching table of the input data according to the comparison truth table;
the order determining module is used for comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the size order of the input data;
and the filtering module is used for deleting the extreme values in the input data according to the size sequence.
Optionally, the extremum searching module includes:
an obtaining unit, configured to obtain the first comp value from the comparison truth table;
and the calculating unit is used for calculating a second comp value of the first comp value under different extreme value combinations to obtain an extreme value lookup table.
Optionally, the comparing module is a module for parallel computing a comparison truth value between every two input data by using FGPA and establishing a comparison truth table.
Optionally, the extremum lookup module is a module that utilizes the case branch of the FGPA and establishes the extremum lookup table of the input data according to the comparison truth table.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.
The present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described above when calling the computer program in the memory.
The application provides a median filtering method based on a truth table, which comprises the following steps: acquiring input data; establishing a comparison truth table between every two input data; establishing an extremum lookup table of the input data according to the comparison truth table; comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the magnitude sequence of the input data; and deleting the extreme values in the input data according to the size sequence.
According to the filtering method and the filtering device, a truth table is established by carrying out logic comparison on filtered data, the extreme value of the data is rapidly determined through logic judgment and is screened out, parallel comparison of the data is realized, data sequencing is rapidly determined, time consumption is low, and filtering operation efficiency is greatly improved. The application also provides a truth table-based median filtering system, a computer-readable storage medium and an electronic device, which have the above beneficial effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a truth table based median filtering method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a truth-table-based median filtering system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a truth table based median filtering method according to an embodiment of the present application, the method including:
s101: acquiring input data;
s102: establishing a comparison truth table between every two input data;
this step aims to establish a comparison truth table, i.e. two input data are compared, and the true result is 1, and the false result is 0. The specific alignment process is not limited herein, and generally, the determination may be made by using a method of not less than or equal to the above determination, or a method of not less than or equal to the below determination. In this step, only two arbitrary input data are required to be compared, and the magnitude relationship between the two arbitrary input data can be uniquely determined by comparing the truth table. However, it is not necessary to determine a specific relationship, and it is possible to determine that a is not smaller than B, for example.
S103: establishing an extremum lookup table of input data according to the comparison truth table;
this step aims to establish an extremum lookup table, in other words, two arbitrary data in the input data are respectively assumed to be a maximum value and a minimum value for judgment.
Preferably, this step can be performed as follows:
s1031: obtaining a first comp value from a comparison truth table;
s1032: and calculating a second comp value of the first comp value under different extreme value combinations to obtain an extreme value lookup table.
For example, there are four ABCD input data currently, this step needs an extremum lookup table assuming twelve cases in total, i.e., a is a maximum value, B is a minimum value, a is a maximum value, D is a minimum value, B is a maximum value, a is a minimum value, B is a maximum value, C is a maximum value, D is a minimum value, C is a maximum value, a is a minimum value, C is a maximum value, B is a minimum value, C is a maximum value, D is a minimum value, D is a maximum value, a is a minimum value, D is a maximum value, B is a minimum value, D is a maximum value, C is a minimum value, and the like.
S104: comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the magnitude sequence of the input data;
the first comp value refers to the comparison of every two data, the comparison truth table and the extreme value lookup table are actually needed to be compared in the step, and the result of which extreme value lookup table is in accordance with the result of the comparison truth table is seen, so that the maximum value and the minimum value can be directly determined.
In addition, since the magnitude relationship between two data in the extremum lookup table has already been determined, not only the maximum value and the minimum value can be determined, but actually the magnitude relationship between all input data has already been uniquely determined.
S105: and deleting the extremum in the input data according to the size sequence.
After the extreme values are determined, the extreme values (including the maximum values and the minimum values) can be deleted to implement the filtering.
On the basis of the above embodiment, when step S102 is executed, the FGPA may be used to calculate the comparison truth value between every two input data in parallel and establish the comparison truth table, and further, when step S103 is executed, the case branch of the FGPA may be used to establish the extremum lookup table of the input data according to the comparison truth table, so that the parallel logic calculation function of the FPGA may be used to complete the whole calculation process in one clock, the operation time overhead is short, and the filtering efficiency is greatly improved.
According to the embodiment of the application, the truth table is established by carrying out logic comparison on the filtered data, the extreme value of the data is rapidly determined through logic judgment and screened out, parallel comparison of the data is realized, data sequencing is rapidly determined, time consumption is low, and the filtering operation efficiency is greatly improved.
A truth table based median filtering method provided by the present application is described in a specific application:
let us assume that there are 4 data, In1, In2, In3, and In 4. Maxima and minima need to be removed from the four numbers.
Firstly, a comparison truth table of input data is established, as shown in the following table 1:
table 1 comparative truth table
In1>=In2? Comp[0]
In1>=In3? Comp[1]
In1>=In4? Comp[2]
In2>=In3? Comp[3]
In2>=In4? Comp[4]
In3>=In4? Comp[5]
In Table 1, Comp is a 6-bit variable, Comp [0] represents the 0 th bit of Comp variable, which represents the comparison result of In1 and In2, and Comp [0] bit is set to 1 to indicate "logic true" if In1 data is equal to or greater than In2, and 0 to indicate "logic false"; comp [1] represents the 1 st bit of the Comp variable, which represents the result of comparing the input data In1 with In3, if the In1 data is equal to or greater than In3, the Comp [1] bit is set to 1, indicating "logic true", otherwise 0, indicating "logic false", and so on. According to the size of 4 input data, a corresponding truth table is established, and finally a set value Comp of 6 bits of the Comp variable is obtained.
And step two, establishing an extremum lookup table of 4 input data. As shown in table 2 below:
TABLE 2 extrema lookup table
Figure BDA0002565412130000061
Figure BDA0002565412130000062
Figure BDA0002565412130000071
Figure BDA0002565412130000072
Figure BDA0002565412130000073
Figure BDA0002565412130000081
Figure BDA0002565412130000082
Figure BDA0002565412130000083
Figure BDA0002565412130000091
In the above table, the corresponding Comp variable combinations under all extreme values are counted, and the "arbitrary" characters in the table represent that the corresponding data size relationship in the table is arbitrary and does not affect the judgment result of the array extreme values, and the value of "X" may be either 0 or 1. Therefore, if the Comp values corresponding to the 4 input data after comparison are obtained from table 1, the Comp values can be compared and matched with the Comp combinations corresponding to the extremum values in table 2, so as to determine the corresponding sorting relation of the 4 data.
And step three, comparing and matching the Comp value obtained in the step 1 with the Comp value given in the lookup table (Comp corresponding data values under various extreme value combinations) pre-established in the step two, thereby determining the sorting relation of the input data, finding the maximum value and the minimum value in the data and screening out the maximum value and the minimum value.
The extreme value lookup table in table 2 can be obtained in advance through derivation, so that no overhead is occupied in actual operation, when an FPGA platform is used for operation, the operation of each bit in the variable Comp in table 1 can be performed synchronously, so that the operation can be completed only by 1 clock cycle, after the Comp value is obtained, the extreme value in the input data can be determined and screened out by performing table lookup judgment in the second step through case branch judgment, and if the FPGA is used for logic judgment, the whole process can be completed in one clock, so that the operation time overhead is short, and the efficiency is high.
In the following, a truth table based median filtering system provided by an embodiment of the present application is introduced, and the below described median filtering system and the above described truth table based median filtering method may be referred to correspondingly.
Referring to fig. 2, the present application further provides a truth table based median filtering system, including:
an obtaining module 100, configured to obtain input data;
a comparison module 200, configured to establish a truth comparison table between every two input data;
an extremum lookup module 300, configured to establish an extremum lookup table of the input data according to the comparison truth table;
a sequence determining module 400, configured to compare the first comp value in the comparison truth table with the second comp value in the extremum lookup table, and determine a magnitude sequence of the input data;
and a filtering module 500, configured to delete the extremum in the input data according to the size order.
Optionally, the extremum seeking module 300 includes:
an obtaining unit, configured to obtain the first comp value from the comparison truth table;
and the calculating unit is used for calculating a second comp value of the first comp value under different extreme value combinations to obtain an extreme value lookup table.
Optionally, the comparing module 200 is a module for parallel computing a comparison truth value between two input data by using FGPA and establishing a comparison truth table.
Optionally, the extremum lookup module 300 is a module that utilizes the case branch of the FGPA and establishes the extremum lookup table of the input data according to the comparison truth table.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application further provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the electronic device may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method of truth table based median filtering comprising:
acquiring input data;
establishing a comparison truth table between every two input data;
establishing an extremum lookup table of the input data according to the comparison truth table;
comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the magnitude sequence of the input data;
and deleting the extreme values in the input data according to the size sequence.
2. The median filtering method according to claim 1, wherein establishing an extremum lookup table for the input data based on the comparison truth table comprises:
obtaining the first comp value from the comparison truth table;
and calculating a second comp value of the first comp value under different extreme value combinations to obtain an extreme value lookup table.
3. The median filtering method according to claim 1, wherein establishing a truth table for comparison between two of said input data comprises:
and utilizing FGPA to parallelly calculate a comparison truth value between every two input data and establishing a comparison truth table.
4. The median filtering method according to claim 3, wherein establishing an extremum lookup table for the input data based on the comparison truth table comprises:
and establishing an extremum lookup table of the input data by using the case branch of the FGPA and according to the comparison truth table.
5. A truth table based median filtering system comprising:
the acquisition module is used for acquiring input data;
the comparison module is used for establishing a comparison truth table between every two input data;
the extreme value searching module is used for establishing an extreme value searching table of the input data according to the comparison truth table;
the order determining module is used for comparing a first comp value in the comparison truth table with a second comp value in the extremum lookup table to confirm the size order of the input data;
and the filtering module is used for deleting the extreme values in the input data according to the size sequence.
6. The median filtering system of claim 5, wherein the extremum seeking module comprises:
an obtaining unit, configured to obtain the first comp value from the comparison truth table;
and the calculating unit is used for calculating a second comp value of the first comp value under different extreme value combinations to obtain an extreme value lookup table.
7. The median filtering system according to claim 5, wherein the comparing module is a module for parallel computing a comparison truth value between two input data using FGPA and establishing a comparison truth table.
8. The median filtering system according to claim 7, wherein the extremum lookup module is a module for establishing an extremum lookup table of the input data using case branches of the FGPA and according to the comparison truth table.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the median filtering method according to any one of claims 1 to 4.
10. An electronic device, comprising a memory in which a computer program is stored and a processor, wherein the processor, when calling the computer program in the memory, implements the steps of the median filtering method according to any one of claims 1 to 4.
CN202010621823.1A 2020-07-01 2020-07-01 Truth table-based median filtering method, system and related device Pending CN113962243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010621823.1A CN113962243A (en) 2020-07-01 2020-07-01 Truth table-based median filtering method, system and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010621823.1A CN113962243A (en) 2020-07-01 2020-07-01 Truth table-based median filtering method, system and related device

Publications (1)

Publication Number Publication Date
CN113962243A true CN113962243A (en) 2022-01-21

Family

ID=79459210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010621823.1A Pending CN113962243A (en) 2020-07-01 2020-07-01 Truth table-based median filtering method, system and related device

Country Status (1)

Country Link
CN (1) CN113962243A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183405A (en) * 2007-11-30 2008-05-21 西安交通大学 Realization method of small world algorithm hardware platform based on FPGA
CN101263487A (en) * 2005-07-28 2008-09-10 阿纳洛格装置公司 Instruction based parallel median filtering processor and method
US20190065186A1 (en) * 2017-08-29 2019-02-28 Gsi Technology Inc. Method for min-max computation in associative memory
US20190235863A1 (en) * 2018-01-31 2019-08-01 Qualcomm Incorporated Sort instructions for reconfigurable computing cores
CN111260042A (en) * 2018-11-30 2020-06-09 上海寒武纪信息科技有限公司 Data selector, data processing method, chip and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101263487A (en) * 2005-07-28 2008-09-10 阿纳洛格装置公司 Instruction based parallel median filtering processor and method
CN101183405A (en) * 2007-11-30 2008-05-21 西安交通大学 Realization method of small world algorithm hardware platform based on FPGA
US20190065186A1 (en) * 2017-08-29 2019-02-28 Gsi Technology Inc. Method for min-max computation in associative memory
US20190235863A1 (en) * 2018-01-31 2019-08-01 Qualcomm Incorporated Sort instructions for reconfigurable computing cores
CN111260042A (en) * 2018-11-30 2020-06-09 上海寒武纪信息科技有限公司 Data selector, data processing method, chip and electronic equipment

Similar Documents

Publication Publication Date Title
CN103514201B (en) Method and device for querying data in non-relational database
CN112162977A (en) MES-oriented massive data redundancy removing method and system
CN111460098A (en) Text matching method and device and terminal equipment
CN113962243A (en) Truth table-based median filtering method, system and related device
CN109657060B (en) Safety production accident case pushing method and system
CN109100165A (en) Bridge operation modal analysis method, device, terminal and computer readable storage medium
CN1783092A (en) Data analysis device and data analysis method
CN110263417B (en) A method, device and electronic equipment for obtaining timing characteristics
CN111159490B (en) Method, device and equipment for processing pattern character strings
CN115865138B (en) Method and device for capturing near field communication signal, electronic equipment and medium
CN117992197A (en) Neural network model mapping scheduling operation method and device, electronic equipment and medium
US8626688B2 (en) Pattern matching device and method using non-deterministic finite automaton
CN112393799B (en) Far-field voice equipment detection method and device and television terminal
CN112882907B (en) User state determination method and device based on log data
CN113743609B (en) Multi-signal-oriented rapid breakpoint detection method, system, equipment and storage medium
CN113495901A (en) Variable-length data block oriented quick retrieval method
CN115660957A (en) Resampling method, device, equipment and medium for waveform data
CN114139512B (en) Electronic form control method, electronic form control device, computer readable storage medium and server
CN114547139B (en) A time series similarity search method, recording medium and system
CN111934910B (en) Fault processing method, equipment and storage medium
CN114023385B (en) A method for determining differentially expressed genes in RNA-seq and its application
CN113468347B (en) Method and device for data recall, electronic equipment and readable storage medium
CN117271098B (en) AI model calculation core scheduling method, device, equipment and storage medium
CN118732588B (en) A filtering optimization method, system, computer device, readable medium and vehicle
CN115374388A (en) Multidimensional array compression and decompression method and device

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