A method and system for automatically removing interference signals in asynchronous serial communication

By real-time statistics on the maximum pulse width of the interference signal in asynchronous serial communication, the sampling filter coefficient is determined, and the interference-free output signal is reconstructed, the problem of asynchronous serial communication is easily disturbed, and efficient interference signal recognition and removal is achieved, and the enhanced The adaptability and flexibility of the system.

CN115514599BActive Publication Date: 2024-11-26ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211280230.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-19
Publication Date
2024-11-26
Estimated Expiration
2042-10-19

AI Technical Summary

Technical Problem

Asynchronous serial communication is susceptible to external interference. Traditional methods rely on the start bit determination and have a high misjudgment rate for interference signals, so they cannot accurately identify interference signals at any sampling location.

Method used

By counting the maximum pulse width of the interference signal in real time, determining the sampling filter coefficient, sampling and counting the input signal using the sampling frequency, reconstructing the interference-free output signal, avoiding the judgment of the start bit, and accurately identifying the interference signal at any sampling position.

Benefits of technology

The reconstruction of the interference-free output signal is realized, and the anti-interference ability is improved. It is suitable for the interference signal pulse width is less than half of the communication single-bit pulse width, which enhances the adaptability and flexibility of the system and reduces misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514599B_ABST
    Figure CN115514599B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for automatically removing interference signals in asynchronous serial communication, comprising: real-time statistics of the maximum pulse width of the interference signal in the input signal under the current environment; determining the sampling filter coefficient according to the set sampling frequency and the maximum pulse width of the interference signal; sampling the input signal at the sampling frequency, counting the high and low levels of the samples using the sampling filter coefficient, and reconstructing an output signal without interference signals. Also disclosed is a system for automatically removing interference signals in asynchronous serial communication, which is used for the specific implementation of the method for automatically removing interference signals in asynchronous serial communication. The system and method of the present invention are simple to implement, can remove a wide range of interference signals, have strong applicability, and are adaptive.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of asynchronous serial communication, and in particular to a method and a system for automatically removing interference signals in asynchronous serial communication. Background Art

[0002] Asynchronous serial communication is a commonly used communication method in engineering applications. It has simple hardware support and protocols, low implementation cost, and is widely used in low-speed communication between different devices. However, asynchronous serial communication is easily interfered by the external environment and has a weak anti-interference ability. If data is received in the traditional way of jumping edges, as long as there is interference, it will cause bit errors, and even normal communication cannot be achieved when the interference is serious.

[0003] In order to solve the problem that asynchronous serial communication is susceptible to interference, the commonly used methods are: determining the level of the single-bit pulse of the signal at a specific position (such as the middle position); or sampling the single-bit pulse of the signal multiple times, and counting the number of high and low levels to determine the level of the single-bit pulse. Both of the above methods can improve the anti-interference ability of serial communication, but the premise of using these two methods is that the start bit of the serial communication must be correctly identified, and the sampling position and sampling pulse are determined based on this. However, the start bit is often not correctly judged due to interference signals; and the method of determining the level of the single-bit pulse of the signal at a specific position will also cause misjudgment of interference signals that appear at the level determination position. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention provides a method and system for automatically removing interference signals in asynchronous serial communication, which completes the reconstruction of interference-free output signals based on real-time statistics of the maximum pulse width of the interference signal and the sampling frequency and sampling filter coefficient of the identifiable interference signal.

[0005] The present invention adopts the following technical solution:

[0006] A method for automatically removing interference signals in asynchronous serial communication specifically comprises the following steps:

[0007] Step 1: Real-time statistics of the maximum pulse width of the interference signal in the input signal under the current environment;

[0008] Step 2: According to the set sampling frequency and the maximum pulse width of the interference signal obtained in step 1, the sampling filter coefficient is determined in the following manner:

[0009] The sampling interval is obtained from the sampling frequency, and the maximum pulse width of the interference signal is compared with the size of the sampling interval. When the maximum pulse width of the interference signal is smaller than the sampling interval, the sampling filter coefficient is 2; when the maximum pulse width of the interference signal is larger than the sampling interval and smaller than M times of the sampling interval, the sampling filter coefficient is M;

[0010] Step three: Sample the input signal at the sampling frequency, count the high and low levels of the samples using the sampling filter coefficients obtained in step two, and reconstruct an output signal without interference signals.

[0011] Furthermore, in step 3, the high and low levels of the samples are counted using the sampling filter coefficients obtained in step 2 in the following manner:

