FM0 decoding method for identifying V code based on proportional characteristic self-adaption

CN122951750APending Publication Date: 2026-10-20BEIJING LEADING INNOVATION MEDICAL VALLEY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611041473.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

然而,该方法在实际应用中存在明显的局限性:

Benefits of technology

1. 本发明在V码识别过程中不依赖任何固定时间阈值,而是采用短脉冲、长脉冲与V码的脉冲宽度之间的固有脉冲宽度比例作为判断依据。即便不同设备发射的信号频率存在差异,或同一设备因RC振荡器温漂导致频率偏移,由于脉冲间的比例关系保持不变,V码识别仍可稳定完成,从而有效兼容不同厂商、不同批次的RFID设备。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to an FMO decoding method based on adaptive V-code recognition using proportional features. The FMO decoding method includes: acquiring an FMO encoded signal and preprocessing the FMO encoded signal; adaptively recognizing a V-code based on proportional features in the preprocessed FMO encoded signal; calculating a symbol reference time based on the pulse width of the valid V-code after recognition; determining a dynamic decoding judgment threshold range for various pulse types using the calibrated symbol reference time; and decoding the FMO encoded signal based on the recognized valid V-code and the determined dynamic decoding judgment threshold range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of radio frequency identification (RFID) communication technology, and more specifically to an FM0 decoding method based on proportional feature adaptive recognition of V codes. Background Technology

[0002] In Radio Frequency Identification (RFID) systems, FM0 encoding (Bi-Phase Space encoding) is a commonly used signal encoding method, widely applied in standards such as GB / T 29768. FM0 encoding represents data bits through the position and width of pulse edges. A short pulse, approximately half a symbol reference time, represents a portion of a symbol "0"; a long pulse, approximately one symbol reference time, represents a symbol "1"; and the V code (violation code), approximately 1.5 symbol reference times, is used for synchronization and frame start identification.

[0003] Currently, FM0 decoding mainly uses a fixed time threshold to determine the pulse type. However, this method has significant limitations in practical applications: First, fixed thresholds lack adaptability to changes in signal frequency. Taking implantable neurostimulators as an example, these devices typically use RC oscillators as clock sources. The inherent frequency drift characteristics of RC oscillators make them susceptible to temperature variations, potentially leading to significant clock frequency deviations within the operating temperature range. Furthermore, due to process variations and material differences, clock frequencies vary between different batches of chips; the actual operating frequency of the same design may differ by several percentage points across different batches. When the signal frequency shifts, fixed thresholds cannot adjust accordingly, easily leading to decoding failures or bit errors.

[0004] Secondly, regarding protocol adaptation, the commonly used 12 leading zero calibration methods require the protocol to provide a leading zero sequence of sufficient length. However, protocols such as GB / T 29768 do not provide leading zeros or have insufficient leading zero length, making traditional calibration methods difficult to apply.

[0005] Furthermore, the fixed threshold method is highly sensitive to signal jitter and noise, and exhibits poor decoding stability in weak signal or interference environments. Different manufacturers' RFID tags may use different encoding frequencies, making the fixed threshold method incompatible with various devices and limiting the system's versatility.

[0006] For medical devices such as implantable neurostimulators, the above problems are particularly prominent. In vivo stimulators communicate frequently and handle complex data, requiring extremely high communication stability. Communication failures can lead to incorrect stimulation parameter settings, directly impacting treatment efficacy and patient safety. Furthermore, key treatment parameters such as stimulation frequency and pulse width are directly related to clock accuracy. If clock deviation information can be obtained during the decoding process, it can not only improve communication success rates but also allow for real-time calibration of stimulation parameters, ensuring the accuracy of treatment parameters.

[0007] Therefore, there is an urgent need for an FM0 decoding method that can adapt to changes in signal frequency, improve decoding stability, and enhance device compatibility.

[0008] The above description of the background technology is only for the purpose of facilitating a deeper understanding of the technical solution of the present invention (the technical means used, the technical problems solved, and the technical effects produced, etc.), and should not be regarded as an admission or in any form an implication that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0009] This invention aims to propose an FMO decoding method based on adaptive identification of V codes using proportional features. It adaptively identifies V codes by utilizing the inherent proportional relationship of pulse width in FMO encoding, and uses this to calibrate the symbol reference time and dynamically adjust the decoding judgment threshold, thereby achieving stable decoding of FMO encoded signals under different signal frequency conditions.

[0010] According to an embodiment of the present invention, an FMO decoding method based on proportional feature adaptive V code recognition is provided, comprising: acquiring an FMO encoded signal and preprocessing the FMO encoded signal; adaptively recognizing a V code based on proportional features on the preprocessed FMO encoded signal; after recognizing a valid V code, calculating a symbol reference time based on the pulse width of the valid V code; determining a dynamic decoding judgment threshold for various types of pulses using the calibrated symbol reference time; and decoding the FMO encoded signal based on the recognized valid V code and the determined dynamic decoding judgment threshold.

[0011] Preferably, the preprocessing of the FM0 encoded signal includes: capturing the moment when the pulse edge of the FM0 encoded signal changes and recording it as a timestamp sequence; determining the difference between the timestamps of two adjacent edges as the pulse width of a single pulse, thereby obtaining a pulse width sequence; comparing the pulse width of a single pulse with a minimum pulse width threshold; when it is determined that the pulse width of a single pulse is less than the minimum pulse width threshold, discarding the pulse, and directly using the timestamps of the two edges before and after the pulse as adjacent edges, recalculating the pulse width.

