Sliding average filtering method, device, apparatus, and computer-readable storage medium
By performing amplitude-limiting or amplitude-raising processing on the original analog signal and combining preset threshold judgment, the trade-off between the response speed of the sliding average filter and the noise performance is solved, and efficient signal filtering and noise suppression are achieved.
Patent Information
- Application Number
- CN202111446196.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-11-30
AI Technical Summary
While the existing sliding average filters improve the response speed, it is difficult to effectively improve the noise blocking performance.
By sampling the original analog signal based on the preset sampling interval, if the amplitude is abnormal, the amplitude limiting or amplitude increase processing is performed, and stored in the memory unit. After calculating the ratio, the effective signal is output, and combined with the preset threshold judgment, the signal is efficiently filtered.
It improves the response speed and noise blocking performance of the filter, reduces the computational complexity, adapts to filtering processing of different data characteristics, and improves the adaptability and robustness of the filter.
Smart Images

Figure CN114124036B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of signal noise filtering technology, and in particular to a sliding average filtering method, device, equipment and computer-readable storage medium. Background Art
[0002] Noise is generally generated by the random thermal vibrations of particles, primarily due to repeated radiation from remotely transmitted signals and the introduction of external electrical signals. This type of noise can reduce the level of the original signal by reducing irregular variations in the signal. However, if external noise is randomly embedded within the original signal, it is difficult to separate from it. This type of noise requires the use of specialized circuits or algorithms to address it.
[0003] Noise filters are commonly used to block noise. As a noise filter, a sliding average filter exhibits a trade-off between response speed and noise blocking performance. Specifically, a sliding average filter's higher response speed results in lower noise blocking performance. Therefore, to improve noise blocking performance, the response speed needs to be reduced.
[0004] Therefore, how to improve the filter's response speed while enhancing its noise blocking performance has become a research focus for those skilled in the art. Summary of the Invention
[0005] The main purpose of the present invention is to provide a sliding average filtering method, device, equipment and computer-readable storage medium, aiming to improve the filter response speed while enhancing the filter's noise blocking performance.
[0006] To achieve the above object, the present invention provides a sliding average filtering method, comprising the following steps:
[0007] Sampling the original analog signal based on a preset sampling interval to obtain an original sampling signal;
[0008] If the amplitude of the original sampling signal is greater than the first preset amplitude threshold, the original sampling signal is subjected to amplitude limiting processing to obtain an amplitude limiting sampling signal, and the amplitude limiting sampling signal is stored in a preset storage unit;
[0009] If all the original analog signals are sampled, the ratio of the limited sampling signals in the preset storage unit is calculated;
[0010] If the ratio of the amplitude-limited sampling signal is greater than a preset ratio threshold, the amplitude-limited sampling signal is output as an output signal.
[0011] Optionally, after the step of sampling the original analog signal based on a preset sampling interval to obtain the original sampled signal, the method further includes:
[0012] If the amplitude of the original sampling signal is less than or equal to the first preset amplitude threshold, the original sampling signal is directly stored in a preset storage unit.
[0013] Optionally, after the step of calculating the ratio of the amplitude-limited sampling signal in the original analog signal, the method further includes:
[0014] If the ratio of the limited sampling signal is less than or equal to the preset ratio threshold, the sampling signal in the preset storage unit is subjected to sliding average filtering to obtain a filtered analog signal, and the filtered analog signal is output as an output signal, wherein the sampling signal includes the limited sampling signal and the original sampling signal.
[0015] Optionally, the step of performing amplitude limiting processing on the original sampled signal to obtain the amplitude limited sampled signal includes:
[0016] The amplitude of the original sampling signal is set as the first preset amplitude threshold to obtain a limited amplitude sampling signal.
[0017] Optionally, the step of performing amplitude limiting processing on the original sampled signal to obtain the amplitude limited sampled signal includes:
[0018] Based on the first preset amplitude threshold, low-pass filtering is performed on the original sampling signal to obtain a limited amplitude sampling signal.
[0019] Optionally, if the amplitude of the original sampled signal is less than or equal to the first preset amplitude threshold, the step of directly storing the original sampled signal in a preset storage unit includes:
[0020] If the amplitude of the original sampled signal is less than or equal to the first preset amplitude threshold, detecting whether the amplitude of the original sampled signal is less than the second preset amplitude threshold, wherein the second preset amplitude threshold is less than the first preset amplitude threshold;
[0021] If the amplitude is less than the second preset amplitude threshold, the original sampling signal is subjected to amplitude-up processing to obtain an amplitude-up sampling signal, and the signal is stored in a preset storage unit;
[0022] If the amplitude is greater than or equal to the second preset amplitude threshold, the original sampling signal is directly stored in a preset storage unit.
[0023] Optionally, after the step of performing amplitude-up processing on the original sampled signal to obtain an amplitude-up sampled signal and storing the signal in a preset storage unit, the method further comprises:
[0024] If all the original analog signals are sampled, the ratio of the increased amplitude sampling signals in the preset storage unit is calculated;
[0025] If the ratio of the increased amplitude sampling signal is greater than a preset ratio threshold, the limited amplitude sampling signal is output as an output signal.
[0026] In addition, to achieve the above-mentioned object, the present invention further provides a sliding average filtering device, comprising:
[0027] The sampling module is used to sample the original analog signal based on a preset sampling interval to obtain an original sampling signal;
[0028] an amplitude modulation module, configured to, if the amplitude of the original sampling signal is greater than the first preset amplitude threshold, perform amplitude limiting processing on the original sampling signal to obtain an amplitude limited sampling signal, and store the obtained signal in a preset storage unit;
[0029] a calculation module, configured to calculate the ratio of the limited sampling signal in the preset storage unit if all sampling of the original analog signal is completed;
[0030] The output module is configured to output the limited sampling signal as an output signal if the ratio of the limited sampling signal is greater than a preset ratio threshold.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a sliding average filtering device, which includes a memory, a processor, and a sliding average filtering program stored in the memory and runnable on the processor. When the sliding average filtering program is executed by the processor, the steps of the sliding average filtering method as described above are implemented.
[0032] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a sliding average filter program is stored. When the sliding average filter program is executed by a processor, the steps of the sliding average filter method as described above are implemented.
[0033] The present invention samples the original analog signal based on a preset sampling interval to obtain an original sampling signal. If the amplitude of the original sampling signal is greater than the first preset amplitude threshold, the original sampling signal is limited to obtain a limited sampling signal, and the signal is stored in a preset storage unit. This method limits the amplitude of the original sampling signal when an abnormality is detected in the amplitude of the original sampling signal, thereby improving the processing speed of the sliding average filter, thereby reducing the amplitude of invalid signals in the original sampling signal, and achieving signal noise reduction processing for the original sampling signal. The noise filtering algorithm is simple and efficient, thereby improving the noise blocking performance of the filter while improving the response speed of the filter. It should be noted that when the ratio of the limited sampling signal is greater than the preset ratio threshold, it means that the valid signal in the original analog signal is the limited sampling signal, because the component of the valid signal in the original analog signal is much greater than the component of the invalid signal (or called the noise signal). Based on this principle, the present invention calculates the ratio of the limited sampling signal in the preset storage unit if the original analog signal is fully sampled; if the ratio of the limited sampling signal is greater than the preset ratio threshold, the limited sampling signal is output as the output signal, thereby realizing the accurate and efficient extraction of the valid signal from the original analog signal, with low computational complexity, effectively improving the filtering speed of the filter, and at the same time improving the noise blocking performance of the filter. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Schematic diagram of the terminal / device structure of the hardware operating environment involved in the embodiment of the present invention;
[0035] Figure 2 Schematic diagram of the flow chart of the first embodiment of the sliding average filtering method of the present invention;
[0036] Figure 3 Schematic diagram of data comparison before and after filtering of millimeter wave radar detection data in one embodiment of the present invention;
[0037] Figure 4 2. A schematic diagram showing comparison of millimeter-wave radar detection data before and after filtering in another embodiment of the present invention;
[0038] Figure 5 This is a flow chart of a specific embodiment of the sliding average filtering method of the present invention;
[0039] Figure 6 Schematic diagram of the device module of the sliding average filter device of the present invention.
[0040] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0042] like Figure 1 As shown, Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.
[0043] The terminal in the embodiment of the present invention is a sliding average filter device.
[0044] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0045] Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, the sensors include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and / or backlight when the terminal device is moved to the ear. Of course, the terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0046] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0047] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a sliding average filter program.
[0048] exist Figure 1In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the sliding average filter program stored in the memory 1005 and perform the following operations:
[0049] Sampling the original analog signal based on a preset sampling interval to obtain an original sampling signal;
[0050] If the amplitude of the original sampling signal is greater than the first preset amplitude threshold, the original sampling signal is subjected to amplitude limiting processing to obtain an amplitude limiting sampling signal, and the amplitude limiting sampling signal is stored in a preset storage unit;
[0051] If all the original analog signals are sampled, the ratio of the limited sampling signals in the preset storage unit is calculated;
[0052] If the ratio of the amplitude-limited sampling signal is greater than a preset ratio threshold, the amplitude-limited sampling signal is output as an output signal.
[0053] Reference Figure 2 The present invention provides a sliding average filtering method. In a first embodiment of the sliding average filtering method, the sliding average filtering method includes the following steps:
[0054] Step S100, sampling the original analog signal based on a preset sampling interval to obtain an original sampled signal;
[0055] The preset sampling interval can be set by those skilled in the art according to actual conditions and is not specifically limited in this embodiment. In one embodiment, the preset sampling interval is equal to 10 μs.
[0056] Step S200: If the amplitude of the original sampled signal is greater than the first preset amplitude threshold, the original sampled signal is subjected to amplitude limiting processing to obtain an amplitude limiting sampled signal, and the amplitude limiting sampled signal is stored in a preset storage unit;
[0057] It should be noted that an analog signal with a data characteristic often has a maximum amplitude. When the maximum amplitude is exceeded, it indicates that the analog signal is abnormal. Analog signals with different data characteristics often have different maximum amplitudes. In this embodiment, the first preset amplitude threshold can be set by those skilled in the art based on actual conditions to better monitor whether the amplitude of the original sampled signal is abnormal. This embodiment does not impose any specific limitation.
[0058] In one practicable manner, the step of performing a limiting process on the original sampled signal to obtain a limited sampled signal includes:
[0059] Step A10: setting the amplitude of the original sampling signal to the first preset amplitude threshold to obtain a limited amplitude sampling signal.
[0060] When the amplitude of the original sampled signal is greater than the first preset amplitude threshold, it indicates that there is an abnormality in the amplitude of the original sampled signal. Therefore, this embodiment sets the amplitude of the original sampled signal to the first preset amplitude threshold to effectively limit the maximum amplitude of the original sampled signal, thereby improving the processing speed of the filter, thereby minimizing the amplitude of the invalid signal in the original sampled signal, and achieving signal noise reduction processing of the original sampled signal. The noise filtering algorithm is simple and efficient, thereby achieving the goal of improving the noise blocking performance of the filter while improving the response speed of the filter.
[0061] In another practicable manner, the step of performing a limiting process on the original sampled signal to obtain a limited sampled signal includes:
[0062] Step B10: Based on the first preset amplitude threshold, perform low-pass filtering on the original sampling signal to obtain a limited amplitude sampling signal.
[0063] In one practicable manner, the low-pass filtering algorithm includes:
[0064] Y(n)=αX(n)+(1-α)Y(n-1) α∈[0,1)
[0065] Wherein, Y(n) is the limited sampling signal, α is the filter coefficient, X(n) is the amplitude of the original sampling signal, and Y(n-1) is the first preset amplitude threshold.
[0066] In this embodiment, the filter coefficient α can be set by those skilled in the art according to actual needs.
[0067] When the amplitude of the original sampling signal is greater than the first preset amplitude threshold, it indicates that there is an abnormality in the amplitude of the original sampling signal. Therefore, this embodiment performs low-pass filtering on the original sampling signal to obtain a limited sampling signal, thereby adaptively limiting the amplitude of the original sampling signal and improving the processing speed of the sliding average filter. This can adaptively reduce the amplitude of the invalid signal in the original sampling signal, thereby achieving signal noise reduction processing for the original sampling signal. The noise filtering algorithm is simple and efficient, thereby improving the noise blocking performance of the filter while improving the response speed of the filter.
[0068] Specifically, after the step of sampling the original analog signal based on the preset sampling interval to obtain the original sampled signal, the method further includes:
[0069] Step C10: If the amplitude of the original sampling signal is less than or equal to the first preset amplitude threshold, directly storing the original sampling signal in a preset storage unit.
[0070] The preset storage unit refers to a storage unit pre-set by those skilled in the art to store data.
[0071] In this embodiment, it is understood that if the amplitude of the raw sampled signal is less than or equal to the first preset amplitude threshold, it indicates that the amplitude of the raw sampled signal is normal, and thus the raw sampled signal is directly stored in the preset storage unit. This embodiment improves the noise blocking performance of the filter by directly storing the raw sampled signal in the preset storage unit only when the amplitude of the raw sampled signal is detected to be normal.
[0072] Step S300, if all the original analog signals are sampled, then calculating the ratio of the limited sampling signals in the preset storage unit;
[0073] Step S400: If the ratio of the limited sampling signal is greater than a preset ratio threshold, the limited sampling signal is output as an output signal.
[0074] The preset ratio threshold value can be set by those skilled in the art according to actual conditions so as to better detect the valid signal in the original analog signal, and is not specifically limited in this embodiment.
[0075] This embodiment samples the original analog signal based on a preset sampling interval to obtain an original sampling signal. If the amplitude of the original sampling signal is greater than the first preset amplitude threshold, the original sampling signal is amplitude-limited to obtain a limited sampling signal, and the signal is stored in a preset storage unit. This embodiment limits the amplitude of the original sampling signal when an abnormality is detected in the amplitude of the original sampling signal, thereby improving the processing speed of the sliding average filter, thereby reducing the amplitude of invalid signals in the original sampling signal and achieving signal noise reduction processing on the original sampling signal. The noise filtering algorithm is simple and efficient, thereby improving the noise blocking performance of the filter while improving the response speed of the filter. It should be noted that when the ratio of the limited sampling signal is greater than the preset ratio threshold, it means that the valid signal in the original analog signal is the limited sampling signal, because the component of the valid signal in the original analog signal is much greater than the component of the invalid signal (or called the noise signal). Based on this principle, this embodiment calculates the ratio of the limited sampling signal in the preset storage unit if all the original analog signals are sampled; if the ratio of the limited sampling signal is greater than the preset ratio threshold, the limited sampling signal is output as the output signal, thereby realizing the accurate and efficient extraction of the valid signal from the original analog signal, with low computational complexity, effectively improving the filtering speed of the filter, and at the same time improving the noise blocking performance of the filter.
[0076] In one possible implementation, after the step of calculating the ratio of the amplitude-limited sampling signal in the original analog signal, the method further includes:
[0077] Step D10: If the ratio of the limited sampling signal is less than or equal to the preset ratio threshold, the sampling signal in the preset storage unit is subjected to sliding average filtering to obtain a filtered analog signal, and the filtered analog signal is output as an output signal, wherein the sampling signal includes the limited sampling signal and the original sampling signal.
[0078] When the ratio of the clipped sampled signal is less than or equal to a preset ratio threshold, it indicates that a valid signal cannot be directly extracted from the original analog signal. Therefore, this embodiment performs a sliding average filter on the sampled signal in the preset storage unit when the ratio of the clipped sampled signal is less than or equal to the preset ratio threshold to obtain a filtered analog signal, which is then output as an output signal. Thus, the sampled signal is input to the sliding average filter for filtering only when a valid signal cannot be identified from the original analog signal. This effectively improves the filter's filtering speed and reduces its response time when the ratio of the clipped sampled signal is greater than the preset ratio threshold, while also reliably ensuring noise filtering performance. Furthermore, even when the ratio of the clipped sampled signal is less than or equal to the preset ratio threshold, the sampled signal in the preset storage unit needs to be input to the sliding average filter for filtering. However, because the amplitude of the invalid signal in the original sampled signal is reduced by pre-limiting the amplitude of the sampled signal, the noise filtering dependency on the sliding average filter is reduced, thereby improving the response speed of the sliding average filter and enhancing noise filtering performance.
[0079] In this embodiment, taking the signal returned by the millimeter wave radar as an example, please refer to Figure 3 and Figure 4 Here, distance_1 is the distance information transmitted by the millimeter-wave radar, and test_1 is the distance information after filtering. It can be seen that the original analog signal of the millimeter-wave radar has large fluctuations and a small duty cycle of the useful signal. However, after noise filtering using the sliding average filtering method of this embodiment, the useful signal can be effectively extracted with minimal delay.
[0080] It should be noted that this embodiment incorporates a manually set first preset amplitude threshold on the basis of the sliding average filter. Given the large amplitude of the original numerical value, this effectively limits the amplitude of invalid signals, improving the processing speed of the sliding average filter. Furthermore, the manually set preset ratio threshold allows for pre-identification of valid signals within the original analog signal, thereby reducing noise filtering response time and improving filtering speed. Furthermore, this embodiment can dynamically adjust the first preset amplitude threshold and the preset ratio threshold to perform targeted filtering on original analog signals with different data characteristics, thereby improving the adaptability and robustness of the sliding average filtering method of this embodiment of the present invention.
[0081] Furthermore, based on the first embodiment of the present invention, a second embodiment of the sliding average filtering method of the present invention is proposed. In this embodiment, if the amplitude of the original sampled signal is less than or equal to the first preset amplitude threshold, the step of directly storing the original sampled signal in a preset storage unit includes:
[0082] Step E10: If the amplitude of the original sampled signal is less than or equal to the first preset amplitude threshold, detecting whether the amplitude of the original sampled signal is less than the second preset amplitude threshold, wherein the second preset amplitude threshold is less than the first preset amplitude threshold;
[0083] It should be noted that the amplitude of an analog signal with a data characteristic often has a minimum amplitude. When the amplitude corresponding to that data characteristic is lower than the minimum amplitude, it indicates that the analog signal is abnormal. Analog signals with different data characteristics often have different minimum amplitudes. In this embodiment, those skilled in the art may set the second preset amplitude threshold based on actual conditions to better detect whether the amplitude of the original sampled signal is abnormal. This embodiment does not impose any specific limitation.
[0084] Step E20: If the amplitude is less than the second preset amplitude threshold, the original sampling signal is subjected to amplitude-up processing to obtain an amplitude-up sampling signal, and the signal is stored in a preset storage unit;
[0085] Step E30: If the amplitude is greater than or equal to the second preset amplitude threshold, directly store the original sampling signal in a preset storage unit.
[0086] This embodiment indicates that there is an abnormality in the amplitude of the original sampling signal when the amplitude of the original sampling signal is less than the second preset amplitude threshold. Therefore, by performing the step of increasing the amplitude of the original sampling signal, the minimum amplitude of the original sampling signal is effectively limited, and the processing speed of the sliding average filter is improved, thereby maximizing the amplitude of the valid signal in the original sampling signal, increasing the component of the valid signal in the original analog signal, and reducing the influence of the invalid signal in the original analog signal, thereby achieving restoration of the original analog signal to a certain extent, reducing the dependence on noise filtering of the sliding average filter, and thus improving the response speed of the sliding average filter, while also improving the noise blocking performance.
[0087] Based on the second embodiment of the present invention, a third embodiment of the sliding average filtering method of the present invention is proposed. In this embodiment, after the step of performing amplitude-up processing on the original sampled signal to obtain the amplitude-up sampled signal and storing it in a preset storage unit, the method further includes:
[0088] Step F10, if all the original analog signals have been sampled, then calculating the ratio of the increased amplitude sampling signals in the preset storage unit;
[0089] Step F20 : If the ratio of the increased amplitude sampling signal is greater than a preset ratio threshold, the limited amplitude sampling signal is output as an output signal.
[0090] The preset ratio threshold value can be set by those skilled in the art according to actual conditions so as to better detect the valid signal in the original analog signal, and is not specifically limited in this embodiment.
[0091] It should be noted that when the ratio of the increased sampling signal is greater than the preset ratio threshold, it means that the valid signal in the original analog signal is the increased sampling signal, because the component of the valid signal in the original analog signal is much greater than the component of the invalid signal (or called the noise signal). Based on this principle, this embodiment achieves accurate and efficient extraction of the valid signal from the original analog signal by outputting the limited sampling signal as the output signal if the ratio of the increased sampling signal is greater than the preset ratio threshold. The computational complexity is low, the filtering speed of the filter is effectively improved, and the noise blocking performance is also improved.
[0092] To help understand this application, a specific embodiment is listed, please refer to Figure 5 , the sliding average filtering method in this specific embodiment is:
[0093] (a) First, determine whether the collected analog value is greater than the threshold thd1, where threshold thd1 is the maximum amplitude of a useful signal set based on experience. If the collected analog value is greater than threshold thd1, the measured value is set to threshold thd1; otherwise, the measured value is set to the value of the currently collected analog value. This step can minimize the amplitude of invalid signals and improve the response speed of the sliding average filter;
[0094] (b) then storing the measured value in a storage unit;
[0095] (c) Next, a determination is made as to whether the number of threshold values thd1 in the storage cell is greater than threshold value thd2. Threshold value thd2 is typically a percentage of the maximum capacity of the storage cell. For example, if the maximum capacity of the storage cell is 100, threshold value thd2 can be 80% of the maximum capacity, i.e., 80. If the number of threshold values thd1 in the storage cell is greater than threshold value thd2, no filtering is performed and threshold value thd1 is directly output. Otherwise, a sliding average filter is performed within the storage cell. This step effectively extracts the useful signal even when the useful signal duty cycle is small.
[0096] In this specific embodiment, a manually set threshold is added to the sliding average filter. Given the large amplitude of the original numerical values, this effectively limits the maximum amplitude of the useless signal, improving the processing speed of the sliding average filter. Furthermore, by dynamically adjusting the threshold thd1 and the quantity threshold thd2, targeted filtering processing can be performed on raw data with different data characteristics. It should be noted that this specific embodiment can also dynamically adjust the ratio of the useful signal's duty cycle using the manually set quantity threshold thd2, adaptively extracting the useful signal based on the useful signal's duty cycle.
[0097] It should be noted that this specific embodiment is only helpful for understanding the present application and does not constitute a limitation of the present application. Technical solutions obtained by performing more simple transformations based on this embodiment are all within the scope of protection of the present application.
[0098] In addition, refer to Figure 6 , an embodiment of the present invention further provides a sliding average filtering device, the sliding average filtering device comprising:
[0099] The sampling module S1 is used to sample the original analog signal based on a preset sampling interval to obtain an original sampling signal;
[0100] an amplitude modulation module S2, configured to, if the amplitude of the original sampled signal is greater than the first preset amplitude threshold, perform amplitude limiting processing on the original sampled signal to obtain an amplitude limited sampled signal, and store the obtained signal in a preset storage unit;
[0101] A calculation module S3 is configured to calculate the ratio of the limited sampling signal in the preset storage unit if all sampling of the original analog signal is completed;
[0102] The output module S4 is configured to output the limited sampling signal as an output signal if the ratio of the limited sampling signal is greater than a preset ratio threshold.
[0103] Optionally, the amplitude modulation module S2 is further configured to:
[0104] If the amplitude of the original sampling signal is less than or equal to the first preset amplitude threshold, the original sampling signal is directly stored in a preset storage unit.
[0105] Optionally, the amplitude modulation module S2 is further configured to:
[0106] If the ratio of the limited sampling signal is less than or equal to the preset ratio threshold, the sampling signal in the preset storage unit is subjected to sliding average filtering to obtain a filtered analog signal, and the filtered analog signal is output as an output signal, wherein the sampling signal includes the limited sampling signal and the original sampling signal.
[0107] Optionally, the amplitude modulation module S2 is further configured to:
[0108] The amplitude of the original sampling signal is set as the first preset amplitude threshold to obtain a limited amplitude sampling signal.
[0109] Optionally, the amplitude modulation module S2 is further configured to:
[0110] Based on the first preset amplitude threshold, low-pass filtering is performed on the original sampling signal to obtain a limited amplitude sampling signal.
[0111] Optionally, the amplitude modulation module S2 is further configured to:
[0112] If the amplitude of the original sampled signal is less than or equal to the first preset amplitude threshold, detecting whether the amplitude of the original sampled signal is less than the second preset amplitude threshold, wherein the second preset amplitude threshold is less than the first preset amplitude threshold;
[0113] If the amplitude is less than the second preset amplitude threshold, the original sampling signal is subjected to amplitude-up processing to obtain an amplitude-up sampling signal, and the signal is stored in a preset storage unit;
[0114] If the amplitude is greater than or equal to the second preset amplitude threshold, the original sampling signal is directly stored in a preset storage unit.
[0115] Optionally, the amplitude modulation module S2 is further configured to:
[0116] If all the original analog signals are sampled, the ratio of the increased amplitude sampling signals in the preset storage unit is calculated;
[0117] If the ratio of the increased amplitude sampling signal is greater than a preset ratio threshold, the limited amplitude sampling signal is output as an output signal.
[0118] The steps implemented by the various functional modules of the sliding average filtering device may refer to the various embodiments of the sliding average filtering method of the present invention, and will not be repeated here.
[0119] In addition, the present invention also provides a sliding average filtering device, which includes: a memory, a processor and a sliding average filtering program stored in the memory; the processor is used to execute the sliding average filtering program to implement the steps of each embodiment of the above-mentioned sliding average filtering method.
[0120] The present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned sliding average filtering method.
[0121] The specific implementation of the computer-readable storage medium of the present invention is basically the same as the above-mentioned embodiments of the sliding average filtering method, and will not be repeated here.
[0122] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0123] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0124] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0125] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A sliding average filtering method, characterized in that: The sliding average filtering method comprises the following steps: Sampling the original analog signal based on a preset sampling interval to obtain an original sampling signal; If the amplitude of the original sampling signal is less than or equal to a first preset amplitude threshold, directly storing the original sampling signal in a preset storage unit; If the amplitude of the original sampling signal is greater than the first preset amplitude threshold, the original sampling signal is subjected to amplitude limiting processing to obtain an amplitude limiting sampling signal, and the amplitude limiting sampling signal is stored in a preset storage unit; If all the original analog signals are sampled, the ratio of the limited sampling signals in the preset storage unit is calculated; If the ratio of the limited sampling signal is less than or equal to a preset ratio threshold, performing a sliding average filtering process on the sampling signal in the preset storage unit to obtain a filtered analog signal, and outputting the filtered analog signal as an output signal, wherein the sampling signal includes the limited sampling signal and the original sampling signal; If the ratio of the limited sampling signal is greater than the preset ratio threshold, the limited sampling signal is output as an output signal.
2. The sliding average filtering method according to claim 1, wherein: The step of performing amplitude limiting processing on the original sampling signal to obtain the amplitude limited sampling signal comprises: The amplitude of the original sampling signal is set as the first preset amplitude threshold to obtain a limited amplitude sampling signal.
3. The sliding average filtering method according to claim 1, wherein: The step of performing amplitude limiting processing on the original sampling signal to obtain the amplitude limited sampling signal comprises: Based on the first preset amplitude threshold, low-pass filtering is performed on the original sampling signal to obtain a limited amplitude sampling signal.
4. The sliding average filtering method according to claim 1, wherein: If the amplitude of the original sampled signal is less than or equal to a first preset amplitude threshold, the step of directly storing the original sampled signal in a preset storage unit includes: If the amplitude of the original sampled signal is less than or equal to a first preset amplitude threshold, detecting whether the amplitude of the original sampled signal is less than a second preset amplitude threshold, wherein the second preset amplitude threshold is less than the first preset amplitude threshold; If the amplitude is less than the second preset amplitude threshold, the original sampling signal is subjected to amplitude-up processing to obtain an amplitude-up sampling signal, and the signal is stored in a preset storage unit; If the amplitude is greater than or equal to the second preset amplitude threshold, the original sampling signal is directly stored in a preset storage unit.
5. The sliding average filtering method according to claim 4, wherein: After the step of performing amplitude-up processing on the original sampling signal to obtain an amplitude-up sampling signal and storing the signal in a preset storage unit, the method further comprises: If all the original analog signals are sampled, the ratio of the increased amplitude sampling signals in the preset storage unit is calculated; If the ratio of the increased amplitude sampling signal is greater than a preset ratio threshold, the limited amplitude sampling signal is output as an output signal.
6. A sliding average filter device, characterized in that: The sliding average filtering device comprises: The sampling module is used to sample the original analog signal based on a preset sampling interval to obtain an original sampling signal; an amplitude modulation module, configured to directly store the original sampling signal in a preset storage unit if the amplitude of the original sampling signal is less than or equal to a first preset amplitude threshold; The amplitude modulation module is further configured to, if the amplitude of the original sampling signal is greater than the first preset amplitude threshold, perform amplitude limiting processing on the original sampling signal to obtain an amplitude limited sampling signal, and store the signal in a preset storage unit; a calculation module, configured to calculate the ratio of the limited sampling signal in the preset storage unit if all sampling of the original analog signal is completed; The amplitude modulation module is further configured to perform a sliding average filtering process on the sampling signal in the preset storage unit to obtain a filtered analog signal if the ratio of the limited sampling signal is less than or equal to a preset ratio threshold, and output the filtered analog signal as an output signal, wherein the sampling signal includes the limited sampling signal and the original sampling signal; The output module is configured to output the limited sampling signal as an output signal if the ratio of the limited sampling signal is greater than the preset ratio threshold.
7. A sliding average filtering device, characterized in that: The sliding average filtering device includes: a memory, a processor, and a sliding average filtering program stored in the memory and executable on the processor. When the sliding average filtering program is executed by the processor, the steps of the sliding average filtering method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a sliding average filtering program, which, when executed by a processor, implements the steps of the sliding average filtering method according to any one of claims 1 to 5.
Citation Information
Patent Citations
A narrowband interference frequency domain inhibition method
CN109728870A
Hybrid energy storage frequency division sliding filtering method
CN113595526A