[0012] When the count value decreases to 0, if the sampling continues to be a low level, the count value 0 remains unchanged; when the sampling reaches a high level, the count value increases by 1. When the count value is added to the value F of the sampling filter coefficient, if the sampling continues to be a high level, the count value F remains unchanged;

[0013] The output signal without interference is reconstructed as follows:

[0014] In the low level case, when the count increases from F-1 to F, the reconstructed output signal is a high level; in the high level case, when the count decreases from 1 to 0, the reconstructed output signal is a low level.

[0015] Furthermore, it includes: an interference pulse width statistics module, a sampling filter coefficient generation module, and an output signal reconstruction module;

[0016] The interference pulse width statistics module counts the maximum pulse width of the interference signal in the input signal under the current environment in real time;

[0017] The sampling filter coefficient generation module determines the sampling filter coefficient according to the sampling frequency and the maximum pulse width of the interference signal;

[0018] The output signal reconstruction module samples the input signal at the sampling frequency, counts the high and low levels of the samples using the sampling filter coefficient, and reconstructs an output signal without interference signals.

[0019] Further, the interference pulse width statistics module includes: a latch, a high-level pulse width counter, and a low-level pulse width counter; the latch is used to store the maximum pulse width of the interference signal, the high-level pulse width counter is used to count the high-level pulse width, and the low-level pulse width counter is used to count the low-level pulse width;

[0020] The high-level pulse width counter and the low-level pulse width counter both count in the following manner: starting counting with a transition edge of the input signal as the starting point and ending counting with the next transition edge as the ending point, and counting the widths of all input pulses in real time. Signals less than half the width of a single-bit pulse are considered to be interference signals, and a latch is used to latch the maximum pulse width value of the interference signal.

[0021] Furthermore, the sampling filter coefficient generation module compares the maximum pulse width of the interference signal and the size of the sampling interval. When the maximum pulse width of the interference signal is smaller than the sampling interval, the sampling filter coefficient takes a value of 2; when the maximum pulse width of the interference signal is larger than the sampling interval and smaller than an integer multiple M of the sampling interval, the sampling filter coefficient takes a value of M.

[0022] Furthermore, the output signal reconstruction module samples the input signal according to the sampling frequency, and counts the high and low levels of the samples using the sampling filter coefficient in the following manner:

[0023] When the system samples a high level, the count value starts to increase by 1 until the count value is added to the value F of the sampling filter coefficient. If the system continues to sample a high level, the count value F remains unchanged; if the system continues to sample a low level, the count value starts to decrease by 1 until the count value decreases to 0 and remains unchanged.

[0024] The output signal without interference signal is reconstructed as follows:

[0025] In the low level case, when the count value increases from F-1 to F, the reconstructed output signal is a high level; in the high level case, when the count value decreases from 1 to 0, the reconstructed output signal is a low level.

[0026] Furthermore, the sampling interval is determined by a sampling frequency, and the value of the sampling frequency must ensure that the single-bit pulse data is sampled an integer number of times and take into account the delay of signal processing.

[0027] Furthermore, when the maximum pulse width of the interference signal is less than the sampling interval, the maximum delay of the system does not exceed 3 times the sampling interval. When the maximum pulse width of the interference signal is greater than the sampling interval and less than an integer multiple M of the sampling interval, the maximum delay of the system processing shall not exceed M+1 times of the sampling interval.

[0028] The beneficial effects of the present invention are:

[0029] (1) Compared with the prior art, the present invention does not rely on the start bit as a reference for determining the single-bit pulse level, and will not cause misjudgment of resolvable interference signals appearing at any sampling position.

[0030] (2) The present invention is applicable to removing all interference signals whose maximum pulse width is less than half of the communication single-bit pulse width and whose resolution is greater than the pulse width of the interference signal (i.e., the distance between the useful signal and the interference signal of the same level is greater than the pulse width of the interference signal), and a wide range of interference signals can be removed.

[0031] (3) The present invention uses real-time statistics of the maximum pulse width of the interference signal to adjust the filtering parameters, thereby improving the adaptability of the system.

[0032] (4) The present invention uses a separate system that does not need to be coupled with other processing modules, thereby improving the flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a flow chart of a system for automatically removing interference signals in asynchronous serial communication according to the present invention.

[0034] Figure 2 This is an example of reconstructing the output signal when the interference signal pulse width is smaller than the sampling interval.

[0035] Figure 3 This is an example of reconstructing the output signal when the interference signal pulse width is larger than the sampling interval.

[0036] Figure 4 This is an example of reconstructing the output signal when the pulse width of the interference signal captured by the logic analyzer is smaller than the sampling interval.