[0012] Preferably, the FMO decoding method based on proportional feature adaptive recognition of V code according to the embodiment of the present invention further includes: in the pulse width sequence, taking four consecutive pulses as a group, sequentially determining whether the four consecutive pulses conform to the short-long-short-V pattern; when it is determined that the four consecutive pulses conform to the short-long-short-V pattern, determining the valid V code, and recording the position index and pulse width value of the valid V code.

[0013] Preferably, the FMO decoding method based on proportional feature adaptive recognition of V code according to an embodiment of the present invention further includes: selecting the fourth pulse width as the candidate V code pulse width PW. i Check if all of the following conditions are met: the width of the first pulse PW i-1 With candidate V code pulse width PW i The ratio is within the first predetermined range; the second pulse width PW i-2 With candidate V code pulse width PW i The ratio is within the second predetermined range; the width of the first third pulse PW i-3 With candidate V code pulse width PW i The ratio is within the first predetermined range; the candidate V code pulse width PW i With the second pulse width PW i-2 The ratio is within a third predetermined range; where i = 4, 5, ..., n, and n is the total number of pulses; when all conditions are met, it is determined that the widths of four consecutive pulses conform to the short-long-short-V pattern, and the candidate V code is determined as a valid V code; wherein, the first predetermined range is set based on the theoretical ratio of the pulse width of the short pulse to the pulse width of the V code and its allowable error range; the second predetermined range is set based on the theoretical ratio of the pulse width of the long pulse to the pulse width of the V code and its allowable error range; the third predetermined range is set based on the theoretical ratio of the pulse width of the V code to the pulse width of the long pulse and its allowable error range.

[0014] Preferably, the FMO decoding method based on proportional feature adaptive recognition of V code according to an embodiment of the present invention further includes: calculating the symbol reference time based on the determined pulse width of the valid V code using a symbol time that is 1.5 times the pulse width of the V code; and determining the dynamic decoding judgment threshold range for short pulses and the dynamic decoding judgment threshold range for long pulses using the calculated symbol reference time.

[0015] Preferably, the FMO decoding method based on proportional feature adaptive recognition of V codes according to an embodiment of the present invention further includes: sequentially reading pulse widths starting from the second pulse after the first valid V code; determining whether the pulse width of the current pulse is within the dynamic decoding judgment threshold range of long pulses; when it is determined that the pulse width of the current pulse is within the dynamic decoding judgment threshold range of long pulses, decoding the current pulse as data bit 1 and incrementing the number of decoded bits by 1; when it is determined that the pulse width of the current pulse is not within the dynamic decoding judgment threshold range of long pulses, determining whether the pulse widths of the current pulse and the next pulse are both within the dynamic decoding judgment threshold range of short pulses; when it is determined that the pulse widths of the current pulse and the next pulse are both within the dynamic decoding judgment threshold range of short pulses, decoding the current pulse as data bit 0, skipping the next pulse, and incrementing the number of decoded bits by 1; when it is determined that either the pulse width of the current pulse or the next pulse is not within the dynamic decoding judgment threshold range of short pulses, stopping decoding.

[0016] Preferably, the FM0 decoding method based on proportional feature adaptive recognition of V code according to the embodiment of the present invention further includes: determining whether the traversal is complete; when it is determined that the traversal is complete, outputting the decoding result; when it is determined that the traversal is not complete, continuing to traverse the next pulse.

[0017] Preferably, the first upper limit of the dynamic decoding judgment threshold range of the short pulse is set to be less than the second lower limit of the dynamic decoding judgment threshold range of the long pulse, so as to ensure that there is a discrimination gap between the short pulse and the long pulse; the second upper limit of the dynamic decoding judgment threshold range of the short pulse is set to be less than the theoretical pulse width of the V code, so as to ensure that there is a discrimination gap between the long pulse and the V code.

[0018] Preferably, when the FMO decoding method is applied to an implantable neurostimulator, a clock deviation coefficient is obtained after the symbol reference time calibration is completed. The clock deviation coefficient is used to correct the stimulation frequency and pulse width of the implantable neurostimulator in real time.

[0019] According to one embodiment of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored, which, when executed by a processor, perform the following steps: acquiring an FM0 encoded signal and preprocessing the FM0 encoded signal; adaptively identifying V codes based on proportional characteristics of the preprocessed FM0 encoded signal; after identifying a valid V code, calculating a symbol reference time based on the pulse width of the valid V code; determining dynamic decoding judgment thresholds for various types of pulses using the calibrated symbol reference time; and decoding the FM0 encoded signal based on the identified valid V code and the determined dynamic decoding judgment thresholds.

[0020] The present invention adopts the above technical solution, which has the following beneficial effects: 1. This invention does not rely on any fixed time threshold during V-code recognition. Instead, it uses the inherent pulse width ratio between short pulses, long pulses, and the pulse width of the V-code as the judgment basis. Even if the signal frequencies transmitted by different devices differ, or if the frequency of the same device shifts due to temperature drift of the RC oscillator, the V-code recognition can still be completed stably because the proportional relationship between the pulses remains unchanged, thus effectively ensuring compatibility with RFID devices from different manufacturers and batches.

