Amplitude shift keying signal decoding method and device
By combining a dynamic deburr remover and a windowed filter with bidirectional differential coding rules, amplitude shift keying (APS) signals are processed in stages, solving the decoding problem of APS signals in noisy and interference environments and improving the communication quality and security of the wireless charging system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI CANRUI MICROELECTRONICS CO LTD
- Filing Date
- 2026-01-08
- Publication Date
- 2026-05-12
AI Technical Summary
Existing amplitude shift keying signal decoding methods perform poorly in noisy and interference environments, leading to a decline in communication quality and affecting the safety and efficiency of wireless charging systems.
A method combining a dynamic de-glitcher and a windowed filter with bidirectional differential coding rules is used to process amplitude shift keying signals in stages. First, glitches are removed, then the level is identified by windowing filtering, and the level is corrected using a preamble pattern and bidirectional differential coding rules. Finally, the message is decoded.
It significantly improves the decoding success rate of amplitude shift keying signals in harsh environments, ensuring the communication quality and security of the wireless charging system.
Smart Images

Figure CN122027415A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wireless charging for small devices, specifically relating to a method and apparatus for decoding amplitude shift keying (APS) signals. The APS signal decoding method is used in the power transmitting device of a wireless charging system; that is, the source of the APS signal is the power receiving device in the wireless charging system. The APS signal can originate from various physical information accompanying the power transmission process, such as the coil voltage envelope, the coil current envelope, and the phase relationship between the coil voltage and the power switching signal. Background Technology
[0002] Early wireless charging systems only transmitted power and did not include communication between devices. Power was output from a power transmitter and received by a power receiver. Power transmission was wireless, typically using a sinusoidal signal with a specific frequency. Internally, the power transmitter usually used digital pulse width modulation (PWM) signals to control an analog half-bridge or full-bridge to regulate the output power. PWM signals regulated power in dimensions such as frequency, duty cycle, voltage, and phase. However, without communication, the power transmitter could not know how much power the power receiver received, whether there was significant power loss during wireless transmission, whether this power loss would translate into heat affecting the system's safety, or the acceptable power level for the power receiver itself. Therefore, introducing a communication mechanism into wireless charging devices is essential for improving system efficiency and safety.
[0003] To promote the standardization and safety of wireless charging, power supply equipment manufacturers have successively launched various wireless charging protocols, including the currently dominant Qi protocol. This protocol was introduced by the Wireless Power Consortium (WPC), established in 2008. Due to Apple's involvement and support, the protocol's iteration and evolution have accelerated significantly in recent years, making it the most mainstream wireless charging protocol. The Qi 2.2 protocol, released in 2025, has increased the charging power from 15W to 25W and imposed more stringent requirements on charging safety and power regulation accuracy.
[0004] The communication quality between the power transmitting and receiving devices is fundamental to ensuring the reliable execution of the aforementioned protocol. Communication occurs in two directions, such as... Figure 1As shown. One direction of communication is transmitted from the power transmitter and received by the power receiver, using Frequency Shift Keying (FSK). This direction of communication is used for the complex control handshake in the protocol. The other direction is transmitted from the power receiver and received by the power transmitter, using Amplitude Shift Keying (ASK). This direction of communication is the basic communication link of the wireless charging system. It contains information about the power receiver's power demand (the requirement to increase or decrease the power transmission) and the actual power measurement value obtained by the power receiver. If communication in this direction is not smooth, charging will stop within a few seconds.
[0005] ASK communication is crucial for wireless charging. Therefore, both the ASK transmitting side (power receiver) and the ASK receiving side (power transmitter) have multiple modulation and demodulation circuits that operate simultaneously or in a time-division manner to cope with complex wireless communication environments. Factors such as the charging coil, the remaining battery level of the device being charged, and the charging status (whether the screen is on for operation or in standby mode) all affect the ASK communication performance, thus requiring the selection of different modulation and demodulation methods.
[0006] On the transmitting side of ASK (Automatic Signal Transmission), two common methods are resistor modulation and capacitor modulation to interfere with the power transmitted by the power transmitter, thereby modulating the ASK waveform. On the receiving side of ASK, common demodulation methods include voltage demodulation, current demodulation, and phase demodulation. Furthermore, to ensure communication quality and prevent packet loss and errors, these demodulation methods are usually enabled simultaneously, and the successfully decrypted packet is then sent to the protocol layer.
[0007] On the ASK receiver side, i.e., the power transmitter side, multiple demodulation methods such as voltage demodulation, current demodulation, and phase demodulation are used in parallel. Regardless of the demodulation method used, a single-bit ASK signal is output. This ASK signal contains the communication message content, and its parsing is usually called "decoding," to distinguish it from "demodulation" in a physical sense. The relationship between the overall ASK demodulation link and power adjustment is as follows: Figure 2 As shown. Figure 2The diagram illustrates three demodulation links, employing voltage demodulation, current demodulation, and phase demodulation methods respectively (in practice, there may be more demodulation methods, such as multiple branching methods for voltage demodulation, which can be used in parallel) to obtain single-bit ASK signals. All three single-bit ASK signals are parsed into communication messages by the ASK decoder. However, due to different modulation environments, these three demodulation methods often result in two or one path being correctly decoded, while the others are decoded incorrectly. The message communication protocol includes verification methods to determine message correctness, such as checksums or CRC checks. A check selector verifies the three parsed communication messages, selecting the correctly decoded messages to send to the protocol layer. The protocol layer parses the communication messages. If the communication message is a power control message, the protocol layer uses power control and PWM generation circuitry to adjust the PWM frequency, duty cycle, phase, or adjust the voltage of the power transmitting coil to control the transmission power. Besides power control, ASK messages have other functions. Therefore, ensuring the correctness of the ASK communication link is crucial for wireless charging systems.
[0008] Therefore, currently, regarding Figure 2 The ASK decoder in the diagram needs improvement to obtain a new amplitude shift keying (ASK) signal decoding method and apparatus. The input of the ASK decoder is a single-bit ASK signal. Although multiple demodulation channels appear in the diagram, the differences in their physical characteristics and demodulation methods are reflected in the demodulation process. At the stage of outputting a single-bit ASK signal, the properties of each ASK signal are basically the same, and the criteria for judging correctness are also consistent. Therefore, multiple ASK decoders in the diagram can use the same ASK signal decoding method and apparatus.
[0009] Although there are various detailed approaches to the design of ASK decoders, the overall idea is the same: first, the pulse width of a single-bit ASK signal is extracted (using a high-speed counter), and then, according to the communication protocol, the values 0 and 1 are sequentially found from the pulse width information to form a communication message.
[0010] Ideally, parsing ASK messages is quite simple. According to the Qi protocol, the standard effective pulse width is 250µs. If the pulse width lasts for two standard pulse widths, i.e., 500µs, it is parsed as the value 0. If the pulse width consists of two different levels, each lasting 250µs, it is parsed as the value 1. ASK level transitions conform to the bidirectional differential coding principle; a level transition must occur between two values. Therefore, even with multiple consecutive values of 0, the same level will not last more than 500µs. The message design includes a preamble consisting of high and low levels, a start-of-byte level, and a stop-of-byte level to ensure message synchronization (bit alignment). A single-bit checksum is included within each byte, and a single-byte checksum is included at the end of the message to ensure message correctness. Considering timing inaccuracies, the protocol allows for a timing error of ±4% within the pulse width; therefore, pulse widths of 240~260µs can be considered effective, and 480~520µs can be recognized as the value 0. Considering potential interference and noise, the protocol also specifically stipulates that only pulse widths exceeding 150µs can be identified, which is equivalent to defining pulse widths below 150µs as glitches, and lowering the lower limit of the effective pulse width from 240µs to 150µs.
[0011] If designed simply according to the protocol, only a glitch removal circuit needs to be designed to eliminate all signal levels less than 150µs in the signal chain. Then, the numerical bits are identified one by one according to the pulse width recognition standard mentioned above, and the verification specified by the protocol is completed. Messages that pass the verification are sent to the protocol layer, and messages that fail are discarded.
[0012] However, the actual ASK communication process is subject to various distortions and interference from various physical environments, which can cause the ASK waveform to exhibit various situations not considered by the protocol. For example, Figure 3(a)-Figure 3(b) shows a distortion situation. Figure 3(a) is the normal waveform, containing two standard 250us levels; in the distorted Figure 3(b), the sum of the two levels is still 500us, but one level shrinks to 100us, while the other level expands to 400us. According to the protocol definition, the 100us level can be considered a glitch and can be removed. Therefore, the entire level will be incorrectly identified as a continuous 500us low level, i.e., a value of 0. One reason for this distortion is an unsuitable reference in the analog comparator. However, due to the complexity of the wireless charging environment, the reference needs to be frequently adaptively adjusted, which increases the complexity of the analog circuit design. Figures 4(a) and 4(b) illustrate another form of distortion. Figure 4(a) is still a normal waveform, still showing the value 1. Figure 4(b) is a distorted waveform, which produces a bulge in the middle of the original 250µs low level and lasts for 150µs. This should not be considered a glitch. Figure 4(b) may be considered an invalid waveform or a two-bit value, both of which are different from the original value 1.
[0013] Currently, there are several methods that have been attempted to solve the aforementioned ASK distortion problem.
[0014] One existing method addresses the issue of modulation clock skew, arguing that inaccurate level timing during modulation and demodulation can cause a standard pulse width of 250µs to shrink to 150µs or expand to 300µs, and that this shrinking or expanding pattern remains consistent within a single ASK message. Therefore, this method employs multiple ASK decoders, each retiming the standard pulse width by different lengths before attempting to decode it. This method incurs significant decoding costs; for example, if an ASK signal is retimed by four ASK decoders, the cost would be substantial. Figure 2 The three demodulation links shown would generate 12 ASK decoders. The logic cost of the check selector also increases exponentially. Furthermore, the distortion direction of the pulse width within a message is uncertain and will not maintain a consistent shrinking or expanding as this method envisions. Therefore, despite the significant cost, the decoding effect is unsatisfactory.
[0015] In other existing methods, designers attempt to address the problem from three angles: statistical interference glitches, duty cycle pre-training, and bidirectional differential coding rules (if the receiver detects that the levels of two consecutive bits have not flipped, the signal needs to be corrected).
[0016] Regarding the first perspective: statistical interference glitches. Typically, the width of the glitches is used as the criterion. Both narrow high-level and narrow low-level pulses are defined as glitches. The lengths of the high and low levels are counted within the standard pulse width range to determine whether the level is high or low. Some methods also include the number of glitches in the count; if the number of glitches exceeds a set threshold, the message is discarded. This method of judging ASK levels from a statistical perspective can solve the problem of ASK signal interference to some extent. However, it does not precisely define the scope and details of its application from the perspective of the Qi protocol.
[0017] The second approach involves duty cycle pre-training. This method attempts to estimate the duty cycle of subsequent bits in the message using the duty cycle of a few bits provided by the ASK preamble. This aims to address duty cycle issues such as those shown in Figure 3. However, this method ignores the randomness of ASK signal fluctuations and assumes that the preamble duty cycle is not necessarily correlated with the duty cycle of subsequent messages.
[0018] The third perspective concerns bidirectional differential coding rules. Since ASK's level conversion itself adheres to this rule, using it to assist decoding can correct some easily identifiable interference, as shown in the example in Figure 4(b). However, this method may also allow erroneous messages to pass various checks, thus allowing them to flow into the protocol layer and causing wider procedural errors. Therefore, its application needs to be controlled. Summary of the Invention
[0019] The purpose of this invention is to provide an amplitude shift keying (ASK) signal decoding method and apparatus to eliminate the adverse effects of noise and interference frequently encountered during ASK decoding on the ASK decoding effect, and to significantly improve the success rate of ASK decoding.
[0020] To achieve the above objectives, the present invention provides a method for decoding amplitude shift keying signals, comprising: S1: when no preamble is detected, a dynamic de-glitcher is turned on to de-glitch the amplitude shift keying signal, and then a windowed filter is used to detect the preamble of the amplitude shift keying signal;
[0021] S2: Before detecting the preamble or the first byte, stop de-glitching and instead use a windowed filter to identify the level of each observation window, obtain the corrected amplitude shift keying signal, and detect the first byte of the amplitude shift keying signal;
[0022] S3: After detecting the first byte, a windowed filter is used to identify the level of each observation window. Then, the level of each observation window is corrected using bidirectional differential coding rules to obtain the corrected amplitude shift keying signal.
[0023] S4: Use a message parser to decode the corrected amplitude shift keying signal to obtain the amplitude shift keying message.
[0024] The windowed filter continuously detects the preamble of the amplitude shift keying (APS) signal based on the preamble characteristics of the APS signal. The preamble characteristics of the APS signal include the length of a preset bit period. The continuous detection of the APS signal preamble based on the preset bit period length specifically includes: detecting the duration of two rising edges or two falling edges of the signal as the actual bit period length, and comparing it with the preset bit period length. If the difference between the two is less than a threshold, the preamble of the APS signal is detected.
[0025] In step S2, after the windowed filter detects the preamble, the windowed filter feeds back a control signal to the dynamic de-scratcher, causing the dynamic de-scratcher to be in a closed state. In the closed state, the dynamic de-scratcher stops de-scratching and applies the same delay to the signal as during de-scratching.
[0026] The level of each observation window is identified by using a windowed filter. Specifically, this involves using an effective pulse width to generate each observation window on the amplitude shift keying signal and identifying the level of each observation window.
[0027] The effective pulse width is obtained manually, either by acquiring the length of the bit period while detecting the preamble of the amplitude shift keying signal and using half of it as the effective pulse width, or by acquiring the average length of the bit periods of multiple consecutive preambles and using half of it as the effective pulse width; and / or by identifying the level of the observation window according to the statistical results of the duration of the level within the observation window; and / or by using the effective pulse width to generate each observation window, specifically including: taking the end point of the detected preamble bit period as the starting point of the first observation window, and generating an observation window with a width of the effective pulse width based on this starting point; finding the level change edge near the end point of each observation window, determining the starting point of a new observation window based on the level change edge, and generating an observation window with a width of the effective pulse width based on this starting point; and / or, after performing windowing filtering to identify the level of each observation window, further including: using the preamble pattern to judge and correct the level of each observation window.
[0028] The process involves finding a level change edge near the end of each observation window and determining the starting point of a new observation window based on this edge. Specifically, this includes: searching for a level change edge within a fixed-size range centered on the end of the observation window; if found, using it as the starting point of the new observation window; otherwise, finding the level change edge closest to the end of the observation window outside the specified range and using the boundary of the specified range in the direction of this level change edge as the starting point of the new observation window.
[0029] The bidirectional differential coding rule is used to correct the level of each bit. Specifically, this includes: using windowing filtering to identify the level of each observation window, and determining the starting point of the first byte based on the identification result; determining the bit boundary from the boundary of the observation window based on the starting point of the first byte; observing the levels of two consecutive observation windows separated by the boundary of each bit and determining whether the levels are opposite; if they are opposite, no correction is needed; otherwise, a decision is made to modify the level.
[0030] The decision to modify the level specifically includes: when both levels are high, comparing the duration of the high level and selecting the level with the longer duration as the high level and the other level as the low level; conversely, if both levels are low, comparing the duration of the low level and selecting the level with the longer duration as the low level and the other level as the high level.
[0031] Alternatively, a decision can be made to modify the level, specifically including: based on a pre-configured level inversion threshold duration; when both levels are high, compare the duration of the high level in the two levels; if the high level duration of one level is longer than the level inversion threshold duration and the high level duration of the other level is shorter than the level inversion threshold duration, then the level with a high level duration longer than the level inversion threshold duration is designated as high and the other level as low; conversely, if both levels are low, compare the duration of the low level in the two levels; if the low level duration of one level is longer than the level inversion threshold duration and the low level duration of the other level is shorter than the level inversion threshold duration, then the level with a low level duration longer than the level inversion threshold duration is designated as high and the other level as high.
[0032] The corrected amplitude shift keying signal is decoded using a message parser, specifically including: pulse width acquisition, preamble reprobe, and re-identification of the start point of the first byte; subsequently, bit decoding, byte decoding and verification, and message protocol decoding and verification are performed.
[0033] When the windowing filter detects the start of the first byte, it notifies the message parser; when the message parser finishes unpacking, it notifies the windowing filter and the dynamic de-scratcher to restore them to their initial state and stop windowing filtering.
[0034] On the other hand, the present invention provides an amplitude shift keying signal decoding device, comprising:
[0035] The dynamic deburr is configured to: be in the on state to deburr the amplitude shift keying signal when no leader is detected; and be in the off state to stop deburring after a leader is detected.
[0036] A windowed filter is configured as follows: when no preamble is detected, the preamble of the amplitude shift keying (APS) signal is detected from the glitch-free APS signal; from the detection of the preamble until the detection of the first byte, windowing filtering is performed to identify the level of each observation window, obtaining the corrected APS signal, and the first byte of the APS signal is detected; after the detection of the first byte, the level of each observation window is identified, and then the level of each observation window is corrected using bidirectional differential coding rules, obtaining the corrected APS signal; and
[0037] The message parser is configured to decode the corrected amplitude shift keying signal to obtain the amplitude shift keying message.
[0038] The amplitude shift keying (ASK) signal decoding method and apparatus of the present invention make full use of the Qi protocol, divide an ASK message into three stages according to the difficulty of error correction, and adopt different decoding methods in different decoding stages to correct and decode ASK signals that are severely interfered with and distorted, thereby eliminating the adverse effects of noise and interference often encountered in the ASK decoding process on the ASK decoding effect and greatly improving the decoding success rate of ASK signals in harsh environments. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the power and communication message transmission direction in the existing Qi wireless charging system;
[0040] Figure 2 This is a block diagram of the demodulation link of the ASK signal, the transmit power control circuit, and the PWM generation circuit in an existing power transmitter.
[0041] Figures 3(a) and 3(b) are waveform diagrams of a typical case of ASK signal distortion, where Figure 3(a) shows the normal waveform and Figure 3(b) shows the distorted waveform.
[0042] Figure 4(a) and Figure 4(b) are waveform diagrams of another typical case of ASK signal distortion, where Figure 4(a) shows the normal waveform and Figure 4(b) shows the distorted waveform.
[0043] Figure 5 This is a structural diagram of the amplitude shift keying signal decoding device of the present invention;
[0044] Figure 6 This is a waveform diagram illustrating the difficulty in judging the level within the observation window caused by periodic abrupt changes;
[0045] Figure 7 This is a schematic diagram illustrating the principle of adaptive adjustment of the observation window starting point used in windowed filtering;
[0046] Figure 8 This is a schematic diagram of the three stages of the amplitude shift keying signal decoding method of the present invention;
[0047] Figures 9(a) and 9(b) are schematic diagrams of signal waveforms for the step pattern;
[0048] Figures 10(a) and 10(b) are schematic diagrams of the signal waveforms of the hole-digging pattern;
[0049] Figure 11 This is a schematic diagram of the levels of two consecutive observation windows separated by the boundary of each bit;
[0050] Figure 12 This is a flowchart of the message parser's processing. Detailed Implementation
[0051] This invention provides a method and apparatus for decoding amplitude shift keying (APS) signals. This APS signal decoding method and apparatus are used in the power transmitting equipment of a wireless charging system. That is, the source of the APS signal is the power receiving equipment in the wireless charging system, especially small devices. Here, small devices refer to portable devices with wireless charging capabilities such as smartphones, smartwatches, smart bracelets, electronic pens, heated teacups, and wireless mice, as well as non-portable electronic devices such as robots with wireless charging capabilities. The APS signal can originate from various physical information accompanying the power transmission process, such as the coil voltage envelope, coil current envelope, and the phase relationship between the coil voltage and the power switching signal.
[0052] This invention addresses the communication quality issues arising from the high volume of communication demands during wireless charging. The initial aim is to improve communication quality, avoiding or reducing phenomena such as charging interruptions and reduced power charging caused by poor communication quality, and preventing dangerous accidents caused by excessively high power charging. Unlike existing technologies, the amplitude shift keying (ASK) signal decoding method and apparatus of this invention fully utilize the Qi protocol, dividing an ASK message into three stages based on the difficulty of error correction. Different decoding methods are employed at each stage to correct and decode ASK signals that are severely interfered with and distorted. This eliminates the adverse effects of noise and interference frequently encountered during ASK decoding, significantly improving the decoding success rate of ASK signals in harsh environments.
[0053] like Figure 5 and Figure 8 As shown, the amplitude shift keying (ASK) signal decoding method of the present invention is used to process single-bit amplitude shift keying (ASK) signals, and includes:
[0054] Step S1: When no leader is detected, the dynamic de-glitcher 10 is turned on to de-glitch the amplitude shift keying signal, and then the windowed filter 20 is used to detect the leader of the amplitude shift keying signal.
[0055] The first stage is the preamble detection stage, from the background signal without a message to the detection of the preamble. During this stage, since the system is unaware of the arrival of an ASK signal, the windowing filter is not activated for error correction. This stage corresponds to feature 2 mentioned above. In this stage, external interference will manifest as glitches on the ASK signal, and interference elimination relies entirely on the dynamic de-glitcher 10. Duty cycle distortion is ignored, while periodic distortion may delay detection results or even lead to missed detections.
[0056] like Figure 5As shown, the single-bit ASK signal first enters the dynamic de-glitcher 10. The dynamic de-glitcher 10 is not a typical de-glitch circuit; its difference from existing technologies lies in its dynamic nature. "Dynamic" means it can switch between on and off states, automatically determining whether to turn on to remove glitches based on the signal analysis from the windowed filter 20. Furthermore, when off, the dynamic de-glitcher 10 applies the same delay to the signal as during de-glitching. This ensures that the waveform of the ASK signal is continuous before and after glitches, without significant intermediate transitions due to switching, thus preventing interference with subsequent decoding circuitry.
[0057] In step S1, if the windowed filter 20 does not detect the ASK preamble, it indicates that the current input signal has no message. To assist subsequent modules in resolving the possible ASK preamble from the interference, the dynamic de-glitcher 10 is enabled to perform single-bit de-glitching. The user can modify the definition of the glitch width through configuration.
[0058] The windowed filter 20 continuously detects the preamble of the ASK signal based on its preamble characteristics (such as the preset bit period length). Specifically, this preamble detection based on the preset bit period length includes: measuring the duration of two rising edges or two falling edges of the signal as the actual bit period length, and comparing this length with the preset bit period length. If the difference is less than a threshold, the preamble of the ASK signal is detected.
[0059] In the process of detecting ASK signals in this invention, the preamble of the ASK signal is continuously detected based solely on the preset bit period length, while the duty cycle factor is ignored (i.e., it is not necessary to confirm whether the widths of the pulse widths A formed by a rising edge and a falling edge, and B formed by a falling edge and a rising edge, are valid). This is because in distorted environments, the duty cycle of the ASK signal cannot be guaranteed, but the total bit length can be basically guaranteed.
[0060] To avoid interference that could lead to missed detection of the preamble, the ASK signal is de-glitched before being fed into the windowed filter 20 during the preamble detection phase.
[0061] Step S2: Before detecting the preamble to the first byte, stop de-glitching and instead use windowed filter 20 to perform windowed filtering to identify the level of each observation window, obtain the corrected amplitude shift keying signal, and detect the first byte of the amplitude shift keying signal;
[0062] The second stage is the windowing filtering stage from the detection of the preamble to the detection of the first byte (i.e., the packet header). This stage is characterized by the ability to use windowing filtering and preamble patterns, but apart from filtering methods, it's impossible to apply bidirectional differential coding rules for more thorough correction of the signal level. This is because the bit boundaries are not yet determined; the level of the first bit in the packet header could be high or low. The bidirectional differential coding rule requires a level inversion at bit boundaries; without determining the bit boundaries, a necessary inversion cannot be required.
[0063] In step S2, after the windowed filter 20 detects the preamble of the amplitude shift keying signal, it feeds back a control signal to the dynamic descrambler 10, causing the dynamic descrambler 10 to be in a closed state. In the closed state, the dynamic descrambler 10 stops descrambling and applies the same delay to the signal as during descrambling. The reason for stopping descrambling is that the windowed filter 20 requires descrambling information during filtering; without this information, the filtering effect is poor.
[0064] In step S2, the level of each observation window is identified by windowing filter 20. Specifically, this includes generating each observation window using an effective pulse width on the ASK signal (which is distorted and interfered with), and identifying the level of each observation window.
[0065] The effective pulse width can be manually set, with a typical value of 250µs; alternatively, it can be obtained by simultaneously detecting the preamble of the amplitude shift keying signal in step S1 and using half of that length as the effective pulse width; or it can be obtained by averaging the lengths of multiple consecutive preamble bit periods and using half of that length as the effective pulse width. Obtaining the effective pulse width simultaneously detecting the preamble of the amplitude shift keying signal in step S1 means that, during the preamble detection phase, the preamble is identified using a preset bit period length, and simultaneously, the actual bit period length is obtained, with half of that length used as the effective pulse width. Obtaining the effective pulse width by averaging the lengths of multiple consecutive preamble bit periods means observing multiple preambles, averaging the lengths of their bit periods to obtain a robust bit period length, and using half of that length as the effective pulse width, thus making the calculated effective pulse width more adaptable.
[0066] Within the observation window, level transitions are affected by a triple factor: glitches, severe interference, and duty cycle distortion. Therefore, one of the key features of windowed filtering in this invention is: ignoring the distinctions between concepts such as glitches, interference, duty cycle, period, and normal level, and identifying the observation window's level based on the statistical results of the duration of the level within the observation window. That is, if the high-level time within the observation window is longer than the low-level time, the observation window's level is tentatively considered high; conversely, if the high-level time is shorter than the low-level time, the observation window's level is tentatively considered low.
[0067] The second key feature of windowed filtering is the determination of the window boundaries.
[0068] In existing technology, for a fixed-length observation window, once the start position of the signal is determined (which can be determined by the leading boundary), the position of the observation window is also determined. However, with such boundary determination, for signals with periodic abrupt changes, each signal within the window will be distorted, leading to difficulties in distinguishing between high and low levels. For example... Figure 6 As shown, in the prior art, when a window is applied to a segment of ASK signal, the period of the ASK signal suddenly becomes longer within the 3rd to 5th window. Subsequently, although the period and duty cycle of the signal return to normal, the sudden increase in the intermediate period leads to continuous ambiguity in judgment, which cannot be resolved even if the waveform is restored.
[0069] For the reasons mentioned above, a more flexible method must be used to determine the window boundaries of the observation windows. The effective pulse width is used to generate each observation window, specifically including: using the end of the detected preamble bit period as the starting point of the first observation window, and generating an observation window with a width equal to the effective pulse width based on this starting point; finding a level change edge near the end of each observation window, determining the starting point of a new observation window based on this edge, and generating an observation window with a width equal to the effective pulse width based on this starting point.
[0070] like Figure 7 As shown, a level change edge is searched near the end of each observation window, and the starting point of a new observation window is determined based on the level change edge. Specifically, this involves: searching for a level change edge within a fixed-size range centered on the end of the observation window; if found, it is taken as the starting point of the new observation window; otherwise, the level change edge closest to the end of the observation window is found outside the specified range, and the boundary of the specified range in the direction of the level change edge is taken as the starting point of the new observation window.
[0071] In other words, the transition edge near the end of the observation window can be searched forward or backward relative to the end of the observation window, and the search range is limited. If there is a transition edge in front of the end of the observation window within the specified range, the starting point of the new observation window moves forward to the transition edge. If there is a transition edge behind the end of the observation window within the specified range, the new window moves backward to the transition edge. If there is no transition edge within a fixed-size specified range centered on the end of the observation window, then the nearest transition edge to the end of the observation window is searched outside the specified range. If the nearest transition edge is in front but has exceeded the range, the starting point of the new observation window will also move forward, but not to the transition edge; it will only move to the specified range as the starting point. The same process is applied if the nearest transition edge is behind. This gives windowed filtering the ability to adapt to periodic changes. Figure 7 In the middle, the waveform of the ASK signal is the same as Figure 6 The distortion consistently occurs in the middle, with periodic changes. However, by using the observation window generation method of this invention, the starting position of the fourth observation window is shifted to the right at the level transition point, thus offsetting the windowing effect of this distortion on subsequent waveforms. In actual ASK signal communication environments, sudden changes in period length are very common. Although a longer period within the message will be corrected by a sudden shorter period after a few bits, ensuring the overall length conforms to the protocol's specified duration, it can still cause serious level judgment errors locally. The windowing filtering of this invention can effectively solve this problem.
[0072] After performing windowing filtering to identify the level of each observation window, the method further includes using a preamble pattern to judge and correct the level of each observation window.
[0073] The preamble pattern is only applied to the second stage to compensate for the inability to use bidirectional differential coding rules. As mentioned above, the level of the observation window obtained from the statistical results of the duration of the level inside the observation window can only be used as a provisional result. Subsequently, the preamble pattern is needed to judge and correct the level of each observation window in order to obtain the final level of each observation window.
[0074] In this embodiment, the leading pattern includes a step pattern and a hole pattern. The leading pattern is used to judge and correct the level of each observation window. Specifically, when a step pattern appears in the observation window, if the duration of the subsequent level exceeds a preset proportional coefficient (although it is less than half), the level of the observation window is judged as the subsequent level. When a hole pattern appears in the observation window, if the width of the middle part exceeds a preset proportional coefficient, the level of the observation window is judged as the level of the middle part.
[0075] Figures 9(a) and 9(b) show signal waveform diagrams with step patterns. Two level steps are presented within the observation window represented by the dashed line. Figure 9(a) shows a step pattern with a low-to-high gradient, while Figure 9(b) shows a step pattern with a high-to-low gradient. In Figure 9(a), the proportion of low level is higher than that of high level. Statistically, the entire observation window should be judged as low level. However, if the high level also occupies a high proportion (e.g., exceeding the user-preset proportion coefficient), and if... Figure 1 If a step pattern is presented, the entire observation window will be judged as high level. The situation in Figure 9(b) is the opposite of that in Figure 9(a). According to the step pattern principle, as long as the proportion of low level exceeds the set proportion, even if the low level does not dominate in the observation window, the entire observation window will be judged as low level.
[0076] Figures 10(a) and 10(b) show schematic diagrams of signal waveforms with a "dip" pattern. Within the observation window represented by the dashed line, a dip-shaped voltage level (i.e., a level that is high then low and then high again) or a convex voltage level (i.e., a level that is low then high and then low again) is presented. In Figure 10(a), the proportion of high voltage levels is higher than low voltage levels. Statistically, the entire observation window should be judged as high voltage. However, if the width of the middle portion (i.e., the low voltage level) exceeds a preset proportional coefficient, the entire observation window's voltage level will be judged as low voltage. Similarly, if the condition is met, the entire observation window in Figure 10(b) will be judged as high voltage.
[0077] The two preamble patterns described above are merely examples. In other embodiments, the type of preamble pattern can be added or removed based on the actual problem waveform to compensate for the limitations of windowed statistics and improve the success rate of decoding in the second stage. Furthermore, in other embodiments, the preamble pattern can also be applied to the decoding in the third part. In step S3 below, after using windowed filtering to identify the level of each observation window, the preamble pattern is further used to judge and correct the level of each observation window. Whether or not this strategy is applied depends primarily on the decoding effect.
[0078] Step S3: After detecting the first byte, windowing filter 20 is used to identify the level of each observation window. Then, bidirectional differential coding rules are used to correct the level of each observation window to obtain the corrected amplitude shift keying signal.
[0079] The third stage, from the beginning of the first byte to the end of the last byte, can use a combination of windowing filtering and bidirectional differential coding rules to identify the level of each bit, thereby further enhancing the correction of the signal.
[0080] The step of using windowed filtering to identify the level of each observation window is consistent with the specific steps in step S2 above.
[0081] The definition of bidirectional differential coding is that in a single-bit serially transmitted signal, a level flip must occur between adjacent bits. Therefore, given the bit boundary, it's possible to observe whether a flip has occurred. If not, it indicates a level flip error, and the level before or after the bit boundary must need correction. Figure 8 The third stage, as shown, allows us to find the bit boundaries based on the starting point of the first byte, thus enabling the use of bidirectional differential coding rules. Applying this condition can provide strong error correction, meaning even completely distorted levels can be corrected, but it also introduces certain error correction risks.
[0082] The bidirectional differential coding rule is used to correct the level of each bit. Specifically, this includes: using windowing filtering to identify the level of each observation window, and determining the starting point of the first byte based on the identification result; determining the bit boundary from the boundary of the observation window based on the starting point of the first byte; observing the levels of two consecutive observation windows separated by the boundary of each bit and determining whether the levels are opposite; if they are opposite, no correction is needed; otherwise, a decision is made to modify the level.
[0083] like Figure 11 As shown, the levels of two consecutive observation windows separated by the boundary of each bit are observed. That is, the dashed line b between the levels of the two consecutive observation windows is the boundary of the bit. If the levels of the two observation windows are opposite, no level correction is required; if they are not opposite, a decision is made on whether to modify the level: modify level A or modify level B.
[0084] To minimize error correction and accurately reproduce the true ASK shape, in one embodiment, a decision is made regarding the modification level. Specifically, this includes: the levels of a continuous observation window include a first level A and a second level B. When both levels are high, the duration of the high level is compared, and the level with the longer high-level duration is selected as the high level, while the other level is designated as the low level. Conversely, if both levels are low, the duration of the low level is compared, and the level with the longer low-level duration is selected as the low level, while the other level is designated as the high level. For example, if both levels are high, and the second level B has a longer duration, it indicates that the second level B is more like a high level than the first level A.
[0085] Bidirectional differential coding rules have strong error correction capabilities, but improper use can also lead to misjudgment of signal levels. Misjudgment may cause greater systemic risks because the error detection mechanisms such as byte checksums and checksums in the Qi protocol are relatively weak, and there is a certain probability that misjudged messages will pass through multiple checksums and enter the protocol layer.
[0086] To prevent misjudgment of levels by the bidirectional differential coding rules, in another embodiment, a decision to modify the level is made. Specifically, this includes: based on a pre-configured level inversion threshold duration; the levels in a continuous observation window include a first level A and a second level B. When both levels are high, the duration of the high level is compared. If the high-level duration of one level is longer than the level inversion threshold duration and the high-level duration of the other level is shorter than the level inversion threshold duration, then the level with the higher high-level duration is considered high, and the other level is considered low. Conversely, if both levels are low, the duration of the low level is compared. If the low-level duration of one level is longer than the level inversion threshold duration and the low-level duration of the other level is shorter than the level inversion threshold duration, then the level with the higher low-level duration is considered high, and the other level is considered high. This achieves a more stringent decision.
[0087] In other words, even if the voltage level lengths are compared, it doesn't necessarily mean a voltage level transition will occur. A transition only happens when the voltage level duration reaches or exceeds the user-defined voltage level transition threshold, while the shorter voltage level duration fails to reach the threshold. Compared to the decision-making method of directly transitioning after comparing voltage level lengths, the enhanced strategy handles voltage level transitions more cautiously. Figure 11 For example, when the second level B is high (and the first level A is also high), the duration of the high level is compared. If the high level duration of the second level B is longer, it means that the second level B is more like a high level than the first level A. After making this judgment, the first level A is not immediately changed to low. Instead, it is checked whether the high level duration of the second level B exceeds the length required by the user. For example, if the high level duration of the second level B is 200us, and the user-set level transition threshold duration is 210us, then the condition for the first level A to go low is not met. If the high level duration of the second level B is 220us (meeting the user setting), but the high level duration of the first level A is 215us (also meeting the user setting), then the condition for the first level A to go low is still not met. Only when the high level duration of B is 220us (meeting the user setting), and the high level duration of the first level A is 200us (not meeting the user setting), will the decision to flip the first level A to low be made.
[0088] Following the strict processing method described above, some cases where the voltage levels at both ends of a bit boundary are the same will inevitably remain. When these are passed to the message parser, they will fail to resolve the message and will report an error. This is permissible and necessary. Because ASK signals that still exhibit this pattern after error correction have low reliability, discarding them ensures the safety of the charging system.
[0089] Step S4: Use message parser 30 to decode the corrected amplitude shift keying signal to obtain the amplitude shift keying message.
[0090] After the amplitude shift keying signal (ASK signal) is windowed and filtered in step S2 or S3, it still appears as a single-bit ASK signal, but its distortion has been corrected, and the length of each level is the effective window length.
[0091] The corrected amplitude shift keying (APS) signal is decoded using message parser 30, specifically including: pulse width acquisition, preamble reprobe, and re-identification of the start point of the first byte (i.e., the message start point); subsequently, according to Qi protocol requirements, bit decoding, byte decoding and verification, and message protocol decoding and verification are performed. The decoding process of the corrected APS signal is as follows: Figure 12 As shown.
[0092] Bit decoding is performed in a normal manner, which specifically includes: in the bit decoder, the user presets the pulse width, and the bit is identified according to the user-set pulse width to obtain the bit stream; if an undeterminable bit is encountered (such as a pulse width that is too long or too short, or a bit boundary level that does not flip), instead of correcting and flipping the waveform like the window filter 20, it is directly determined to be an error, and the unpacking ends. The window filter 20 and the dynamic de-scratcher 10 are notified to restore their initial state, thereby providing a good initial environment for the next ASK message.
[0093] Undeterminable pulse widths include: the level of the bit boundary stops flipping after a frame is decoded; the level of the bit boundary does not flip due to a packet error; and the level of the bit boundary does not flip due to a preamble error.
[0094] Byte decoding and verification include: the byte decoder obtains the bit stream from the bit decoder, distinguishing the start bit, byte content bit, parity bit, and byte end bit of each byte; then, it performs verification using the parity bit, and after verification, pushes the byte to the message protocol decoder. Furthermore, if the verification fails, unpacking ends, notifying the windowing filter 20 and the dynamic de-scratcher 10 to restore them to their initial state.
[0095] The message protocol decoding and verification process includes: the message protocol decoder obtains bytes from the byte decoder, and according to the Qi protocol order, distinguishes the bytes into header bytes, packet body byte string, and checksum bytes, using the checksum bytes for verification; if the verification passes, the header bytes and packet body byte string are sent as a message to the upper-layer charging protocol for further processing. The packet body byte string contains several bytes, the length of which is included in the header and obtained by the message protocol decoder parsing the header. Furthermore, if the verification fails, unpacking ends, and the windowing filter 20 and the dynamic de-scratcher 10 are notified to return to their initial state.
[0096] As mentioned above, both windowing filter 20 and message parser 30 perform ASK signal preamble identification and the start point of the first byte (i.e., the message start point). Due to different settings, it is possible that one of the two windowing filters 20 and message parser 30 detects the preamble and the start point of the first byte while the other does not, or the detection positions are inconsistent. In this case, it is necessary to synchronize the detection results.
[0097] In this embodiment, when the windowing filter 20 identifies the start of the first byte, it notifies the message parser 30; when the message parser 30 finishes unpacking, it notifies the windowing filter 20 and the dynamic de-scratcher 10 to restore them to their initial state and stop windowing filtering.
[0098] After identifying the start of the first byte, message parser 30 checks whether windowing filter 20 has also identified the start of the first byte. If not, message parser 30 considers it undetected and continues processing noise. Conversely, if windowing filter 20 identifies the start of the first byte, but message parser 30 does not, unpacking ends, and windowing filter 20 and dynamic deburr 10 are notified to return to their initial state.
[0099] On the other hand, such as Figure 5 As shown, the present invention provides an amplitude shift keying signal decoding device, which includes a dynamic de-scratcher 10, a windowed filter 20 and a message parser 30 connected in sequence.
[0100] The dynamic deburr 10 is switchable between an on state and an off state. The dynamic deburr 10 is configured to: be in the on state to deburr the amplitude shift keying signal when no leader is detected; and be in the off state to stop deburring after a leader is detected.
[0101] The windowed filter 20 is configured as follows: when no preamble is detected, the preamble of the amplitude shift keying signal is detected from the de-glitched amplitude shift keying signal; from the detection of the preamble to the detection of the first byte, windowed filtering is performed to identify the level of each observation window to obtain the corrected amplitude shift keying signal, and the first byte of the amplitude shift keying signal is detected; after the first byte is detected, the level of each observation window is identified, and then the level of each observation window is corrected using bidirectional differential coding rules to obtain the corrected amplitude shift keying signal.
[0102] The process includes, after performing windowing filtering to identify the level of each observation window, further using a preamble pattern to judge and correct the level of each observation window.
[0103] The message parser 30 is configured to decode the corrected amplitude shift keying signal to obtain the amplitude shift keying message.
[0104] The specific implementation steps of the dynamic deburr remover 10, windowed filter 20, and message parser 30 are consistent with the corresponding steps in the amplitude shift keying signal decoding method described above.
[0105] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of the invention. Various variations can be made to the above embodiments of the present invention. All simple and equivalent changes and modifications made in accordance with the claims and description of this application fall within the protection scope of the claims of this patent. All aspects not described in detail in this invention are conventional technical content.
Claims
1. A method for decoding amplitude shift keying signals, characterized in that, include: Step S1: When no leader is detected, the dynamic de-glitcher is turned on to de-glitch the amplitude shift keying signal, and then the leader of the amplitude shift keying signal is detected using a windowed filter. Step S2: Before detecting the preamble or the first byte, stop de-glitching and instead use a windowed filter to identify the level of each observation window, obtain the corrected amplitude shift keying signal, and detect the first byte of the amplitude shift keying signal; Step S3: After detecting the first byte, a windowed filter is used to identify the level of each observation window. Then, the level of each observation window is corrected using bidirectional differential coding rules to obtain the corrected amplitude shift keying signal. Step S4: Use a message parser to decode the corrected amplitude shift keying signal to obtain the amplitude shift keying message.
2. The amplitude shift keying signal decoding method according to claim 1, characterized in that, The windowed filter continuously detects the preamble of the amplitude shift keying signal based on the preamble characteristics of the amplitude shift keying signal; The preamble feature of the amplitude shift keying signal includes a preset bit period length. The preamble of the amplitude shift keying signal is continuously detected based on the preset bit period length. Specifically, the detection includes the duration of two rising edges or two falling edges of the signal as the actual bit period length, which is compared with the preset bit period length. If the difference between the two is less than a threshold, the preamble of the amplitude shift keying signal is detected.
3. The amplitude shift keying signal decoding method according to claim 1, characterized in that, In step S2, after the windowed filter detects the preamble, the windowed filter feeds back a control signal to the dynamic de-scratcher, causing the dynamic de-scratcher to be in a closed state. In the closed state, the dynamic de-scratcher stops de-scratching and applies the same delay to the signal as during de-scratching.
4. The amplitude shift keying signal decoding method according to claim 1, characterized in that, The level of each observation window is identified by using a windowed filter. Specifically, this involves using an effective pulse width to generate each observation window on the amplitude shift keying signal and identifying the level of each observation window.
5. The amplitude shift keying signal decoding method according to claim 4, characterized in that, The effective pulse width is obtained manually, either by acquiring the length of the bit period while detecting the preamble of the amplitude shift keying signal and using half of it as the effective pulse width, or by acquiring the average length of the bit periods of multiple consecutive preambles and using half of that average as the effective pulse width; and / or The voltage level of the observation window is identified by statistical results of the duration of the voltage level inside the observation window; and / or The effective pulse width is used to generate each observation window, specifically including: taking the end point of the detected preamble bit period as the starting point of the first observation window, and generating an observation window with a width equal to the effective pulse width based on this starting point; finding a level change edge near the end point of each observation window, determining the starting point of a new observation window based on this level change edge, and generating an observation window with a width equal to the effective pulse width based on this starting point; and / or After performing windowing filtering to identify the level of each observation window, the method further includes using a preamble pattern to judge and correct the level of each observation window.
6. The amplitude shift keying signal decoding method according to claim 5, characterized in that, The process involves finding a level change edge near the end of each observation window and determining the starting point of a new observation window based on this edge. Specifically, this includes: searching for a level change edge within a fixed-size range centered on the end of the observation window; if found, using it as the starting point of the new observation window; otherwise, finding the level change edge closest to the end of the observation window outside the specified range and using the boundary of the specified range in the direction of this level change edge as the starting point of the new observation window.
7. The amplitude shift keying signal decoding method according to claim 1, characterized in that, The bidirectional differential coding rule is used to correct the level of each bit. Specifically, this includes: using windowing filtering to identify the level of each observation window, and determining the starting point of the first byte based on the identification result; determining the bit boundary from the boundary of the observation window based on the starting point of the first byte; observing the levels of two consecutive observation windows separated by the boundary of each bit and determining whether the levels are opposite; if they are opposite, no correction is needed; otherwise, a decision is made to modify the level.
8. The amplitude shift keying signal decoding method according to claim 7, characterized in that, The decision to modify the level specifically includes: when both levels are high, comparing the duration of the high level and selecting the level with the longer duration as the high level and the other level as the low level; conversely, if both levels are low, comparing the duration of the low level and selecting the level with the longer duration as the low level and the other level as the high level. Alternatively, a decision can be made to modify the level, specifically including: based on a pre-configured level inversion threshold duration; when both levels are high, compare the duration of the high level in the two levels; if the high level duration of one level is longer than the level inversion threshold duration and the high level duration of the other level is shorter than the level inversion threshold duration, then the level with a high level duration longer than the level inversion threshold duration is designated as high and the other level as low; conversely, if both levels are low, compare the duration of the low level in the two levels; if the low level duration of one level is longer than the level inversion threshold duration and the low level duration of the other level is shorter than the level inversion threshold duration, then the level with a low level duration longer than the level inversion threshold duration is designated as high and the other level as high.
9. The amplitude shift keying signal decoding method according to claim 1, characterized in that, The corrected amplitude shift keying signal is decoded using a message parser, specifically including: pulse width acquisition, preamble reprobe, and re-identification of the start point of the first byte; subsequently, bit decoding, byte decoding and verification, and message protocol decoding and verification are performed. When the windowing filter detects the start of the first byte, it notifies the message parser; when the message parser finishes unpacking, it notifies the windowing filter and the dynamic de-scratcher to restore them to their initial state and stop windowing filtering.
10. An amplitude shift keying signal decoding device, characterized in that, include: The dynamic deburr is configured to be in the on state when no leader is detected in order to deburr the amplitude shift keying signal. Upon detecting the leader, it enters the off state to stop deburring; A windowed filter is configured to detect the prelead of the amplitude shift keying signal from the denoised amplitude shift keying signal when no prelead is detected. Before the first byte is detected, windowing filtering is performed to identify the level of each observation window, resulting in the corrected amplitude shift keying signal, and the first byte of the amplitude shift keying signal is detected. After detecting the first byte, the level of each observation window is identified, and then the level of each observation window is corrected using bidirectional differential coding rules to obtain the corrected amplitude shift keying signal; and The message parser is configured to decode the corrected amplitude shift keying signal to obtain the amplitude shift keying message.