[0037] Figure 5 This is an example of reconstructing the output signal when the pulse width of the interference signal captured by the logic analyzer is larger than the sampling interval. DETAILED DESCRIPTION

[0038] The present invention will be described in detail below according to the accompanying drawings and preferred embodiments, and the purpose and effect of the present invention will become more clear. The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. 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.

[0039] A method for automatically removing interference signals in asynchronous serial communication has the following specific steps:

[0040] Step 1: Real-time statistics of the maximum pulse width of the interference signal in the input signal under the current environment.

[0041] Step 2: Determine the sampling filter coefficient based on the sampling frequency and the maximum pulse width of the interference signal.

[0042] The sampling interval is obtained from the sampling frequency, and the maximum pulse width of the interference signal is compared with the sampling interval. When the maximum pulse width of the interference signal is smaller than the sampling interval, the sampling filter coefficient is 2; when the maximum pulse width of the interference signal is larger than the sampling interval and smaller than M times the sampling interval, the sampling filter coefficient is M.

[0043] Step 3: Sample the input signal according to the sampling frequency, use the sampling filter coefficient to count the high and low levels of the samples, and complete the reconstruction of the output signal without interference.

[0044] Counting is performed according to the sampling level. When the count value decreases to 0, if the sampling continues to the low level, the count value remains unchanged at 0; when the sampling reaches the high level, the count increases by 1. When the count value is added to the value F of the sampling filter coefficient, if the sampling continues to the high level, the count value F remains unchanged.

[0045] In the high level case, when the count decreases from 1 to 0, the reconstructed output signal is a low level; in the low level case, when the count increases from F-1 to F, the reconstructed output signal is a high level, completing the reconstruction of the input signal after removing the interference signal.

[0046] like Figure 1 As shown, a system for automatically removing interference signals in asynchronous serial communication includes: an interference pulse width statistics module, a sampling filter coefficient generation module, and an output signal reconstruction module.

[0047] The interference pulse width statistics module is used to count the maximum pulse width of the interference signal in the input signal under the current environment in real time.

[0048] The interference pulse width statistics module includes: latch, high level pulse width counter, low level pulse width counter. The latch is used to store the maximum pulse width of the interference signal, which is initialized to 0; the two counters count the high level pulse width and low level pulse width respectively.

[0049] The high-level pulse width counter starts counting with the rising edge of the input signal as the starting point and ends counting with the falling edge of the input signal as the ending point, and counts the width of the high-level pulse in real time; performs accumulation operation during the high-level pulse period and clears to zero during the low-level pulse period; if the width of the high-level pulse is less than half of the communication single-bit pulse width at the falling edge, the high-level pulse is determined to be an interference signal; otherwise, the high-level pulse is determined to be a normal signal; for the interference signal, continue to judge whether the high-level pulse width value at this moment is greater than the value in the latch, if yes, use the high-level pulse width value at this moment to update the value in the latch, otherwise keep the value in the latch unchanged.

[0050] The low-level pulse width counter starts counting with the falling edge of the input signal as the starting point, and ends counting with the rising edge of the input signal as the ending point, and counts the width of the low-level pulse in real time; performs accumulation operation during the low-level pulse period, and clears to zero during the high-level pulse period; if the low-level pulse width is less than half of the communication single-bit pulse width at the rising edge, the low-level pulse is determined to be an interference signal; otherwise, the low-level pulse signal is determined to be a normal signal; for the interference signal, continue to judge whether the low-level pulse width at this moment is greater than the value in the latch, if yes, then use the value of the low-level pulse width at this moment to update the value in the latch, otherwise keep the value in the latch unchanged.

[0051] The sampling filter coefficient generation module determines the sampling filter coefficient according to the sampling frequency and the maximum pulse width of the interference signal.

[0052] The baud rate of asynchronous serial communication is different, and the sampling frequency N can also be different. It is necessary to ensure that the single-bit pulse data is sampled an integer number of times, and then consider the delay of signal processing. The value of the sampling frequency N is generally between 8 and 32. In this embodiment, the sampling frequency N is 16.

[0053] When the maximum pulse width of the interference signal is less than the sampling interval, the sampling filter coefficient is 2. In this case, for the same interference signal, the sampling pulse will only be sampled once at most. Figure 2 As shown, interference signal 1 is sampled, but interference signal 2 is not sampled.