[0021] 2. This invention uses the relative ratio between pulse widths for decision-making, and the decision result is not affected by fluctuations in the absolute value of the signal. In weak signal or interference environments, as long as the ratio between pulses remains basically stable, the decoding process can proceed normally, and the bit error rate is significantly reduced.

[0022] 3. This invention utilizes the characteristic that the V-code pulse width is always 1.5 times the symbol time, and calculates the symbol reference time of the current signal in reverse by detecting the actual width of the V-code. This calibration method directly reflects the actual frequency state of the current signal, and can incorporate the frequency deviation at the transmitting end, the clock error at the receiving end, and the drift caused by temperature changes into the calibration result. The calibration accuracy is superior to traditional methods that rely on fixed frequency assumptions.

[0023] 4. This invention simultaneously examines the arrangement pattern of four consecutive pulses ("short-long-short-V") in V-code recognition, and employs four proportional constraints for verification, rather than relying solely on the width characteristics of a single pulse. Compared to single-pulse detection methods, this combined pattern matching mechanism has stronger noise and glitches suppression capabilities, significantly reducing the probability of misidentification of non-V-code positions.

[0024] 5. Traditional 12-leading-zero calibration methods require the protocol frame structure to contain a sufficiently long sequence of leading zeros, a requirement not provided by protocols such as GB / T 29768. This invention uses the V code as the calibration benchmark, achieving accurate symbol timing calculation without relying on leading zeros. It is applicable to various protocol standards with missing or insufficient leading zeros, thus possessing broader applicability.

[0025] 6. In applications such as implantable neurostimulators, this invention improves the decoding success rate of wireless communication links, reducing the risk of incorrect stimulation parameter settings due to communication failures. Furthermore, the clock deviation coefficient obtained through V-code calibration can be further used to correct key treatment parameters such as stimulation frequency and pulse width. Thus, the calibration results of the communication link are extended to the control of treatment parameters, improving communication reliability while ensuring treatment accuracy and patient safety. Attached Figure Description

[0026] The exemplary embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. For clarity, the same components in different drawings are shown with the same reference numerals. It should be noted that the drawings are for illustrative purposes only and are not necessarily drawn to scale. In these drawings: Figure 1 A flowchart illustrating an FM0 decoding method based on proportional feature adaptive recognition of V codes according to an embodiment of the present invention is provided. Figure 2 A schematic diagram illustrating the waveform of the preprocessed FM0 encoded signal; Figure 3 A flowchart illustrating the proportional feature-based adaptive recognition of V-codes according to an embodiment of the present invention is provided. Figure 4 A flowchart illustrating data decoding according to an embodiment of the present invention is provided. Detailed Implementation

[0027] The following is a detailed description of the embodiments of the present invention. These embodiments are implemented based on the technical solution of the present invention, and provide detailed implementation methods and specific operation processes. However, the scope of protection of the present invention is not limited to the following embodiments.

[0028] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings. Figure 1 A flowchart illustrating an FM0 decoding method based on proportional feature adaptive recognition of V codes according to an embodiment of the present invention is provided. See also... Figure 1 The FM0 decoding method based on proportional feature adaptive recognition of V code according to an embodiment of the present invention may include the following steps: In step S100: Obtain the FM0 encoded signal and preprocess the FM0 encoded signal.

[0029] Specifically, the antenna at the receiving end receives an RF signal, which is demodulated to obtain a baseband signal, namely the FM0 encoded signal. An edge detection circuit or digital sampling module can capture the moments when the pulse edges of the FM0 encoded signal transition, recording them as a timestamp sequence. Then, the pulse width interval between adjacent timestamps can be calculated, thereby filtering out glitches smaller than a predetermined threshold.

[0030] According to an embodiment of the present invention, the decoder can capture the moment when the pulse edge (rising edge or falling edge) of the FM0 encoded signal transitions, and record it as a timestamp sequence T0, T1, T2, ..., T n That is, there are a total of n+1 time points.

[0031] The difference between the timestamps of two adjacent edges is determined as the duration (pulse width) of a single pulse, that is, the pulse width of the i-th pulse is: PWi = T i – T i-1 , Where i = 1, 2, 3, ..., n, thus obtaining the pulse width sequence PW1, PW2, ..., PW n The total number of pulses is n.

[0032] In actual signal transmission, extremely short pulse glitches may occur due to factors such as channel noise, reflections, or sampling jitter at the receiver. To eliminate the impact of this type of interference on subsequent mode matching, a preset minimum pulse width threshold PW can be set. min Pulses with a pulse width less than the threshold are considered glitch and are discarded.

[0033] Preset minimum pulse width threshold PW min The threshold can be set according to the period of the sampling clock at the receiving end, typically 2 to 3 times the sampling period, but is not limited to this. Alternatively, the threshold can be configured according to the statistical distribution characteristics of the measured pulse width, for example, by setting the threshold to the lower percentile of the short pulse width in the measured pulse sequence to adapt to the noise characteristics under different signal environments.

[0034] Accordingly, the pulse width PW of a single pulse can be... i With the preset minimum pulse width threshold PW min Compare them. When PW is determined... i Less than PW min When the pulse is discarded, the timestamps of the two edges before and after the pulse are used directly as adjacent edges, and the pulse width is recalculated to ensure that the pulse sequence participating in the subsequent matching consists of valid signals.

