Filtering processing method and system
By calculating the mean and first-order derivative of the original data, evaluating the waveform quality and dynamically adjusting the tolerance value, the problem of insufficient quality of interference signal filtering in EFT experiments is solved, and effective filtering of spike interference and signal accuracy is achieved.
Patent Information
- Application Number
- CN202310774297.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2024-12-31
AI Technical Summary
The prior art cannot effectively improve the filtering quality of EFT experimental interference signals, and the mean filtering method cannot completely remove spike interference.
By calculating the mean, first-order derivative and first-order derivative mean of the original data, determine the waveform quality, select better data for filtering, and dynamically adjust the mean tolerance value to improve the filtering effect.
Effectively filter out spike interference in the signal, improve the filtering quality of EFT experimental interference signals, and improve signal accuracy.
Smart Images

Figure CN119232116A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of signal processing, and in particular to a filtering processing method and system. Background Art
[0002] Software filtering mainly performs multiple uniform sampling of the input signal, averages the sampling results, and then uses the averaging or sliding average method to filter out interference signals.
[0003] However, the EFT fast pulse group experiment will produce a large amount of pulse interference, causing a large number of spikes in the signal with high repeatability. The accuracy of the signal after using the mean filter will exceed the accuracy range, and the interference cannot be completely filtered out. Therefore, the interference of the EFT experiment cannot be effectively filtered out by the above mean filtering method. How to improve the filtering quality of the EFT experiment interference signal has become an urgent problem to be solved. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a filtering processing method and system to at least solve the above-mentioned problem that the filtering quality of the EFT experimental interference signal cannot be effectively improved.
[0005] In order to achieve the above object, the present invention provides a filtering processing method in a first aspect, comprising:
[0006] Calculate the mean, first-order derivative and first-order derivative mean of the collected raw data;
[0007] According to the mean value of the original data, the number of first bad pixels in the original data is determined;
[0008] According to the first-order derivative and the mean of the first-order derivative of the original data, the number of second bad points in the first-order derivative is determined;
[0009] Based on the first bad pixel number and the second bad pixel number, determine the current waveform quality result;
[0010] The current waveform quality result is compared with the waveform quality result at the previous moment to obtain a comparison result, and a filtering processing scheme is determined based on the comparison result.
[0011] Optionally, the determining the number of first bad pixels in the original data according to the mean of the original data includes:
[0012] Calculate the absolute value of the first difference between each original data and the mean of the original data;
[0013] The original data whose absolute value of the first difference is greater than the mean tolerance value is determined as the first bad pixel, and the number of the first bad pixels is counted.
[0014] Optionally, judging the current waveform quality result based on the first number of bad pixels and the second number of bad pixels includes:
[0015] The first judgment is performed based on the first number of bad pixels and the number of bad pixels allowed by the mean. When the first number of bad pixels is less than the number of bad pixels allowed by the mean, the current waveform quality result is determined to be the highest quality level. Otherwise, the second judgment is performed based on the second number of bad pixels and the number of bad pixels allowed by the first-order derivative.
[0016] Optionally, performing a second determination based on the second number of bad pixels and the number of bad pixels allowed by the first-order derivative includes:
[0017] If the second number of bad pixels is not less than the number of bad pixels allowed by the first-order derivative, the current waveform quality result is determined to be the lowest quality level;
[0018] If the second number of bad pixels is less than the number of bad pixels allowed by the first-order derivative, the quality level of the current waveform is determined based on the correspondence between the quantitative difference between the two and a preset quality determination table, wherein the preset quality determination table stores the correspondence between the quantitative difference between the second number of bad pixels and the number of bad pixels allowed by the first-order derivative and the waveform quality level.
[0019] Optionally, the filtering processing method further includes:
[0020] When the current waveform quality result is determined to be the highest quality level, if the number of original data whose absolute value of the first difference is greater than the tolerance ratio of the mean tolerance value is less than the number of bad pixels allowed by the mean, the mean tolerance value is reduced by a first preset ratio;
[0021] When it is determined that the current waveform quality result is of the lowest quality level, the current waveform quality result is recorded into a preset number of waveform quality samples, and the oldest waveform quality result among the waveform quality samples is removed;
[0022] When the waveform quality results recorded by the latest preset number of waveform quality samples are all at the lowest quality level, the mean tolerance value is increased by a second preset proportion.
[0023] Optionally, when the waveform quality results recorded by the latest preset number of waveform quality samples are all of the lowest quality level, after the mean tolerance value is increased by a second preset ratio, the method further includes:
[0024] When the mean tolerance value rises to a preset multiple of the initial mean tolerance value and the waveform quality results recorded by the latest preset number of waveform quality samples are still at the lowest quality level, the filter is determined to be invalid; otherwise, the filter is determined to be valid.
[0025] Optionally, the above-mentioned filtering processing scheme includes outputting filtering failure information or outputting filtering non-failure information;
[0026] Determine the filtering processing scheme based on the comparison results, including:
[0027] If the filter is judged to be failed, the filter failure information is output;
[0028] If it is determined that the filter has not failed, the information that the filter has not failed is output.
[0029] Optionally, the first-order derivative and the first-order derivative mean of the raw data collected by calculation include:
[0030] When there are N collected raw data, the difference between two adjacent raw data is calculated to obtain N-1 samples;
[0031] Divide N-1 samples equally into two data sets, and calculate the first-order derivative based on the two data sets obtained;
[0032] The first-order derivatives are summed and then averaged to obtain the mean of the first-order derivatives.
[0033] Optionally, the N-1 samples are equally divided into two data sets, and the first-order derivative is calculated based on the two data sets, including:
[0034] Take the first half of the N-1 samples as a data set, and take the second half of the N-1 samples as a data set;
[0035] The nth data in the second half of the N-1 samples is added to the nth data in the first half of the N-1 samples to obtain a first-order derivative, wherein if N-1 is an odd number, the (N-1) / 2th data in the N-1 samples is discarded, and 1≤n≤(N-1) / 2, where n is an integer.
[0036] Optionally, the determining the number of second bad pixels in the first-order derivative according to the first-order derivative and the mean of the first-order derivative of the original data includes:
[0037] Calculate the absolute value of the second difference between each first-order derivative and the mean of the first-order derivatives;
[0038] The first-order derivative whose absolute value of the second difference is greater than the first-order derivative tolerance value is determined as the second bad pixel, and the number of the second bad pixels is counted.
[0039] Optionally, the filtering processing scheme includes outputting a mean value;
[0040] Compare the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determine a filtering processing scheme based on the comparison result, including:
[0041] If the current waveform quality result is worse than the waveform quality result at the previous moment, the output mean is the mean at the previous moment, otherwise the output mean is the current mean.
[0042] Optionally, before comparing the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, the method further includes:
[0043] If the difference between the current mean and the previous mean is less than the preset stability value, the current mean copies the previous mean.
[0044] A second aspect of the present invention provides a filtering processing system, comprising:
[0045] A mean calculation module, used to calculate the mean, first-order derivative and first-order derivative mean of the collected original data;
[0046] A first bad pixel quantity determination module, used to determine the first bad pixel quantity in the original data according to the mean value of the original data;
[0047] A second bad pixel quantity determination module, used to determine the second bad pixel quantity in the first-order derivative according to the first-order derivative and the first-order derivative mean of the original data;
[0048] A waveform quality judgment module, used for judging the current waveform quality result based on the first bad pixel number and the second bad pixel number;
[0049] The filtering processing scheme determination module is used to compare the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determine the filtering processing scheme based on the comparison result.
[0050] In a third aspect of the present invention, a machine-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the filtering processing method.
[0051] In a fourth aspect of the present invention, an electronic device is provided. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the filtering processing method is implemented.
[0052] The above method and system quantitatively calculate the quality of the waveform by the fluctuation degree of the original data and the fluctuation degree of the first-order derivative, thereby determining the availability of the collected original data by the waveform quality and determining the output mean. By selecting the output mean, data with better waveform quality is selected to replace the interfered data, thereby filtering out the interference. The method and system can effectively filter out the spikes generated by the signal when it is interfered, effectively improving the filtering quality of the interference signal in the EFT experiment.
[0053] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0055] Figure 1 is a flow chart of a filtering processing method provided by an embodiment of the present invention;
[0056] Figure 2 is a flow chart of another filtering processing method provided by one embodiment of the present invention;
[0057] Figure 3 is a block diagram of a filtering processing system provided by one embodiment of the present invention;
[0058] Figure 4 It is a schematic diagram of the structure of an electronic device provided by a preferred embodiment of the present invention.
[0059] Description of Reference Numerals
[0060] 10 - electronic device, 100 - processor, 101 - memory, 102 - computer program. DETAILED DESCRIPTION
[0061] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0062] Figure 1 FIG. 1 is a flow chart of a filtering method provided by an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a filtering processing method, comprising:
[0063] S110: Calculate the mean, first-order derivative and first-order derivative mean of the collected original data;
[0064] Among them, a raw data array can be defined to record the collected raw data, and the number of raw data is recorded as N. A first-order derivative array is defined to calculate the first-order derivative of the raw data. A first-order derivative mean is defined to record the average value of the first-order derivative.
[0065] In some implementations of this embodiment, the first-order derivative and the first-order derivative mean of the collected raw data are calculated, including: when there are N collected raw data, two adjacent raw data are subtracted to obtain N-1 samples. The N-1 samples are equally divided into two data sets, and the first-order derivative is calculated based on the two obtained data sets. The first-order derivatives are summed and then averaged to obtain the first-order derivative mean.
[0066] In some implementations of this embodiment, the N-1 samples are equally divided into two data sets, and the first-order derivative is calculated based on the two data sets, including: taking the first half of the N-1 samples as a data set, and taking the second half of the N-1 samples as a data set. The nth data of the second half of the N-1 samples is added to the nth data of the first half of the N-1 samples to obtain the first-order derivative, wherein if N-1 is an odd number, the (N-1) / 2th data of the N-1 samples is discarded, and 1≤n≤(N-1) / 2, and n is an integer.
[0067] Specifically, two adjacent original data are subtracted to obtain N-1 samples, and then the second half of the N-1 samples is added to the first half of the data. That is, the first data is added to the N / 2+1th data, and so on. If N-1 is an odd number, the (N-1) / 2th data does not participate in the calculation and is discarded. The length of the first-order derivative array obtained at the end should be (N-1) / 2 rounded down. For example: when N=20, 19 samples are obtained after subtraction; then the first sample is added to the 11th sample, the second sample is added to the 12th sample, and so on, the 9th sample is added to the 19th sample, and then the 10th sample is discarded. The content of the first-order derivative array obtained at the end is the added value, and the array length is 9.
[0068] S120: Determine the number of first bad pixels in the original data according to the mean value of the original data;
[0069] In some implementations of this embodiment, determining the number of first bad pixels in the original data according to the mean of the original data includes: calculating the absolute value of the first difference between each original data and the mean of the original data, determining the original data whose absolute value of the first difference is greater than the mean tolerance value as the first bad pixel, and counting the number of the first bad pixels.
[0070] Specifically, the mean tolerance value is used to determine the quality of the original data. If the difference between the original data and the mean is greater than the mean tolerance value, it is determined to be a bad pixel, namely the first bad pixel. The absolute value of the first difference corresponding to each original data is compared with the mean tolerance value to count the number of first bad pixels. The number of first bad pixels can represent the degree of fluctuation of the original data.
[0071] S130: Determine the number of second bad pixels in the first-order derivative according to the first-order derivative and the first-order derivative mean of the original data;
[0072] In some implementations of this embodiment, the above-mentioned determining the number of second bad pixels in the first-order derivative according to the first-order derivative and the first-order derivative mean of the original data includes: calculating the second absolute value of the difference between each first-order derivative and the first-order derivative mean, determining the first-order derivative whose second absolute value of the difference is greater than the first-order derivative tolerance value as the second bad pixel, and counting the number of the second bad pixels.
[0073] Specifically, the first-order derivative tolerance value is used to determine the fluctuation of the first-order derivative of the original data. If the difference between the first-order derivative and the first-order derivative mean is greater than the first-order derivative tolerance value, it is determined to be a bad pixel.
[0074] S140: judging the current waveform quality result based on the first bad pixel number and the second bad pixel number;
[0075] In some implementations of the present embodiment, the above-mentioned judging the current waveform quality result based on the first number of bad pixels and the second number of bad pixels includes: performing a first judgment based on the first number of bad pixels and the number of bad pixels allowed by the mean, and when the first number of bad pixels is less than the number of bad pixels allowed by the mean, judging that the current waveform quality result is the highest quality level; otherwise, performing a second judgment based on the second number of bad pixels and the number of bad pixels allowed by the first-order derivative.
[0076] Optionally, the second judgment based on the second number of bad pixels and the number of bad pixels allowed by the first-order derivative includes: if the second number of bad pixels is not less than the number of bad pixels allowed by the first-order derivative, determining the current waveform quality result as the lowest quality level. If the second number of bad pixels is less than the number of bad pixels allowed by the first-order derivative, determining the quality level of the current waveform based on the corresponding relationship between the difference between the two numbers and a preset quality determination table, wherein the preset quality determination table stores the corresponding relationship between the difference between the second number of bad pixels and the number of bad pixels allowed by the first-order derivative and the waveform quality level.
[0077] Specifically, the criteria for determining the current waveform quality result are: if the number of the first bad points is less than the number of bad points allowed by the mean, the current waveform quality result is determined to be "good"; if the waveform quality is not "good", that is, the number of the first bad points is not less than the number of bad points allowed by the mean, and the number of the second bad points is determined to be less than the number of bad points allowed by the first-order derivative, the current waveform quality result is determined to be "medium"; in other cases, the waveform quality is determined to be "poor". Among them, 0 can be used to represent the waveform quality of "good", 1 can be used to represent the waveform quality of "medium", and 2 can be used to represent the waveform quality of "poor".
[0078] S150: Compare the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determine a filtering processing scheme based on the comparison result.
[0079] In some implementations of this embodiment, the filtering processing scheme includes outputting filtering failure information or outputting filtering non-failure information. Determining the filtering processing scheme based on the comparison result includes: if it is determined that the filter fails, then outputting filtering failure information. If it is determined that the filter does not fail, then outputting filtering non-failure information.
[0080] In some implementations of this embodiment, the filtering processing scheme includes outputting a mean value. Comparing the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determining the filtering processing scheme based on the comparison result, including: if the current waveform quality result is worse than the waveform quality result at the previous moment, then the output mean value is the mean value at the previous moment, otherwise the output mean value is the current mean value. Thus, by selecting the output mean value, data with better waveform quality is selected. The effect of replacing the interfered data by selecting data with better waveform quality is achieved, thereby filtering out the interference.
[0081] In the above implementation process, the method quantitatively calculates the quality of the waveform by the fluctuation degree of the original data and the fluctuation degree of the first-order derivative, thereby determining the availability of the collected original data by the waveform quality and determining the output mean. By selecting the output mean, data with better waveform quality is selected to replace the interfered data, thereby filtering out the interference. This method can effectively filter out the spikes generated by the signal when it is interfered, and effectively improve the filtering quality of the interference signal in the EFT experiment.
[0082] Please refer to Figure 2 , Figure 2This is a flowchart of another filtering processing method provided by an embodiment of the present invention. The method first sums and averages N samples of the original data, and calculates the first-order derivative and the first-order derivative mean. Then, the number of original data deviations from the mean exceeding the tolerance value is counted. If the number is less than the number of bad points allowed by the mean, the current waveform quality is "good", and the number of original data deviations from the mean exceeding 90% of the tolerance value is counted. If the number is less than the number of bad points allowed by the mean, the mean tolerance value is reduced by 10%. When the difference between the current mean and the mean of the previous moment is less than the stable value, the current mean = the mean of the previous moment. If the difference between the current mean and the mean of the previous moment is not less than the stable value, it is determined whether the current waveform quality ≤ the waveform quality of the previous moment (where the current waveform quality is "good" is 0, the current waveform quality is "medium" is 1, and the current waveform quality is "poor" is 2). If it is satisfied, the output mean = the current mean, otherwise the output mean = the mean of the previous moment, and then the current mean and waveform quality are copied to the previous moment for storage, and finally the output mean and the filter failure flag are returned. If the number of original data deviating from the mean by more than the tolerance value is not less than the number of bad points allowed by the mean, the number of first-order derivatives deviating from the first-order derivative mean by more than the tolerance value is counted. If the number is less than the number of bad points allowed by the first-order derivative, the current waveform quality = "medium", and the size comparison process of the difference between the current mean and the mean of the previous moment and the stable value is entered. If the number is not less than the number of bad points allowed by the first-order derivative, the current waveform quality = "bad", record the current waveform quality to M waveform quality samples, remove the oldest one, if M consecutive waveforms have poor quality, the mean tolerance value will increase by 10%, when the mean tolerance value has increased to 2 times the mean tolerance value set by the user and for M consecutive times, the output filter fails. If there are not M consecutive waveforms with poor quality, directly perform the process of comparing the difference between the current mean and the mean at the previous moment and the size of the stable value.
[0083] In some implementations of this embodiment, the filtering processing method further includes:
[0084] When the current waveform quality result is determined to be the highest quality level, if the number of original data whose absolute value of the first difference is greater than the tolerance ratio of the mean tolerance value is less than the number of bad pixels allowed by the mean, the mean tolerance value is reduced by a first preset ratio;
[0085] The tolerance ratio may be 90%, and the first preset ratio may be 10%.
[0086] When it is determined that the current waveform quality result is of the lowest quality level, the current waveform quality result is recorded into a preset number of waveform quality samples, and the oldest waveform quality result among the waveform quality samples is removed;
[0087] When the waveform quality results recorded by the latest preset number of waveform quality samples are all at the lowest quality level, the mean tolerance value is increased by a second preset proportion.
[0088] The second preset ratio may be 10%.
[0089] Specifically, when the current waveform quality result is determined to be good, the waveform quality needs to be re-determined using the mean tolerance value of 90%. If the waveform quality determined using the current mean tolerance value of 90% is "good", that is, the number of original data whose absolute value of the first difference is greater than the mean tolerance value of 90% is less than the number of bad pixels allowed by the mean, and the mean tolerance value is not equal to the mean tolerance value set by the user, then the mean tolerance value is reduced by 10%. When the current waveform quality result is determined to be poor, the latest M waveform qualities are stored in a loop. If the latest M waveform qualities are all "poor", the mean tolerance value used for the next determination is increased by 10%. Then, the threshold is adapted through the continuous deterioration of the waveform quality, and the failure of the filter caused by continuous interference is prevented, thereby achieving adaptive adjustment of the mean tolerance value. Thus, by adjusting the mean tolerance value upward or downward, the waveform quality determination error caused by the mean tolerance value not changing is avoided.
[0090] In some implementations of this embodiment, the method limits the mean tolerance value after floating up or down, wherein the mean tolerance value is not less than the mean tolerance value set by the user when it is floating down, and is not more than twice the mean tolerance value set by the user when it is floating up.
[0091] In some implementations of this embodiment, when the waveform quality results of the latest preset number of waveform quality sample records are all at the lowest quality level, after the mean tolerance value is increased by a second preset ratio, the method further includes:
[0092] When the mean tolerance value rises to a preset multiple of the initial mean tolerance value and the waveform quality results recorded by the latest preset number of waveform quality samples are still at the lowest quality level, the filter is determined to be invalid; otherwise, the filter is determined to be valid.
[0093] Among them, the preset multiple can be twice.
[0094] Specifically, a sign indicating that the filter has failed or not failed will be output together with the output mean value, so that the user can be reminded through the sign indicating that the filter has failed or not failed, so that an alarm can be output for continuous filter failure.
[0095] In some implementations of this embodiment, before comparing the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, the method further includes:
[0096] If the difference between the current mean and the previous mean is less than the preset stability value, the current mean copies the previous mean.
[0097] Specifically, the preset stability value is used to stabilize small changes in the signal. If the difference between the mean value at the previous time and the current mean value is less than the preset stability value, the current mean value copies the mean value at the previous time.
[0098] Exemplarily, the above-mentioned preset stability value can be the signal resolution, the mean tolerance value is 2 times or 4 times the signal resolution, the first-order derivative tolerance value is equal to the mean tolerance value, the number of bad pixels allowed for the mean is set to N / 5, and the number of bad pixels allowed for the first-order derivative is N / 10, where N is the number of original data.
[0099] Figure 3 FIG. 1 is a block diagram of a filtering processing system provided by an embodiment of the present invention. Figure 3 As shown, an embodiment of the present invention provides a filtering processing system, comprising:
[0100] A mean calculation module, used to calculate the mean, first-order derivative and first-order derivative mean of the collected original data;
[0101] A first bad pixel quantity determination module, used to determine the first bad pixel quantity in the original data according to the mean value of the original data;
[0102] A second bad pixel quantity determination module, used to determine the second bad pixel quantity in the first-order derivative according to the first-order derivative and the first-order derivative mean of the original data;
[0103] A waveform quality judgment module, used for judging the current waveform quality result based on the first bad pixel number and the second bad pixel number;
[0104] The filtering processing scheme determination module is used to compare the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determine the filtering processing scheme based on the comparison result.
[0105] In the above implementation process, the system quantitatively calculates the quality of the waveform through the fluctuation degree of the original data and the fluctuation degree of the first-order derivative, thereby determining the availability of the collected original data through the waveform quality and determining the output mean. By selecting the output mean, data with better waveform quality is selected to replace the interfered data, thereby filtering out the interference. The system can effectively filter out the spikes generated by the signal when it is interfered, effectively improving the filtering quality of the interference signal in the EFT experiment.
[0106] The embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by the processor 100, the processor 100 is configured to execute the above-mentioned filtering processing method.
[0107] Machine-readable storage media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0108] The embodiment of the present invention further provides an electronic device 10, which includes a memory 101, a processor 100, and a computer program 102 stored in the memory 101 and executable on the processor 100. When the processor 100 executes the computer program 102, the above-mentioned filtering processing method is implemented.
[0109] like Figure 4 FIG. 1 is a schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device 10 of this embodiment includes: a processor 100, a memory 101, and a computer program 102 stored in the memory 101 and executable on the processor 100. When the processor 100 executes the computer program 102, the steps in the above method embodiment are implemented. Alternatively, when the processor 100 executes the computer program 102, the functions of each module / unit in the above device embodiment are implemented.
[0110] Exemplarily, the computer program 102 may be divided into one or more modules / units, one or more modules / units are stored in the memory 101, and are executed by the processor 100 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 102 in the terminal device 10. For example, the computer program 102 may be divided into a mean value calculation module, a first bad pixel number determination module, a second bad pixel number determination module, a waveform quality judgment module, and an output mean value determination module.
[0111] The electronic device 10 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 10 may include, but is not limited to, a processor 100 and a memory 101. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 10 and does not constitute a limitation of the electronic device 10. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0112] The processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0113] The memory 101 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10. The memory 101 may also be an external storage device of the electronic device 10, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 10. Further, the memory 101 may also include both an internal storage unit of the electronic device 10 and an external storage device. The memory 101 is used to store computer programs and other programs and data required by the electronic device 10. The memory 101 may also be used to temporarily store data that has been output or is to be output.
[0114] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0115] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program 102 products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program 102 product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program 102 products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by the computer program 102 instructions. These computer program 102 instructions can be provided to a processor 100 of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor 100 of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0117] These computer program 102 instructions may also be stored in a computer readable memory 101 that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory 101 produce an article of manufacture including an instruction device that implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0118] These computer program 102 instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0119] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0120] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A filtering processing method, characterized in that: include: Calculate the mean, first-order derivative and first-order derivative mean of the collected raw data; Determine the number of first bad pixels in the original data according to the mean value of the original data; Determining the number of second bad points in the first-order derivative according to the first-order derivative and the mean of the first-order derivative of the original data; Based on the first number of bad pixels and the second number of bad pixels, determining a current waveform quality result; The current waveform quality result and the waveform quality result at the previous moment are compared to obtain a comparison result, and a filtering processing scheme is determined based on the comparison result.
2. The filtering processing method according to claim 1, characterized in that: The determining, according to the mean value of the original data, the number of first bad pixels in the original data comprises: Calculate the first absolute value of the difference between each original data and the mean of the original data; The original data whose absolute value of the first difference is greater than the mean tolerance value is determined as a first bad pixel, and the number of the first bad pixels is counted.
3. The filtering processing method according to claim 2, characterized in that: The determining of the current waveform quality result based on the first number of bad pixels and the second number of bad pixels includes: The first judgment is performed based on the first number of bad pixels and the number of bad pixels allowed by the mean. When the first number of bad pixels is less than the number of bad pixels allowed by the mean, the current waveform quality result is determined to be the highest quality level. Otherwise, the second judgment is performed based on the second number of bad pixels and the number of bad pixels allowed by the first-order derivative.
4. The filtering processing method according to claim 3, characterized in that: The performing a second determination based on the second number of bad pixels and the number of bad pixels allowed by the first-order derivative comprises: If the second number of bad pixels is not less than the number of bad pixels allowed by the first-order derivative, determining that the current waveform quality result is the lowest quality level; If the second number of bad pixels is less than the number of bad pixels allowed by the first-order derivative, the quality level of the current waveform is determined based on the correspondence between the quantitative difference between the two and a preset quality determination table, wherein the preset quality determination table stores the correspondence between the quantitative difference between the second number of bad pixels and the number of bad pixels allowed by the first-order derivative and the waveform quality level.
5. The filtering method according to claim 4, characterized in that: Also includes: When the current waveform quality result is determined to be the highest quality level, if the number of original data whose absolute value of the first difference is greater than the tolerance ratio of the mean tolerance value is less than the number of bad pixels allowed by the mean, the mean tolerance value is reduced by a first preset ratio; When it is determined that the current waveform quality result is of the lowest quality level, the current waveform quality result is recorded into a preset number of waveform quality samples, and the oldest waveform quality result among the waveform quality samples is removed; When the waveform quality results recorded by the latest preset number of waveform quality samples are all at the lowest quality level, the mean tolerance value is increased by a second preset proportion.
6. The filtering method according to claim 5, characterized in that: When the waveform quality results of the latest preset number of waveform quality samples are all at the lowest quality level, the mean tolerance value is increased by a second preset ratio, and the method further includes: When the mean tolerance value rises to a preset multiple of the initial mean tolerance value and the waveform quality results recorded by the latest preset number of waveform quality samples are still at the lowest quality level, the filter is determined to be invalid; otherwise, the filter is determined to be valid.
7. The filtering processing method according to claim 6, characterized in that: The filtering processing scheme includes outputting filtering failure information or outputting filtering non-failure information; The determining of a filtering processing scheme based on the comparison result includes: If the filter is judged to be failed, the filter failure information is output; If it is determined that the filter has not failed, the information that the filter has not failed is output.
8. The filtering processing method according to claim 1, characterized in that: The first-order derivative and the first-order derivative mean of the raw data collected by the calculation include: When there are N collected raw data, the difference between two adjacent raw data is calculated to obtain N-1 samples; Divide N-1 samples equally into two data sets, and calculate the first-order derivative based on the two data sets obtained; The first-order derivatives are summed and then averaged to obtain the mean of the first-order derivatives.
9. The filtering processing method according to claim 8, characterized in that: The step of dividing the N-1 samples equally into two data sets, and calculating the first-order derivative based on the two data sets, includes: Take the first half of the N-1 samples as a data set, and take the second half of the N-1 samples as a data set; The nth data in the second half of the N-1 samples is added to the nth data in the first half of the N-1 samples to obtain a first-order derivative, wherein if N-1 is an odd number, the (N-1) / 2th data in the N-1 samples is discarded, and 1≤n≤(N-1) / 2, where n is an integer.
10. The filtering processing method according to claim 1, characterized in that: Determining the number of second bad pixels in the first-order derivative according to the first-order derivative and the first-order derivative mean of the original data includes: Calculate the absolute value of the second difference between each first-order derivative and the mean of the first-order derivatives; The first-order derivative whose absolute value of the second difference is greater than the first-order derivative tolerance value is determined as a second bad pixel, and the number of the second bad pixels is counted.
11. The filtering processing method according to claim 1, characterized in that: The filtering processing scheme includes outputting a mean value; The comparing the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determining a filtering processing scheme based on the comparison result, comprises: If the current waveform quality result is worse than the waveform quality result at the previous moment, the output mean is the mean at the previous moment, otherwise the output mean is the current mean.
12. The filtering method according to claim 1, characterized in that: Before comparing the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, the method further includes: If the difference between the current mean and the previous mean is less than the preset stability value, the current mean copies the previous mean.
13. A filtering processing system, characterized in that: include: A mean calculation module, used to calculate the mean, first-order derivative and first-order derivative mean of the collected original data; A first bad pixel quantity determination module, used to determine the first bad pixel quantity in the original data according to the mean value of the original data; A second bad pixel quantity determination module, used to determine the second bad pixel quantity in the first-order derivative according to the first-order derivative and the first-order derivative mean of the original data; A waveform quality judgment module, used for judging the current waveform quality result based on the first bad pixel number and the second bad pixel number; The filtering processing scheme determination module is used to compare the current waveform quality result with the waveform quality result at the previous moment to obtain a comparison result, and determine the filtering processing scheme based on the comparison result.
14. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to perform the filtering processing method according to any one of claims 1 to 12.
15. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the filtering processing method according to any one of claims 1 to 12 is implemented.