[0054] When the maximum pulse width of the interference signal is greater than the sampling interval and less than M times the sampling interval, M is a positive integer, and the sampling filter coefficient is M. In this case, for the same interference signal, the sampling pulse will continuously sample M-1 interference signals. Figure 3 As shown, the interference signal 1 is less than 5 times of the sampling interval and is sampled 4 times; the interference signal 2 is less than 3 times of the sampling interval and is sampled 2 times.

[0055] The output signal reconstruction module samples the input signal according to the sampling frequency, counts the high and low levels of the samples using the sampling filter coefficient, and completes the reconstruction of the output signal without interference.

[0056] exist Figure 2In the example shown, the pulse width of the interference signal is smaller than the sampling interval, so the sampling filter coefficient F is set to 2. When the system samples a high level, the count value starts to increase by 1 until it reaches F. If the high level is continuously sampled, the count value remains unchanged. When the low level interference signal 1 is sampled, the count value decreases by 1. If the high level is continuously sampled, the count value increases by 1 again until F remains unchanged. When the low level is sampled, the counter decreases by 1 until it reaches 0. If the low level is continuously sampled, the count value remains unchanged at 0. The high level interference signal 2 is not sampled and will not cause changes in the counter.

[0057] exist Figure 3 In the example shown, the pulse width of the interference signal is greater than the sampling interval, and the pulse width of the largest interference signal is less than 5 times the sampling interval, so the sampling filter coefficient F is 5. When the system samples a high level, the count value starts to increase by 1 until it reaches F. If it continues to sample a high level, the count value remains unchanged at F; if it continues to sample a low level, the count value decreases by 1 until it reaches 0. Figure 3 As shown, the system is initially at a low level and the count value is 0; then a high level is sampled, and the count value starts to increase by 1, and continues to increase to 5; at this time, after continuing to sample the low-level interference signal 1, the count value starts to decrease by 1, until it decreases to 1; again, a high level is sampled, and the count value starts to increase by 1, and continues to increase to 5, and remains at 5 unchanged; continues to sample the low level, the count value decreases by 1, until it decreases to 0; continues to sample the high-level interference signal 2, the count increases by 1, until it reaches 2; then continues to sample the low level, the counter decreases by 1, until the count reaches 0, and remains at 0 unchanged.

[0058] exist Figure 2 and Figure 3 In the example, when the count value changes from F-1 to F, the reconstructed output signal is a high level, and when the count value changes from 1 to 0, the reconstructed output signal is a low level. The unit pulse width of the output signal is 16 sampling frequencies, which is consistent with the input. Figure 2 In the example, when the count value changes from 1 to 2, the reconstructed output signal is at a high level, until when the count value changes from 1 to 0, the reconstructed output signal is at a low level. Figure 3 In the example, when the count value increases from 4 to 5, the reconstructed output signal is at a high level, until when the count value decreases from 1 to 0, the reconstructed output signal is at a low level.

[0059] For interference signals with a maximum pulse width less than half the width of a single-bit pulse of communication and a resolution greater than the pulse width of the interference signal (i.e., the distance between the useful signal and the interference signal of the same level is greater than the pulse width of the interference signal), the count changes caused by all interference signals will not change from F-1 to F or from 1 to 0, so these interferences can be automatically removed by sampling counts. When the maximum pulse width of the interference signal is less than the sampling interval, the maximum delay of signal processing shall not exceed 3 times the sampling interval; when the maximum pulse width of the interference signal is greater than the sampling interval and less than M times the sampling interval, the maximum delay of signal processing shall not exceed M+1 times the sampling interval.

[0060] like Figure 4 and Figure 5 As shown, the actual data captured by the logic analyzer of the FPGA on the board is verified in the actual system of the present invention. The serial input signal is artificially added with an interference signal to become an input test signal, and the sampling filter coefficient is set according to the maximum pulse width of the real-time statistical interference signal, and the single-bit pulse data is sampled at a sampling frequency of N=16; the counter is counted according to the sampling filter coefficient, and finally the output signal without interference signal is reconstructed.

[0061] Figure 4 The maximum pulse width of the interference signal captured in the sampling process is smaller than the sampling interval, so the sampling filter coefficient is 2, and the delay of the output signal relative to the input signal is no more than 3 sampling intervals; Figure 5 The maximum pulse width of the interference signal captured is less than 6 times the sampling interval, so the sampling filter coefficient is 6, and the delay of the output signal relative to the input signal is no more than 7 sampling intervals.

[0062] Compare Figure 4 , Figure 5 It can be seen from the serial input signal input in the asynchronous serial communication and the reconstructed output signal without interference that the method of the present invention can effectively remove the interference signal in the asynchronous serial communication, and the reconstructed output signal is relatively complete and accurate.