[0035] In step S200: For the preprocessed FM0 encoded signal, the V code is adaptively identified based on the proportional features.

[0036] Figure 2 This is a schematic diagram illustrating the waveform of the preprocessed FM0 encoded signal. (For example...) Figure 2 As shown, the preprocessed FM0 encoded signal consists of several pulses. The horizontal axis represents time, and the vertical axis represents the signal level. Specifically, it is in TRext = 1 mode, which is an extended preamble code containing 12 leading zeros. Figure 2 In this code, T represents a symbol reference time. The pulse width of a short pulse is 0.5T, corresponding to half a symbol reference time for a data bit "0", and the waveform is a narrow rectangular pulse. The pulse width of a long pulse is 1.0T, corresponding to a complete symbol reference time for a data bit "1", and the waveform is a wide rectangular pulse. The pulse width of the V code is 1.5T. It is a violation code in FM0 encoding, used for synchronization and frame start identification, and the waveform is the widest rectangular pulse.

[0037] Based on the theoretical values ​​of the three pulse widths mentioned above, the pulse width ratio between any two pulses is fixed, specifically as follows: The pulse width of the short pulse / the pulse width of the V code = 0.5T / 1.5T = 1 / 3 ≈ 33%; The pulse width of the long pulse / the pulse width of the V code = 1.0T / 1.5T = 2 / 3 ≈ 67%; The pulse width of the V code / the pulse width of the long pulse = 1.5T / 1.0T = 3 / 2 = 150%.

[0038] Since the ratio of these pulse widths does not depend on the absolute value of the symbol reference time T, identification can be performed without knowing the nominal frequency of the current signal.

[0039] In the pulse width sequence, starting from the 4th pulse PW i Initially, group four consecutive pulses together, and sequentially judge the PW of four consecutive pulses. i-3 PW i-2 PW i-1 PW i Determine whether it conforms to the "short-long-short-V" (i.e., "0-1-0-V") pattern. Among them, PW i The candidate V code pulses are the first three pulses, which correspond to the second half of the short pulse of the data bit "0", the long pulse of the data bit "1", and the first half of the short pulse of the data bit "0" in sequence.

[0040] Table 1 shows the proportion thresholds based on FM0 encoding.

[0041] [Table 1] For the pulse width ratio of short pulse to V code (33%), it is relatively less affected by edge jitter and sampling errors, therefore a narrower tolerance range (±12%) is set. For the pulse width ratio of long pulse to V code (67%) and the pulse width ratio of V code to long pulse (150%), since both pulse widths involved in the calculation are relatively large, they are less affected by edge detection errors, but are equally affected by the overall scaling of frequency deviations, therefore a slightly wider tolerance range (±18%, ±20%) is set. The asymmetry of the error ranges for the three pulse width ratios stems from the differences in the absolute values ​​of the pulse widths involved in the different ratios and a comprehensive consideration of engineering experience.

[0042] It should be understood that the above numerical range is only a preferred embodiment. Those skilled in the art can make appropriate adjustments to the above numerical range based on the actual signal quality without departing from the principle of the present invention. For example, the pulse width ratio of short pulse to V code can be extended to 20% to 50%, or the pulse width ratio of V code to long pulse can be adjusted to 125% to 175%, etc., which are all equivalent alternatives of the present invention.

[0043] Accordingly, for the candidate V code pulse width PW at position i i Calculate and verify the following four proportional conditions: 1) The width of the first pulse, PW i-1 Should be related to the candidate V code pulse width PW i Satisfy: PW i-1 / PW i ×100%∈[25%, 45%], this condition is used to verify PW i-1 Is it a short pulse? 2) The width of the second pulse before PW i-2 Should be related to the candidate V code pulse width PW i Satisfy: PW i-2 / PW i ×100%∈[60%, 85%], this condition is used to verify PW i-2 Is it a long pulse? 3) The width of the third pulse before the beginning (PW) i-3 Should be related to the candidate V code pulse width PW i Satisfy: PW i-3 / PW i ×100%∈[25%, 45%], this condition is used to verify PW i-3 Is it a short pulse? 4) Candidate V-code pulse width PW i It should be the same as the width of the second pulse before PW. i-2 Satisfy: PW i / PW i-2 ×100%∈[130%, 170%], this condition serves as a supplementary verification to condition 2), ensuring PW i Compared to PW i-2 The extension ratio conforms to the characteristics of the V code.

[0044] When four consecutive pulses simultaneously satisfy the above four proportional conditions, a valid V code is confirmed to have been found, and its position index i and pulse width PW are recorded. i The search process has ended.

[0045] If the pulse at a certain position does not meet the condition, then slide to the next group of four consecutive pulses (PW). i-2 PW i-1PW i PW i+1 The judgment is re-evaluated, and the last three pulses in the original window become the first three pulses in the new window. The fourth pulse in the new window is the newly added PW. i+1 As a new candidate V code, it is re-examined for the four proportional constraints until a pattern that satisfies all conditions is found or the entire pulse sequence is searched.

[0046] Figure 3 A flowchart illustrating the proportional feature-based adaptive V-code recognition method according to an embodiment of the present invention is provided. Figure 3 As shown, the process includes the following steps: In step S31, the search index i = 4, i = 4, 5, ..., n, where n is the total number of pulses.

