Correction algorithm for AM demodulation waveform
By performing envelope detection, low-pass filtering and AD sampling on the received subcarrier signals, the enhanced level representation value is calculated and corrected, the Manchester encoding and demodulation difficulties caused by signal distortion and environmental interference are solved, and accurate signal recovery and stability improvement in complex environments are achieved.
Patent Information
- Application Number
- CN202510100824.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-22
AI Technical Summary
In the prior art, signal distortion, environmental interference and inconsistent hardware parameters make it difficult for Manchester to encode and demodulate.
By performing envelope detection and low-pass filtering on the received subcarrier signal, the signal is extracted and smoothed, and then data is obtained and analyzed through AD sampling, the enhanced level representation value of each level period is calculated, the signal is judged in combination with the level threshold, and the distorted waveform is corrected by comparing with the preset reference value.
Effectively reduce the impact of noise and interference, ensure that the signal can be accurately restored in the case of poor signal quality, and improve the stability and reliability of the system in complex environments.
Smart Images

Figure CN119945861A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of signal processing, and in particular to an algorithm for correcting AM demodulation waveforms. Background Art
[0002] AM signals are very common in life. Common NFC and high-frequency RFID use AM demodulation technology. AM demodulation is the process of restoring the modulated AM signal to the original baseband signal. The recovered signal is Manchester coding. Manchester coding is a commonly used coding method in digital signal processing. It is a self-synchronous coding method proposed by the University of Manchester. It uses the transition edge of the signal to represent the logical value of the data. Manchester coding has error detection capabilities and does not require clock synchronization. Therefore, it is widely used in Ethernet, wireless transmission and other fields.
[0003] The encoding rules of Manchester coding are very simple, that is, each code element is represented by two level signals with different phases, that is, a square wave of one period, but the phases of code 0 and code 1 are exactly opposite. Code 0 and code 1 can be defined as 0->1 transition or 1->0 transition; the detection device can detect the transition edge as a clock signal, so Manchester coding does not require a separate clock signal.
[0004] The communication between the high-frequency RFID tag and the reader is carried out using Manchester coding. According to the ISO15693 standard, the carrier frequency fc between VICC and VCD is 13.56MHz. VICC transmits data to VCD through load modulation, and the load wave is generated by VICC switching the load. The amplitude of load modulation is at least greater than 10mv; the first bit of the VCD communication message selects one or two subcarriers. VICC supports two modes. When one subcarrier is used, the subcarrier load modulation frequency fs1 is fc / 32 (423.75KHz), and when two subcarriers are used, the frequency fs1 is fc / 32 (423.75KHz), and fs2 is fc / 28 (428.28KHz).
[0005] The load wave modulation adopted by VICC generates a very weak load wave signal. Generally, it needs to go through detection, amplification, filtering, comparison and other circuits to restore the Manchester coded waveform carrying VICC data. In actual application, the degree of distortion of the Manchester coded waveform is related to many factors, such as the distance between the tag and the antenna, the surrounding environment of the antenna, various parameters of the hardware circuit, etc. These factors will not only cause waveform distortion, but may even cause the waveform to be submerged by noise, so that the Manchester coded information cannot be identified. When multiple tags conflict or the distance between the tag and the antenna changes, the amplitude of the demodulated waveform will also change accordingly. Therefore, to parse out the Manchester coded information, it is necessary to restore the Manchester waveform without distortion, and then use the processor to demodulate the waveform. Using traditional hardware circuits for demodulation not only makes the circuit complex and parameter debugging difficult, but also makes it difficult to ensure the consistency of circuit parameters during mass production. Summary of the invention
[0006] In view of the deficiencies of the prior art, the present invention provides an AM demodulation waveform correction algorithm, which solves the problem of difficulty in Manchester coding demodulation caused by signal distortion, environmental interference and inconsistent hardware parameters in the prior art.
[0007] To achieve the above purpose, the present invention is implemented through the following technical solutions: an AM demodulation waveform correction algorithm, comprising the following steps: performing envelope detection processing on the subcarrier received by the antenna to obtain a preliminary demodulation waveform; performing low-pass filtering processing on the detected signal to obtain an approximate square wave shape; inputting the low-pass filtered signal into a comparator circuit for binary code conversion; in the case of signal distortion, performing data acquisition on the signal through AD sampling to obtain AD sampling data, wherein the AD sampling data includes a plurality of AD sampling values of a plurality of level time periods; performing data analysis on the AD sampling data to obtain a level threshold and an enhanced level representation value of each level time period respectively; performing high and low level judgment on the AD sampling data based on the level threshold, and determining the level state of each time period according to the judgment result; comparing and analyzing the enhanced level representation value of each level time period with a preset level reference value respectively, and correcting the distorted waveform according to the comparison result.
[0008] Furthermore, when data is collected on a signal through AD sampling, data sampling is performed at fixed time intervals.
[0009] Furthermore, the specific steps of obtaining the level threshold are as follows: after VCD sends a read command to VICC, VICC starts to transmit data back. When VICC starts to send 8-bit SOF, MCU starts to sample the RSSI signal and performs Kalman filtering on the sampled data to obtain the RSSI signal value of the current transmitted data frame.
[0010] Before using the algorithm, the relationship between the RSS I value and the high and low level thresholds Q returned by the VI CC at different distances in the same environment must be calibrated in advance, and the function of Q and RSS I is obtained through polynomial fitting;
[0011] When using the algorithm, the MCU checks the RSSI value returned by the VI CC in real time to determine the Q value of the current VI CC and obtain the binary data of the frame data.
[0012] Furthermore, the specific steps for obtaining the enhanced level representation value of each level period are as follows: comparatively analyze each AD sampling value of each level period to obtain the AD sampling maximum value and AD sampling minimum value of each level period; comprehensively analyze the AD sampling maximum value and AD sampling minimum value of each level period to obtain the enhanced level representation value of each level period.
[0013] Furthermore, the specific formula for calculating the enhanced level representation value of each level period is as follows: Among them, N j is the enhanced level representation value of the jth level period, AD j Max is the maximum value of AD sampling in the jth level period, AD j Min is the minimum AD sampling value of the jth level period, and k is the proportional factor stored in the database.
[0014] The present invention has the following beneficial effects:
[0015] (1) This algorithm for AM demodulation waveform correction can effectively reduce the impact of noise and interference by calculating the enhanced level representation value and threshold judgment of the distorted waveform, ensuring that the signal can still be accurately restored under poor signal quality conditions, thereby improving the stability and reliability of the system in complex environments.
[0016] (2) The AM demodulation waveform correction algorithm performs data analysis and waveform correction on each level period. The algorithm can accurately determine the high and low levels in the signal, ensuring that the information transmission during the signal demodulation process will not be affected by waveform distortion, thereby ensuring accurate signal recovery.
[0017] (3) The AM demodulation waveform correction algorithm adopts an adaptive method to dynamically adjust the threshold and enhancement level representation value based on the sampled data and the preset reference value, so that it can automatically optimize the processing process according to different signal conditions, thereby improving the adaptability and robustness of the algorithm in various environments.
[0018] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The present invention is a flow chart of an AM demodulation waveform correction algorithm.
[0020] Figure 2 The figure is a schematic diagram of SOF in an AM demodulation waveform correction algorithm of the present invention.
[0021] Figure 3 This is a schematic diagram of logic 0 in an AM demodulation waveform correction algorithm of the present invention.
[0022] Figure 4 This is a schematic diagram of logic 1 in an AM demodulation waveform correction algorithm of the present invention.
[0023] Figure 5 The figure is a schematic diagram of EOF in an AM demodulation waveform correction algorithm of the present invention.
[0024] Figure 6 The figure is a schematic diagram of a Manchester waveform in an AM demodulation waveform correction algorithm according to the present invention.
[0025] Figure 7 The present invention is a schematic diagram of a Manchester waveform distorted in an AM demodulation waveform correction algorithm.
[0026] Figure 8 The present invention is a schematic diagram of an array N in an AM demodulation waveform correction algorithm.
[0027] Fig. 9 This is a schematic diagram of an AM demodulation waveform correction algorithm in the present invention where the tag is 10 cm away from the antenna.
[0028] Fig.10 This is a schematic diagram of an AM demodulation waveform correction algorithm in the present invention where the tag is 20 cm away from the antenna.
[0029] Fig.11 This is a schematic diagram of an AM demodulation waveform correction algorithm in the present invention where the tag is 30 cm away from the antenna.
[0030] Fig.12 The figure is a schematic diagram of the relationship between RSS I and Q in the AM demodulation waveform correction algorithm of the present invention.
[0031] Fig.13 This is a schematic diagram of reference values when the tag is 10 cm away from the antenna in the AM demodulation waveform correction algorithm of the present invention.
[0032] Fig.14 This is a schematic diagram of reference values when the tag is 20 cm away from the antenna in the AM demodulation waveform correction algorithm of the present invention.
[0033] Fig.15 This is a schematic diagram of reference values when the tag is 30 cm away from the antenna in the AM demodulation waveform correction algorithm of the present invention.
[0034] Fig.16 The present invention is a schematic diagram of logic data D in an AM demodulation waveform correction algorithm. DETAILED DESCRIPTION
[0035] The overall idea of the problem in the embodiment of this application is as follows:
[0036] The received subcarrier signal is subjected to envelope detection and low-pass filtering to extract and smooth the signal. The data is then acquired and analyzed through AD sampling. In the case of signal distortion, the algorithm calculates the enhanced level representation value of each level period, combines the level threshold to make high and low level judgments on the signal, and corrects the distorted waveform by comparing it with the preset reference value to restore the original signal. This method effectively improves the signal's anti-interference ability and ensures accurate decoding and recovery of the signal.
[0037] See also Figure 1 The embodiment of the present invention provides a technical solution: an algorithm for correcting AM demodulation waveform, comprising the following steps: performing envelope detection processing on the subcarrier received by the antenna to obtain a preliminary demodulation waveform; performing low-pass filtering processing on the detected signal to obtain an approximate square wave shape; inputting the low-pass filtered signal into a comparator circuit for binary code conversion; in the case of signal distortion, performing data acquisition on the signal through AD sampling to obtain AD sampling data, wherein the AD sampling data includes a plurality of AD sampling values of a plurality of level time periods; performing data analysis on the AD sampling data to obtain a level threshold and an enhanced level representation value of each level time period respectively; performing high and low level judgment on the AD sampling data based on the level threshold, and determining the level state of each time period according to the judgment result; comparing and analyzing the enhanced level representation value of each level time period with a preset level reference value respectively, and correcting the distorted waveform according to the comparison result.
[0038] When data is collected from a signal through AD sampling, data sampling is performed at fixed time intervals.
[0039] Specifically, the specific steps to obtain the level threshold are as follows: after VCD sends a read command to VI CC, VI CC starts to transmit data back. When VI CC starts to send 8-bit SOF, MCU starts to sample the RSSI signal and performs Kalman filtering on the sampled data to obtain the RSSI signal value of the current transmitted data frame. Due to the influence of distance and environment, the RSSI values of different VI CCs are different. Therefore, before using the algorithm, the relationship between the RSS I value returned by VI CCs at different distances in the same environment and the high and low level thresholds Q needs to be calibrated in advance, such as Fig.11 As shown in the figure, the function of Q and RSSI can be obtained through polynomial fitting. When using the algorithm, the MCU checks the RSSI value returned by VICC in real time and brings it into Fig.11 The Q value of the current VI CC can be determined from the formula, and the binary data of the frame data can be further obtained.
[0040] In this implementation scheme, by combining the techniques of Kalman filtering and polynomial fitting, this method can effectively improve the accuracy of level threshold judgment. First, the MCU samples the RSSI signal in real time when the VICC sends data, and uses Kalman filtering to remove noise and interference in the signal, so as to obtain a more accurate RSSI value. Then, by calibrating the VICC at different distances under the same environment, the relationship between the RSSI value and the level threshold Q is established using polynomial fitting. This process ensures that under different working conditions, the system can dynamically adjust the level threshold according to the actual RSSI value, so as to adapt to the impact of environmental and distance changes. Compared with the traditional fixed threshold method, this method can significantly improve the stability and accuracy of level judgment, reduce errors caused by environmental changes, and realize automated and real-time signal processing, thereby enhancing the reliability, adaptability and flexibility of the system.
[0041] The specific steps for obtaining the enhanced level representation value of each level period are as follows: compare and analyze each AD sampling value of each level period to obtain the AD sampling maximum value and AD sampling minimum value of each level period; comprehensively analyze the AD sampling maximum value and AD sampling minimum value of each level period to obtain the enhanced level representation value of each level period.
[0042] The specific formula for calculating the enhanced level representation value of each level period is as follows: Among them, N j is the enhanced level representation value of the jth level period, AD j Max is the maximum value of AD sampling in the jth level period, AD j Min is the minimum AD sampling value of the jth level period, and k is the proportional factor stored in the database.
[0043] In this implementation scheme, the signal strength change is realized by monitoring the RSSI signal, and the RSSI signal is processed by Kalman filtering to better distinguish different levels. Through comprehensive analysis of the maximum and minimum values, the algorithm can enhance the contrast of the signal, highlight the difference between the high level and the low level in the signal, and make the subsequent high and low level judgments more accurate. In actual signals, instantaneous fluctuations due to noise or signal instability often occur. Data that simply relies on one sampling point may be affected by these fluctuations. However, by calculating the maximum and minimum values, the algorithm can take into account the fluctuation range of the level, thereby reducing the interference of a single abnormal sampling value on the level judgment. Especially in the case of weak signals or large noise interference, the enhanced level representation value can effectively filter out irrelevant noise information. By introducing a proportional factor, the calculation results of the maximum and minimum values can be further adjusted, so that the enhanced level representation value can be adjusted according to the actual application scenario. The proportional factor can be adjusted according to the database The empirical values or actual test data stored in the data are dynamically optimized and calculated for different signal conditions and noise environments, thereby improving the adaptability and calculation accuracy of the level representation value. In this way, the enhanced level representation value can not only more accurately reflect the true level state of the signal, but also respond more delicately to tiny signal changes, which is helpful for accurate signal recovery and demodulation. This method can more truly reflect the fluctuation range and amplitude of the signal than simple mean or median analysis. Especially for the case of drastic signal fluctuations, through the comprehensive analysis of the maximum and minimum values, the enhanced level representation value can more effectively adapt to various signal changes, ensuring that accurate signal judgment can be provided even in unstable or highly interfering environments. By calculating the enhanced level representation value, the algorithm can improve the contrast of the signal, especially when the difference between different levels is small or the signal is weak. The enhanced level representation value makes the signal level more prominent, helping the subsequent demodulation link to restore the original data more accurately.
[0044] The specific implementation example of the AM demodulation waveform correction algorithm is as follows:
[0045] First, the detection circuit performs envelope detection on the subcarrier on the antenna. After the processing is completed, the small signal is amplified and the amplified signal is connected to the AD sampling port of the MCU. Because the communication between VCD and VICC is simplex, AD sampling is performed after VCD sends a message to VICC, and the sampled data is demodulated.
[0046] According to the ISO15693 standard, the frame format returned by VICC consists of SOF+data field+EOF, such as Figure 2-5 shown.
[0047] When the tag is close to the antenna, after being processed by the detection circuit and low-pass filter circuit, a waveform approximating a square wave can be obtained, such as Figure 6 As shown, at this time, the waveform can be converted into a binary code of logic 0 or 1 through a comparator circuit, and then the hexadecimal data is obtained according to the corresponding protocol rules in the ISO15693 standard.
[0048] When the tag is far away from the antenna and there is noise, the waveform obtained after the detection circuit and low-pass filter processing is distorted. The waveform may fluctuate multiple times within a symbol period. At this time, if a comparator circuit is used, the corresponding binary code cannot be obtained. Figure 7 As shown:
[0049] When the waveform begins to be distorted, the data returned by VI CC cannot be truly restored through the comparison circuit, so the distorted waveform needs to be corrected first.
[0050] First, perform AD sampling on the Manchester waveform. Assume that the sampling array is M. According to ISO15693, the time period of a code element, i.e., logic 0 or logic 1, is 37.76us, and the high and low levels each take 18.88us. Assume that n AD values are sampled for each level. According to ISO15693, when obtaining the RFID tag U ID, VI CC returns a total of 208 high and low level values, and a total of 208*n AD values need to be collected. Next, the data collected from each level segment is used to determine whether the current level is high or low. A common method is to average the current data, and then use the median of the average value as the threshold of the high and low levels. Assume that 4 segments of data are collected as follows: Data1-Data4, where Data1 and Data3 are high level data, and Data2 and Data4 are low level data, as shown in Table 1.
[0051] Table 1 Example of collected AD value data
[0052] Data1 1317 1343 1379 1369 1320 1303 1339 1373 1383 1391 1401 1348 Data2 1271 1253 1253 1059 1025 1029 1077 1200 1195 1148 1175 1251 Data3 1318 1363 1376 1364 1284 1165 1267 1315 1349 1372 1320 1291 Data4 1073 1179 1173 1153 1024 878 979 878 935 1006 1091 1145
[0053] Calculate the average value of each segment of data Data1 avr =(Data1[0]+Data1[1]+…+Data1
[11] ) / 12; Similarly, Data2 avr 、Data3 avr 、Data4 avr ; Then use the average method to find the high and low level threshold Data avr_ref =((Data1 avr +Data3 avr ) / 2+(Data2 avr +Data4 avr ) / 2) / 2; Calculate Data according to the data in Table 1 avr_ref =1218.75, this threshold is consistent with Data2 avrThe difference is 57. If the wave amplitude of this group of data is large, it will lead to misjudgment of the data level.
[0054] Using this algorithm, find the maximum and minimum AD values in each level time period, then find the average of the maximum and minimum values, and then square them to increase the AD difference between the high and low levels to obtain the new representation value N of the level. j , the formula is as follows: N j =((max(M 0-n )+min(M 0-n ))2 / ) 2 / k.
[0055] Assume k = 1000, and use the above formula to calculate the value of each segment of data Data1 N =1825.5, Data2 N =1302.8、Data3 N =1603、Data4 N =1035.1, and then use the average method to find the high and low level thresholds Data maxmin_ref =((Data1 N +Data3 N ) / 2+(Data2 N +Data4 N ) / 2) / 2=1441.6; compared with Data1N-Data4N, the minimum difference between this threshold and Data1N-Data4N is 137, which has stronger anti-interference ability than the average value algorithm;
[0056] In the above formula, k represents the proportional factor. The same method is used to obtain a new representation value array N of 208 high and low levels. The value chart is as follows: Figure 8 shown.
[0057] Compare the elements in array N with the reference value Qi, Ni>Qi is logic 1, otherwise it is logic 0; then combine into hexadecimal data according to ISO15693 protocol, and you can get the UID information returned by VICC;
[0058] Since the data N changes with the distance between the tag and the antenna, Figure 9-11 shown.
[0059] Therefore, different reference values need to be set for different distances; collect the AD value of the RSSI signal strength indication corresponding to the tag distance of 0-50cm from the antenna, and use the polynomial fitting method to obtain the relationship between the distance between the tag and the antenna and the reference value Qi, such as Figure 12-16 shown.
[0060] Qi=a*RSSI i 4 +b*RSSI i3 +c*RSSI i 2 +d*RSSI i +e;
[0061] By comparing the sizes of corresponding elements in arrays N and Q, the logical values 0 or 1 corresponding to the high and low levels can be obtained and stored in data D;
[0062] According to ISO15693, the binary number of SOF is 00011101B, the binary number of EOF is 10111000B, the binary number of logic 0 is 10B, and the binary number of logic 1 is 01B. By traversing and comparing the array D, the U ID information of the tag can be obtained.
[0063] In summary, this application has at least the following effects:
[0064] By calculating the enhanced level representation value and judging the threshold of the distorted waveform, the algorithm can effectively reduce the impact of noise and interference, ensure that the signal can be accurately restored even in the case of poor signal quality, and improve the stability and reliability of the system in complex environments.
[0065] By performing data analysis and waveform correction on each level period, the algorithm can accurately determine the high and low levels in the signal, ensuring that information transmission during the signal demodulation process will not be affected by waveform distortion, thereby ensuring accurate signal recovery.
[0066] By adopting an adaptive method, the threshold and enhancement level representation values are dynamically adjusted based on the sampled data and preset reference values, so that the processing process can be automatically optimized according to different signal conditions, thereby improving the adaptability and robustness of the algorithm in various environments.
[0067] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0068] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A waveform correction algorithm for AM demodulation, characterized in that: The following steps are involved: Perform envelope detection processing on the subcarrier received by the antenna; Perform low-pass filtering on the detected signal; The low-pass filtered signal is input into a comparator circuit for binary code conversion; In the case of signal distortion, data acquisition is performed on the signal through AD sampling to obtain AD sampling data, wherein the AD sampling data includes a plurality of AD sampling values of a plurality of level time periods; Perform data analysis on the AD sampling data to obtain the level threshold and the enhanced level representation value of each level period; Based on the level threshold, the AD sampling data is judged to be high or low level, and the level state of each period is determined according to the judgment result; The enhanced level representation value of each level period is compared and analyzed with the preset level reference value, and the distorted waveform is corrected according to the comparison result.
2. The AM demodulation waveform correction algorithm according to claim 1, characterized in that: When data is collected from a signal through AD sampling, data sampling is performed at fixed time intervals.
3. The AM demodulation waveform correction algorithm according to claim 1, characterized in that: The specific steps to obtain the level threshold are as follows: After VCD sends a read command to VICC, VICC starts to transmit data back. When VICC starts to send 8-bit SOF, MCU starts to sample RSSI signal and performs Kalman filtering on the sampled data to obtain the RSSI signal value of the current transmitted data frame. Before using the algorithm, the relationship between the RSSI value returned by the VICC at different distances in the same environment and the high and low level thresholds Q must be calibrated in advance, and the function of Q and RSSI is obtained through polynomial fitting; When using the algorithm, the MCU checks the RSSI value returned by the VICC in real time, determines the Q value of the current VICC, and obtains the binary data of the frame data.
4. The AM demodulation waveform correction algorithm according to claim 1, characterized in that: The specific steps for obtaining the enhanced level representation value of each level period are as follows: Compare and analyze each AD sampling value in each level period to obtain the maximum AD sampling value and the minimum AD sampling value in each level period; The maximum AD sampling value and the minimum AD sampling value of each level period are comprehensively analyzed to obtain the enhanced level representation value of each level period.
5. The AM demodulation waveform correction algorithm according to claim 4, characterized in that: The specific formula for calculating the enhanced level representation value of each level period is as follows: Among them, N j is the enhanced level representation value of the j-th level period, is the maximum value of AD sampling in the jth level period, is the minimum AD sampling value of the jth level period, and k is the proportional factor stored in the database.
Citation Information
Patent Citations
Receiving unit of vehicle communication system
CN101094208A
Device and method for comparing signals
CN102386897A
Digital signal demodulation method, consumable chip and consumable container
CN115309015A
System for automatically measuring modulation parameter of radio signal
CN116506035A
MEMS three-axis inertia switch based on ASIC threshold value capable of being regulated and controlled at will
CN117233423A