[0063] Those skilled in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention shall be included in the protection scope of the invention.

Claims

1. A method for automatically removing interference signals in asynchronous serial communication, characterized in that: The specific steps include: Step 1: Real-time statistics of the maximum pulse width of the interference signal in the input signal under the current environment; Step 2: According to the set sampling frequency and the maximum pulse width of the interference signal obtained in step 1, the sampling filter coefficient is determined in the following manner: The sampling interval is obtained from the sampling frequency, and the maximum pulse width of the interference signal is compared with the size of the sampling interval. When the maximum pulse width of the interference signal is smaller than the sampling interval, the sampling filter coefficient is 2; when the maximum pulse width of the interference signal is larger than the sampling interval and smaller than M times of the sampling interval, the sampling filter coefficient is M; Step 3: Sampling the input signal at the sampling frequency, counting the high and low levels of the samples using the sampling filter coefficients obtained in step 2, and reconstructing an output signal without interference signals; In step 3, the high and low levels of the samples are counted using the sampling filter coefficients obtained in step 2 in the following manner: When the count value decreases to 0, if the sampling continues to be a low level, the count value 0 remains unchanged; when the sampling reaches a high level, the count value increases by 1. When the count value is added to the value F of the sampling filter coefficient, if the sampling continues to be a high level, the count value F remains unchanged; The output signal without interference is reconstructed as follows: In the low level case, when the count increases from F-1 to F, the reconstructed output signal is a high level; in the high level case, when the count decreases from 1 to 0, the reconstructed output signal is a low level.

2. A system for automatically removing interference signals in asynchronous serial communication, characterized in that: include: Interference pulse width statistics module, sampling filter coefficient generation module, output signal reconstruction module; The interference pulse width statistics module counts the maximum pulse width of the interference signal in the input signal under the current environment in real time; The sampling filter coefficient generation module determines the sampling filter coefficient according to the sampling frequency and the maximum pulse width of the interference signal; The output signal reconstruction module samples the input signal at the sampling frequency, counts the high and low levels of the samples using the sampling filter coefficient, and reconstructs an output signal without interference signals; The output signal reconstruction module samples the input signal according to the sampling frequency, and counts the high and low levels of the samples using the sampling filter coefficient in the following manner: When the system samples a high level, the count value starts to increase by 1 until the count value is added to the value F of the sampling filter coefficient. If the system continues to sample a high level, the count value F remains unchanged; if the system continues to sample a low level, the count value starts to decrease by 1 until the count value decreases to 0 and remains unchanged. The output signal without interference signal is reconstructed as follows: In the low level case, when the count value increases from F-1 to F, the reconstructed output signal is a high level; in the high level case, when the count value decreases from 1 to 0, the reconstructed output signal is a low level.

3. The system for automatically removing interference signals in asynchronous serial communication according to claim 2, characterized in that: The interference pulse width statistics module includes: a latch, a high level pulse width counter, and a low level pulse width counter; the latch is used to store the maximum pulse width of the interference signal, the high level pulse width counter is used to count the high level pulse width, and the low level pulse width counter is used to count the low level pulse width; The high-level pulse width counter and the low-level pulse width counter both count in the following manner: starting counting with a transition edge of the input signal as the starting point and ending counting with the next transition edge as the ending point, and counting the widths of all input pulses in real time. Signals less than half the width of a single-bit pulse are considered to be interference signals, and a latch is used to latch the maximum pulse width value of the interference signal.

4. The system for automatically removing interference signals in asynchronous serial communication according to claim 2, characterized in that: The sampling filter coefficient generation module compares the maximum pulse width of the interference signal and the size of the sampling interval. When the maximum pulse width of the interference signal is smaller than the sampling interval, the sampling filter coefficient takes a value of 2; when the maximum pulse width of the interference signal is larger than the sampling interval and smaller than an integer multiple M of the sampling interval, the sampling filter coefficient takes a value of M.

5. The system for automatically removing interference signals in asynchronous serial communication according to claim 4, characterized in that: The sampling interval is determined by the sampling frequency. The value of the sampling frequency must ensure that the single-bit pulse data is sampled an integer number of times and take into account the delay of signal processing.

6. The system for automatically removing interference signals in asynchronous serial communication according to claim 2, characterized in that: When the maximum pulse width of the interference signal is less than the sampling interval, the maximum delay of the system shall not exceed 3 times the sampling interval; when the maximum pulse width of the interference signal is greater than the sampling interval and less than an integer multiple M of the sampling interval, the maximum delay of the system processing shall not exceed M+1 times the sampling interval.