[0047] In step S32, determine whether i is less than the total number of pulses n. If i is less than n (yes in step S32), proceed to step S33. If i is greater than or equal to n (no in step S32), it indicates that no V code was found, return failure, and end the current V code recognition process.

[0048] In step S33, the candidate mode pulse sequence is obtained, which is PW in sequence. i-3 PW i-2 PW i-1 PW i PW i-3 PW is the width of the third pulse before the first pulse. i-2 PW is the width of the second pulse preceding the first pulse. i-1 PW is the width of the immediately preceding pulse. i The pulse width is the current candidate V code. The four pulses correspond to the "short pulse-long pulse-short pulse-V code" pattern in FM0 encoding in chronological order.

[0049] In step S34, determine PW i-1 With PW i Whether the ratio is within the range of 25% to 45% (i.e., ∈ [25%, 45%], including the boundary values ​​of 25% and 45%). This is determined after determining PW. i-1 With PW i When the ratio is within the range of 25% to 45% (as in step S34), proceed to step S35. After determining PW... i-1 With PW i If the ratio is not in the range of 25% to 45% (No in step S34), increment i by 1 and return to step S32.

[0050] In step S35, determine PW i-2 With PW iWhether the ratio is within the range of 60% to 85% (i.e., ∈ [60%, 85%], including the boundary values ​​of 60% and 85%), in determining PW i-2 With PW i When the ratio is within the range of 60% to 85% (as in step S35), proceed to step S36. After determining PW... i-2 With PW i If the ratio is not in the range of 60% to 85% (No in step S35), increment i by 1 and return to step S32.

[0051] In step S36, determine PW i-3 With PW i Whether the ratio is within the range of 25% to 45%. In determining PW i-3 With PW i When the ratio is within the range of 25% to 45% (as in step S36), proceed to step S37. After determining PW... i-3 With PW i If the ratio is not in the range of 25% to 45% (No in step S36), increment i by 1 and return to step S32.

[0052] In step S37, determine PW i With PW i-2 Whether the ratio is within the range of 130% to 170% (i.e., ∈ [130%, 170%], including the boundary values ​​of 130% and 170%). In determining PW i With PW i-2 If the ratio is within the range of 130% to 170% (in step S37), proceed to step S38. After determining PW... i With PW i-2 If the ratio is not within the range of 130% to 170% (No in step S37), increment i by 1 and return to step S32.

[0053] In step S38, confirm that the V code has been found, and record the V code position i and the pulse width PW of the V code. i Successful, the V-code recognition process is now complete.

[0054] This invention does not rely on any fixed time threshold during V-code recognition. Instead, it uses the inherent pulse width ratio between short pulses, long pulses, and the V-code as the judgment criterion. Even if the signal frequencies emitted by different devices differ, or if the frequency of the same device shifts due to temperature drift of the RC oscillator, the V-code recognition can still be completed stably because the proportional relationship between the pulses remains unchanged. This effectively ensures compatibility with RFID devices from different manufacturers and batches.

[0055] Return to Figure 1In step S300: After identifying a valid V code, the symbol reference time is calculated based on the pulse width of the valid V code.

[0056] According to the standard definition of FM0 encoding, the V code is formed by a missing boundary transition between two adjacent symbols, and its width is always equal to 1.5 times the symbol reference time T. Therefore, once the actual pulse width PW of the V code is confirmed through step S200... V That is, the symbol reference time of the current signal can be obtained through reverse operation: If the pulse width of the confirmed V code is 18μs, then T = 12μs, meaning the symbol reference time T of the current signal is 12μs.

[0057] After confirming the V code, its encoding characteristic of a pulse width that is always 1.5 times the symbol time can be utilized through the formula... The symbol reference time of the current signal is calculated in reverse. This calibration method does not require a preamble sequence from the protocol, solving the problem that protocols such as GB / T 29768 cannot use the traditional 12-preamble calibration method due to missing or insufficient preamble length, thus broadening the compatibility of the decoding method with different protocols. Furthermore, this calibration process is performed in real time on the currently received signal, incorporating frequency deviations caused by temperature changes or individual device differences into the calibration results, thereby providing an accurate reference for subsequent decoding.

[0058] After calculating the symbol reference time in step S300, the clock deviation coefficient can be further obtained. In medical devices such as implantable neurostimulators, the chip typically uses an RC oscillator as the clock source, and its actual clock frequency may deviate from the design nominal value. Let the chip's design nominal clock frequency be f0, where one clock cycle corresponds to 1 μs of physical time (i.e., 1clk = 1 μs). According to chip design principles, every 10 clock cycles constitute one symbol reference, then the nominal symbol time T0 is: , In actual communication, step S300 obtains the symbol reference time T of the current signal through V code calibration. The clock deviation coefficient K is then defined as: , For example, assuming the nominal clock frequency f0 is 1MHz (1clk = 1μs) and the nominal symbol time T0 is 10μs, if the dynamically acquired symbol reference time T is 20μs (this is just an example), then This indicates that the actual clock frequency is 1 / 3 of the nominal clock frequency. That is, 0.5MHz, the clock is 50% slower (at this time, 1clk = 2μs).

[0059] The clock deviation coefficient K can be output to the control system of the implantable neurostimulator to correct key treatment parameters such as stimulation frequency and pulse width in real time. Specifically, the deviation coefficient K can be output to the control system of the implantable neurostimulator to perform reverse correction on the configuration parameters in units of clock cycles, so that the actual output parameters are consistent with the set values. The correction formula is as follows: , Based on the nominal design (1MHz), to output a stimulation frequency of 50Hz, the chip's period register needs to be configured to 20000 (unit: clk, default 1clk = 1μs) via radio frequency wireless configuration. Given that the current clock deviation coefficient K = 2, meaning the actual clock frequency is 0.5MHz and 1clk = 2μs, if configured to 20000, the actual output frequency will be... The value does not match the set value; to output the correct 50Hz, the cycle register configuration value should be corrected to: (Unit: clk) After correction, the actual output frequency is restored to the nominal value of 50Hz.

[0060] Similarly, the pulse width parameter can be corrected. Based on the nominal design (1MHz, 1clk = 1μs), if a 100μs stimulation pulse width is required, the nominal configuration value of the chip's pulse width register is... (Unit: clk); Given that the current clock deviation coefficient K = 2, i.e., the actual clock frequency is 0.5MHz, and the actual 1clk = 2μs; if it is still configured as 100clk according to the nominal value, the actual output pulse width is 100 × 2μs = 200μs, which does not match the set value of 100μs; to output the correct 100μs pulse width, the pulse width register configuration value should be corrected to: (Unit: clk) After correction, the actual output pulse width is: 50 × 2μs = 100μs, and the actual output pulse width is restored to the nominal value.

[0061] After completing the symbol reference time calibration in step S300, the actual symbol time T of the current signal can be obtained. This T value can be directly used for the calculation of the dynamic threshold in the subsequent step S400. Since T is obtained in real time through V-code calibration, the threshold range can be dynamically adjusted with changes in signal frequency; that is, changes in the threshold range essentially reflect the influence of clock deviation.

[0062] In step S400: Using the calibrated symbol reference time T, determine the dynamic decoding judgment threshold range for various types of pulses.

[0063] 1) Threshold range for dynamic decoding of short pulses: The theoretical width of a normal short pulse in FM0 encoding is 0.5T. Considering factors such as jitter and edge delay in actual signals, the judgment range is set to: PW 短 ∈[T×30%, T×70%].

[0064] The lower limit is set to 0.3T to allow for some margin for imperfect edges, while the upper limit is set to 0.7T to maintain a clear interval from the judgment range of long pulses (there is a 0.1T discrimination gap between 0.7T and 0.8T). When the measured pulse width falls within this gap (i.e., greater than 0.7T and less than 0.8T), the pulse is neither identified as a short pulse nor a long pulse, and the decoder triggers a stop decoding mechanism. This discrimination gap setting ensures that pulses in a critical state are not forcibly classified, thereby avoiding misjudgments caused by edge jitter or sampling errors.

[0065] 2) Threshold range for dynamic decoding of long pulses: In FM0 encoding, the theoretical width of a normal long pulse is 1.0T. Considering that the pulse width of the V code is 1.5T, the judgment range of the long pulse should not overlap with that of the V code. Therefore, the judgment range is set as: PW 长 ∈[T×80%, T×130%].

[0066] The lower limit is set to 0.8T to ensure differentiation from short pulses, while the upper limit is set to 1.3T to ensure a sufficient discrimination gap with V codes (1.5T). When the measured pulse width falls within this gap (i.e., greater than 1.3T and less than 1.5T), the pulse is neither recognized as a long pulse nor as a V code, and the decoder triggers a stop decoding mechanism. This discrimination gap setting ensures that a clear distinction boundary is always maintained between long pulses and V codes, avoiding misjudging V codes as long pulses or abnormally wide pulses as valid pulses.

[0067] By constraining the above-mentioned dual discrimination gap, the present invention establishes clear decision boundaries among the three types of pulses: short pulse, long pulse, and V code. The judgment ranges of each type of pulse do not overlap, effectively reducing the risk of misjudgment caused by the pulse width being in a critical state.

[0068] Table 2 shows the dynamic decoding threshold range for different types of pulses.

[0069] [Table 2] The specific values ​​(0.3T, 0.7T, 0.8T, 1.3T) in Table 2 are specific parameters of the preferred implementation scheme. Those skilled in the art can make appropriate adjustments based on the actual signal quality and application scenario without deviating from the principle of the present invention.

[0070] Accordingly, if the symbol reference time T = 12μs, the dynamic thresholds are as follows: the judgment range for short pulses is 3.6μs ~ 8.4μs; the judgment range for long pulses is 9.6μs ~ 15.6μs. That is, pulses with a width between 3.6μs and 8.4μs are identified as short pulses; pulses with a width between 9.6μs and 15.6μs are identified as long pulses; pulses with a width less than 3.6μs, between 8.4μs and 9.6μs, or greater than 15.6μs are not considered valid pulses.

[0071] In step S500: The FM0 encoded signal is decoded using the determined dynamic decoding threshold range.

[0072] After adjusting the dynamic decoding threshold range, step S500 uses the short pulse and long pulse judgment range determined in step S400 to perform FM0 decoding on the pulse sequence after the V code. The decoding rule is based on the basic characteristics of FM0 encoding: a data bit "1" is represented by one long pulse, and a data bit "0" is represented by two consecutive short pulses.

[0073] Figure 4 The flowchart illustrates the data decoding process according to an embodiment of the present invention. After V-code identification and symbol reference time calibration are completed, the data decoding stage begins. The decoding starts at the second pulse after the first valid V-code (indexed as i+2, where i is the position index of the valid V-code), skipping the V-code itself and interference pulses with misaligned boundaries, ensuring that all subsequent data bits are decoded on the correct symbol boundaries.

[0074] In step S41, the pulse width is read sequentially starting from the second pulse after the first V code position.

[0075] In step S42, it is determined whether the pulse width of the current pulse is within the dynamic decoding judgment threshold range of long pulses (0.8T ~ 1.3T).

[0076] When it is determined that the pulse width of the current pulse is within the dynamic decoding threshold range of the long pulse (as in step S42), the current pulse can be decoded into a data bit "1", and the number of decoded bits bit_len is incremented by 1 in step S46.

[0077] When it is determined that the pulse width of the current pulse is not within the dynamic decoding judgment threshold range of long pulses (No in step S42), in step S43, it is determined whether the pulse widths of the current pulse and the next pulse are both within the dynamic decoding judgment threshold range of short pulses (0.3T ~ 0.7T).

[0078] When it is determined that the pulse widths of the current pulse and the next pulse are both within the dynamic decoding threshold range of the short pulse (as in step S43), the current pulse can be decoded into data bit "0" in step S44, and the next pulse can be skipped in step S45 (i.e., the subsequent data can be processed from the pulse after the "next pulse"), and the number of decoded bits bit_len can be incremented by 1 in step S46.

[0079] When it is determined that either the pulse width of the current pulse or the pulse width of the next pulse is not within the dynamic decoding judgment threshold range of the short pulse (No in step S43), decoding is stopped, and the decoded data is retained.

[0080] In step S47, it is determined whether the traversal is complete, that is, whether all pulses in the pulse sequence have been checked. This is determined by whether the pointer of the current pulse (i.e. the index of the pulse to be read next) is greater than or equal to the total number of pulses n.

[0081] When it is determined that the traversal is complete (Yes in step S47), the decoding result (including the data bit sequence and the number of decoded bits) is output in step S48. When it is determined that the traversal is not complete (No in step S47), return to S41 to continue traversing the next pulse.

[0082] This invention dynamically sets judgment thresholds for short pulses (occupying 30%~70% of the symbol time) and long pulses (occupying 80%~130% of the symbol time) based on the calibrated symbol reference time. These dynamic thresholds change synchronously with the actual symbol reference time of the current signal, ensuring that the judgment boundary used during decoding always adaptively adjusts to follow the signal frequency. Compared to fixed threshold methods, this invention has a wider compatibility range for the encoding frequency differences of RFID tags from different manufacturers, and can maintain stable pulse type judgment even under weak signal or signal jitter conditions, thereby reducing the bit error rate.

[0083] The FMO decoding method described above in this invention is particularly applicable to wireless communication systems for medical devices such as implantable neurostimulators. The implantable neurostimulator system includes an external programmer and an implantable neurostimulator. The external programmer and the implantable neurostimulator achieve bidirectional interaction through antenna radio frequency coupling: on one hand, the external programmer transmits energy to the implantable neurostimulator to ensure its stable operation, and simultaneously sends key stimulation parameters such as stimulation frequency and stimulation amplitude; on the other hand, the implantable neurostimulator transmits electrical signals to the spinal cord through implanted electrodes based on the received parameters, and provides real-time feedback of its own operating status data to the external programmer to achieve regulation of the stimulation current.

[0084] This invention obtains a clock deviation coefficient after completing the symbol reference time calibration. The clock deviation coefficient is used to correct the stimulation frequency and pulse width of the implantable neurostimulator in real time. This not only improves the success rate of wireless communication, but also calibrates the stimulation time parameters of the stimulator in real time through the calibration coefficient, ensuring the accuracy of the treatment parameters and meeting the stringent requirements of clinical applications for communication stability and treatment precision.

[0085] According to embodiments of the present invention, the FM0 decoding method based on proportional feature adaptive recognition of V codes can be implemented by hardware, firmware, software, or a combination thereof. The hardware can be implemented by one or more of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a general-purpose processor, a controller, a microcontroller, a microprocessor, etc.

[0086] The scope of the invention is also intended to include software or machine-executable instructions (e.g., control systems, applications, firmware, programs, etc.) and non-volatile computer-readable media, the software or machine-executable instructions causing processing according to various embodiments to be performed on an apparatus or computer, and the non-volatile computer-readable media being executable on a device or computer storing such software or instructions, etc.

[0087] The various embodiments of the present invention are not an exhaustive list of all possible combinations, but are intended to describe representative aspects of the invention, and the contents described in the various embodiments can be applied independently or in two or more combinations.

[0088] The description of the exemplary embodiments presented above is merely illustrative of the technical solutions of the present invention and is not intended to be exhaustive, nor is it intended to limit the invention to the precise forms described. Obviously, those skilled in the art can make many changes and variations based on the above teachings. The exemplary embodiments were chosen and described to explain the specific principles of the invention and its practical application, thereby enabling others skilled in the art to understand, implement, and utilize the various exemplary embodiments of the invention and their various alternatives and modifications. The scope of protection of the present invention is intended to be defined by the appended claims and their equivalents.

Claims

1. An FM0 decoding method based on proportional feature adaptive recognition of V codes, comprising: Acquire the FM0 encoded signal and preprocess it. For the preprocessed FM0 encoded signal, the V code is adaptively identified based on the proportional characteristics; After identifying a valid V code, the symbol reference time is calculated based on the pulse width of the valid V code; By using the calibrated symbol reference time, the dynamic decoding judgment threshold range of various pulses is determined; The FM0 encoded signal is decoded based on the identified valid V code and the determined dynamic decoding judgment threshold range.

2. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 1, wherein, Preprocessing of the FM0 encoded signal includes: Capture the moments when the pulse edges of the FM0 encoded signal change and record them as a timestamp sequence; The difference between the timestamps of two adjacent edges is determined as the pulse width of a single pulse, thus obtaining the pulse width sequence; The pulse width of a single pulse is compared with the minimum pulse width threshold; When it is determined that the pulse width of a single pulse is less than the minimum pulse width threshold, the pulse is discarded, and the timestamps of the two edges before and after the pulse are directly used as adjacent edges to recalculate the pulse width.

3. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 2, further comprising: In the pulse width sequence, four consecutive pulses are grouped together, and it is determined whether the four consecutive pulses conform to the short-long-short-V pattern. When four consecutive pulses are determined to conform to the short-long-short-V pattern, a valid V code is identified, and the position index and pulse width value of the valid V code are recorded.

4. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 3, further comprising: The fourth pulse width is selected as the candidate V-code pulse width PW. i Check whether all of the following conditions are met: First pulse width PW i-1 With candidate V code pulse width PW i The ratio is within a first predetermined range; The second pulse width PW i-2 With candidate V code pulse width PW i The ratio is within a second predetermined range; The width of the first third pulse PW i-3 With candidate V code pulse width PW i The ratio is within a first predetermined range; Candidate V code pulse width PW i With the second pulse width PW i-2 The ratio is within the third predetermined range; Where i = 4, 5, ..., n, and n is the total number of pulses; When all conditions are met, it is determined that the widths of four consecutive pulses conform to the short-long-short-V pattern, and the candidate V code is determined as a valid V code; The first predetermined range is set based on the theoretical ratio of the pulse width of the short pulse to the pulse width of the V code and its allowable error range. The second predetermined range is set based on the theoretical ratio of the pulse width of the long pulse to the pulse width of the V code and its allowable error range; The third predetermined range is set based on the theoretical ratio of the pulse width of the V code to the pulse width of the long pulse and its allowable error range.

5. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 1, further comprising: Based on the determined pulse width of the valid V code, the symbol reference time is calculated using a symbol time that is 1.5 times the pulse width of the V code. Using the calculated symbol reference time, the dynamic decoding judgment threshold ranges for short pulses and long pulses are determined.

6. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 5, further comprising: Read the pulse width sequentially, starting from the second pulse after the first valid V code; Determine whether the pulse width of the current pulse is within the dynamic decoding threshold range for long pulses; When it is determined that the pulse width of the current pulse is within the dynamic decoding threshold range of the long pulse, the current pulse is decoded as data bit 1, and the number of decoded bits is incremented by 1; When it is determined that the pulse width of the current pulse is not within the dynamic decoding judgment threshold range of long pulses, it is determined whether the pulse widths of the current pulse and the next pulse are both within the dynamic decoding judgment threshold range of short pulses. When it is determined that the pulse widths of the current pulse and the next pulse are both within the dynamic decoding threshold range of short pulses, the current pulse is decoded as data bit 0, the next pulse is skipped, and the number of decoded bits is incremented by 1. Decoding stops when it is determined that either the pulse width of the current pulse or the pulse width of the next pulse are outside the dynamic decoding threshold range for short pulses.

7. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 6, further comprising: Determine if the traversal is complete; When it is determined that the traversal is complete, output the decoding result; If it is determined that the traversal is not complete, continue traversing the next pulse.

8. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 5, wherein, The first upper limit of the dynamic decoding judgment threshold range for the short pulse is set to be less than the second lower limit of the dynamic decoding judgment threshold range for the long pulse, so as to ensure that there is a discrimination gap between the short pulse and the long pulse. The second upper limit of the dynamic decoding judgment threshold range for the short pulse is set to be less than the theoretical pulse width of the V code, so as to ensure that a discrimination gap is left between the long pulse and the V code.

9. The FM0 decoding method based on proportional feature adaptive recognition of V code according to claim 1, wherein, When the FMO decoding method is applied to an implantable neurostimulator, a clock deviation coefficient is obtained after the symbol reference time calibration is completed. The clock deviation coefficient is used to correct the stimulation frequency and pulse width of the implantable neurostimulator in real time.

10. A computer-readable storage medium having stored thereon computer instructions, wherein, When this computer instruction is executed by the processor, it performs the following steps: Acquire the FM0 encoded signal and preprocess it. For the preprocessed FM0 encoded signal, the V code is adaptively identified based on the proportional characteristics; After identifying a valid V code, the symbol reference time is calculated based on the pulse width of the valid V code; By using the calibrated symbol reference time, the dynamic decoding judgment thresholds for various types of pulses are determined; The FM0 encoded signal is decoded based on the identified valid V code and the determined dynamic decoding judgment threshold.