Decoding method, apparatus, module and computer readable storage medium
By dynamically adjusting the sampling interval and period of Manchester encoding and using a weighted average to handle the impact of noise, the problem of mismodulation in the traditional Manchester encoding decoding method under noisy environments is solved, thus improving the decoding success rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PAIDE XINENG SEMICON (SHANGHAI) CO LTD
- Filing Date
- 2025-09-12
- Publication Date
- 2026-05-05
AI Technical Summary
Traditional Manchester encoding and decoding methods are prone to mismodulation in the presence of channel noise, which reduces the decoding success rate.
By obtaining the initial symbol period, calculating the sampling interval, updating the actual symbol period based on the sampling interval, dynamically adjusting the sampling interval, and using a weighted average, especially an exponentially weighted average, the accuracy of decoding is improved.
Despite the influence of noise, it can still successfully identify symbols, improving the decoding success rate and reducing the probability of misinterpretation.
Smart Images

Figure CN121098449B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Manchester encoding technology, specifically relating to a decoding method, apparatus, module, and computer-readable storage medium. Background Technology
[0002] Manchester encoding is a commonly used encoding method in communication protocols. Different communication protocols use Manchester encoding to form data frames with different structures for data transmission. Manchester encoding involves a transition in the middle of each symbol. Typically, 10 (the transition edge in the middle of the symbol is a falling edge) represents symbol 1, and 01 (the transition edge in the middle of the symbol is a rising edge) represents symbol 0.
[0003] Traditional decoding methods determine whether the transmitted data is 0 or 1 by sampling at a fixed sampling period at half the period of a Manchester symbol. However, due to channel noise, the period of the Manchester code transmitted by the gate-isolated driver chip may vary slightly, and the duty cycle may not be 50%. Using a fixed sampling period may cause mismodulation and reduce the success rate of decoding.
[0004] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a decoding method, apparatus, module, and computer-readable storage medium that can improve the success rate of decoding.
[0006] To achieve the above objectives, a specific embodiment of the present invention provides the following technical solution:
[0007] A decoding method for Manchester encoded data includes: obtaining an initial symbol period; calculating a sampling interval based on the initial symbol period; sampling the transition edges of encoded data within the sampling interval; calculating an actual symbol period based on the sampling interval; updating the value of the sampling interval based on the actual symbol period; and continuing to sample the transition edges of encoded data within the updated sampling interval; and decoding the encoded data based on the sampling results.
[0008] In one or more embodiments of the present invention, the initial symbol period includes: the average period of multiple symbols in the encoded data.
[0009] In one or more embodiments of the present invention, the actual symbol period includes: a weighted average of the sampling interval and the initial symbol period.
[0010] In one or more embodiments of the present invention, the weighted average is an exponentially weighted average.
[0011] In one or more embodiments of the present invention, the decoding method further includes performing filtering preprocessing on the encoded data; and / or the decoding method further includes determining a decoding error if no transition edge is sampled within the sampling interval; and / or the decoding method further includes verifying the decoding result.
[0012] A specific embodiment of the present invention also provides a decoding device. Based on the above-described decoding method, the decoding device includes: a frame header detector, used to detect the frame header of encoded data and output a first frame header flag bit and a second frame header flag bit representing the preceding and following symbols in the frame header; a period calculator, used to calculate an initial symbol period based on the first frame header flag bit and the second frame header flag bit, calculate a sampling interval based on the initial symbol period, sample the transition edges of encoded data within the sampling interval, calculate the actual symbol period based on the sampling interval, update the value of the sampling interval based on the actual symbol period, and continue to sample the transition edges of encoded data within the updated sampling interval; and a decoder, used to sample the transition edges of encoded data within each sampling interval and decode the encoded data based on the sampling results.
[0013] In one or more embodiments of the present invention, the period calculator includes a first counter, a second counter, and a first controller; the first counter starts counting based on the first frame header flag and stops counting based on the second frame header flag, averages the count value, and outputs a first counter value representing the initial symbol period; the first controller calculates a sampling interval based on the first counter value; the second counter starts counting based on the second frame header flag, and the first controller samples the transition edges of the encoded data within the sampling interval after the second counter starts counting, and after sampling a transition edge, controls the second counter to output a second counter value representing the sampling interval and restarts counting; the first counter is also used to calculate the actual symbol period based on the second counter value, update the first counter value based on the actual symbol period, and the first controller updates the sampling interval based on the updated first counter value and continues sampling.
[0014] In one or more embodiments of the present invention, the decoder includes a third counter and a second controller; the third counter starts counting based on the second frame header flag bit, the second controller samples the transition edges of the encoded data in the corresponding sampling interval after the third counter starts counting, controls the third counter to start counting again after sampling the transition edge, and continues to sample the transition edges of the encoded data in the updated sampling interval, and the second controller is also used to decode the encoded data based on the sampling results.
[0015] In one or more embodiments of the present invention, the decoding device further includes: a pre-filter for filtering and preprocessing the encoded data; and / or an edge detector for detecting the transition edges of the encoded data and outputting a corresponding transition edge flag, wherein the frame header detector further detects the frame header based on the transition edge flag, and the period calculator and the decoder further sample the transition edges based on the transition edge flag; and / or a checker for checking the decoding result.
[0016] A specific embodiment of the present invention also provides a decoding module, including: at least one processor; and a memory, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the decoding method as described above.
[0017] A specific embodiment of the present invention also provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the above-described decoding method.
[0018] Compared with the prior art, the decoding method, apparatus, module and computer-readable storage medium of the present invention can dynamically adjust the sampling interval of each symbol. For Manchester encoding affected by noise, even when the period is inaccurate or the duty cycle is not 50%, it can still successfully identify symbols and improve the decoding success rate. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a decoding method in one embodiment of the present invention.
[0021] Figure 2 This is a format diagram of encoded data in one embodiment of the present invention.
[0022] Figure 3 This is a flowchart of some steps of the decoding method in one embodiment of the present invention.
[0023] Figure 4 This is a decoding schematic diagram of a decoding method in one embodiment of the present invention.
[0024] Figure 5 This is a schematic diagram of the decoding device in one embodiment of the present invention.
[0025] Figure 6This is a partial structural schematic diagram of a decoding device in one embodiment of the present invention.
[0026] Figure 7 This is a decoding schematic diagram of a decoding device in one embodiment of the present invention.
[0027] Figure 8 This is a partial structural schematic diagram of a decoding device in one embodiment of the present invention.
[0028] Figure 9 This is a schematic diagram of the decoding module in one embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the technical solutions in this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this disclosure.
[0030] The terms "coupled," "connected," or "linked" in the specification include both direct and indirect connections. An indirect connection is a connection made through an intermediate medium, such as an electrical conduction medium, which may have parasitic inductance or capacitance. Indirect connections may also include connections made through other active or passive devices to achieve the same or similar functional purpose, such as connections through switches, follower circuits, or other circuits or components. Furthermore, in the invention, terms such as "first" and "second" are primarily used to distinguish one technical feature from another, and do not necessarily require or imply any actual relationship, quantity, or order between these technical features.
[0031] In the detailed description of this specification, reference is made to the accompanying drawings, which form a part thereof, wherein like reference numerals always denote like parts, and wherein exemplary embodiments are shown by way of example that may be implemented. It should be understood that other embodiments may be utilized, and structural or logical changes may be made, without departing from the scope of this application. Therefore, the following detailed description should not be considered limiting.
[0032] The various operations in the specification may be described sequentially as multiple discrete actions or operations in a manner most conducive to understanding the claimed subject matter. However, the order of description should not be construed as implying that these operations must be sequentially related. Specifically, these operations may not be performed in the order presented. The described operations may be performed in a different order than in the described embodiments. Various additional operations may be performed in additional embodiments and / or the described operations may be omitted.
[0033] For the purposes of this application, the phrase "A and / or B" means (A), (B), or (A and B). For the purposes of this application, the phrase "A, B and / or C" means (A), (B), (C), (A and B), (A and C), (B and C), or (A, B and C).
[0034] Various components and devices may be mentioned or shown in the singular form herein, but only for the convenience of discussion, and any element mentioned in the singular form may include multiple such elements as taught herein.
[0035] The description uses the phrases "in one embodiment," "in other embodiments," or "in some embodiments," each of which can refer to one or more of the same or different embodiments. Furthermore, the terms "comprising," "including," "having," etc., used in relation to embodiments of this application are synonymous.
[0036] Example 1
[0037] like Figure 1 As shown, the decoding method in one embodiment of the present invention is used for Manchester encoded data, and the decoding method includes:
[0038] Obtain the initial symbol period, and calculate the sampling interval based on the initial symbol period.
[0039] The transition edges of the encoded data within the sampling interval are sampled, the actual symbol period is calculated based on the sampling interval, the value of the sampling interval is updated based on the actual symbol period, and the transition edges of the encoded data within the updated sampling interval are sampled again.
[0040] The encoded data is decoded based on the sampling results.
[0041] like Figure 2 As shown, in one embodiment, the encoded data consists of a frame header, a valid data area, a CRC check bit, and a frame trailer.
[0042] Preferably, the frame header includes multiple consecutive 1s or 0s. For example, the frame header includes three consecutive 1s; the data is usually 0 when there is no data transmission. The frame header is followed by the valid data area.
[0043] The valid data area contains several bits of valid data that need to be transmitted, followed by CRC check bits.
[0044] The CRC checksum is a number of CRC checksum bits, which depends on the selected CRC checksum length. For example, if CRC8 is selected, the CRC checksum bit length is 8 bits; if CRC16 is selected, the CRC checksum bit length is 16 bits. The CRC checksum bits are followed by the frame trailer. For example, the frame trailer can consist of one 0 symbol.
[0045] In other embodiments, other Manchester encoding formats may also be used.
[0046] In one embodiment, the initial symbol period may include the average period of multiple symbols in the encoded data.
[0047] Preferably, the initial symbol period is the average period of multiple symbols in the frame header of the encoded data, which has the advantages of being easy to detect and calculate, and not delaying the decoding of subsequent valid data.
[0048] Preferably, the initial symbol period is the average period between the central transition edges of multiple symbols in the encoded data, which can reduce the impact of the duty cycle deviation of each symbol.
[0049] like Figure 3 As shown, for example, obtaining the initial symbol period may include the following steps:
[0050] The transition edge corresponding to the frame header data of the encoded data is sampled.
[0051] In this embodiment, since the frame header data is 1, its corresponding transition edge is a falling edge, so the falling edge is sampled at this time. In other embodiments, the corresponding transition edge can also be sampled according to the actual situation of the frame header.
[0052] Counting begins when the first corresponding transition edge (falling edge) is sampled and stops when the last corresponding transition edge (falling edge) of the frame header is sampled. The average count value is then calculated based on the number of bits in the frame header.
[0053] Combination Figure 4 As shown, since the data is usually 0 when there is no data transmission, the first falling edge sampled is the center transition edge of the first part of the frame header. When the last falling edge of the frame header is sampled, that is, the third falling edge, a total of 2 symbol periods have elapsed. Dividing the count value Ca1 at this time by 2 gives the average period between the center transition edges of multiple symbols in the frame header, that is, the initial symbol period.
[0054] In the above process, by designing a frame header containing multiple consecutive identical values, it is easy to directly sample the central transition edge of each symbol in the frame header. No further decoding is required; simple sampling and counting are sufficient to identify the frame header information and obtain the initial symbol period.
[0055] In other embodiments, the initial symbol period can also be a given preset value, such as the symbol period under ideal conditions, the average symbol period obtained based on experience, etc. The initial symbol period can also be any symbol period that is actually sampled.
[0056] Next, the sampling interval is calculated based on the initial symbol period. The sampling interval defines the time range for sampling the transition edges of Manchester encoded data. By setting the sampling interval appropriately, it can be ensured that only the central transition edge of each symbol is sampled, thereby directly determining the data of that symbol and avoiding the influence of transition edges between two symbols.
[0057] In one embodiment, the value of the sampling interval is... Where T1 is the initial symbol period, and a and b are coefficients, and , The sampling start point can be the central transition edge of any symbol. Preferably, a is 0.75, b is 1.25, and the sampling interval is... .
[0058] In other embodiments, the starting point of the first sampling can also be other positions of the encoded data, and the value of the first sampling interval can also be adjusted adaptively, as long as the central transition edge of the symbol can be sampled.
[0059] Next, the transition edges of the encoded data within the sampling interval are sampled. In this embodiment, the sampling starting point is the center transition edge of the third symbol in the frame header. Combined with... Figure 4 As shown, if the period of each symbol is consistent, then the sampling interval falls within the first symbol of the valid data area. As long as the duty cycle of the symbol does not deviate from the range of 25% to 75%, the central transition edge of the symbol can be effectively sampled within this sampling interval.
[0060] In practice, the period and duty cycle of each symbol may shift. By using the average period of multiple symbols as the initial symbol period, the impact of period shift is reduced. Furthermore, by setting a reasonable range for the sampling interval, the impact of duty cycle shift is further reduced.
[0061] Next, the actual symbol period is calculated based on the sampling interval, the value of the sampling interval is updated based on the actual symbol period, and the transition edges of the encoded data in the updated sampling interval are sampled again.
[0062] The sampling interval refers to the time interval between the sampling start point and the sampling transition edge in each sampling. It can be calculated by starting the count from the sampling start point and ending the count after the sampling transition edge. The count value at this time is the sampling interval.
[0063] It is important to note that each sample in this step starts from the transition edge of the previous sample.
[0064] In one embodiment, each time a transition edge is sampled within a sampling period, the sampling interval of that transition edge and the corresponding actual symbol period are calculated, and the value of the new sampling interval is updated. Then, using this transition edge as the sampling starting point, the next transition edge is sampled within the updated sampling interval, and this process is repeated until the last symbol is sampled. At this point, the sampling interval is updated once for each transition edge sampled.
[0065] Combination Figure 4 As shown, in the above process, the central transition edge of the first symbol in the valid data area has been sampled (for ease of description, it will be referred to as the first symbol, the second symbol, ... the Nth symbol, where N is the number of symbols excluding the frame header), and the sampling interval Cb1 corresponding to the first symbol is obtained. Then, the actual symbol period T2 is calculated based on the sampling interval Cb1, and the sampling interval is updated based on the actual symbol period T2. Then, taking the central transition edge of the first code as the sampling starting point, within the sampling interval... Sampling is performed within the interval to obtain the central transition edge of the second symbol, and the sampling interval Cb2 corresponding to the second symbol is obtained. Based on the sampling interval Cb2, the actual symbol period T3 and the sampling interval are calculated and updated. Then, taking the central transition edge of the second code as the sampling starting point, within the sampling interval... Continue sampling within the code, repeating this process until all code elements have been sampled.
[0066] The actual symbol period can include the weighted average of the sampling interval and the initial symbol period.
[0067] Specifically, the actual symbol period T2 includes the weighted average of the sampling interval Cb1 and the initial symbol period T1; the actual symbol period T3 includes the weighted average of the sampling intervals Cb1 and Cb2 and the initial symbol period T1, and so on. Each actual symbol period includes the weighted average of all acquired sampling intervals and the initial symbol period T1. For example, the actual symbol period can be expressed by the following formula:
[0068]
[0069] in, , These are the initial symbol period T1 and the sampling interval, respectively. The corresponding weights.
[0070] By continuously updating the sampling interval based on each actual symbol period, the effects of period offset and duty cycle offset of each symbol are continuously eliminated, greatly reducing the cumulative offset and lowering the probability of decoding failure caused by offsets on subsequent symbols.
[0071] Preferably, the weighted average mentioned above is an exponentially weighted average. An exponentially weighted average is a method for weighting time series data, characterized by an exponential decay in data weight over time—recent data has a higher weight, while the influence of earlier data gradually weakens. For example, the actual symbol period can be represented as follows:
[0072]
[0073] in, , As the attenuation factor, In one specific embodiment, for ,Right now:
[0074]
[0075] By using an exponentially weighted average to calculate the actual symbol period, the influence factor of the most recent sampling interval is increased, and the reliability of recent data is highlighted while dynamically balancing historical and current symbol period data.
[0076] In other embodiments, multiple transition edges can be sampled based on the same sampling period value, and then the sampling interval and actual symbol period of these multiple transition edges can be calculated (the actual symbol period can be calculated using the method described above). Then, the value of the new sampling interval is updated based on the actual symbol period. The next transition edge is then sampled within the updated sampling interval, starting from the last sampled transition edge, and this process is repeated until all symbols have been sampled. This avoids updating the sampling interval value after each transition edge is sampled, reducing the computational load. The specific number of transition edges sampled before updating the sampling interval can be set according to the actual situation.
[0077] It should also be noted that the values of coefficients a and b can be the same or different each time the value of the sampling interval is updated based on the actual symbol period. Preferably, a is 0.75 and b is 1.25 each time the value of the sampling interval is updated based on the actual symbol period.
[0078] Next, the encoded data is decoded based on the sampling results. In the above process, by sampling the transition edge each time within the sampling interval, the central transition edge of each symbol is obtained. Then, it is only necessary to decode the corresponding 0 or 1 data according to the type of each central transition edge, thus completing the decoding work.
[0079] Furthermore, the decoding method may also include filtering preprocessing of the encoded data. Filtering preprocessing can remove glitches from the received Manchester encoded data, preventing glitches from being mistaken for edges in the Manchester encoding and interfering with decoding.
[0080] Furthermore, the decoding method may also include determining that a decoding error has occurred if no transition edge is sampled within the sampling interval.
[0081] Furthermore, the decoding method may also include verifying the decoding result. Specifically, after detecting the CRC checksum and frame end in the decoding result, the current decoding is considered complete, and the decoding process restarts only after the next frame header is detected.
[0082] Example 2
[0083] like Figure 5 As shown, the decoding device in one embodiment of the present invention is based on the decoding method described in Embodiment 1. The decoding device includes a pre-filter 10, an edge detector 20, a frame header detector 30, a period calculator 50, a decoder 40, and a verifier 60.
[0084] The input of the pre-filter 10 is used to receive encoded data, and the pre-filter 10 is used to perform filtering preprocessing on the encoded data. Specifically, it filters out glitches from the received Manchester encoded data to prevent glitches from being mistaken for edges in the Manchester encoding.
[0085] The input of edge detector 20 is connected to the output of pre-filter 10, and is used to detect the transition edges of the encoded data and output the corresponding transition edge flags. Specifically, edge detector 20 outputs rising edge flags based on the rising edge of the encoded data and falling edge flags based on the falling edge of the encoded data.
[0086] The input of the frame header detector 30 is connected to the output of the edge detector 20. It is used to detect the frame header of the encoded data based on the edge-jumping flag and output the first frame header flag bit and the second frame header flag bit that represent the first and second code elements in the frame header.
[0087] In one embodiment, the frame header detector 30 detects falling edge flags. When the first falling edge is detected, i.e., the falling edge at the beginning of the frame header is detected, the first frame header flag is output as "1". When the third falling edge is detected, i.e., the falling edge at the end of the frame header is detected, the second frame header flag is output as "0".
[0088] In other embodiments, the frame header detector 30 may also perform detection based on the actual format of the frame header.
[0089] The period calculator 50 is connected to the frame header detector 30 and the edge detector 20. The period calculator 50 is used to calculate the initial symbol period based on the first frame header flag and the second frame header flag, calculate the sampling interval based on the initial symbol period, sample the transition edges of the encoded data within the sampling interval based on the transition edge flag, calculate the actual symbol period based on the sampling interval, update the value of the sampling interval based on the actual symbol period, and continue to sample the transition edges of the encoded data within the updated sampling interval.
[0090] The decoder 40 is connected to the period calculator 50 and the edge detector 20, and is used to sample the transition edges of the encoded data in each sampling interval based on the transition edge flag, and to decode the encoded data based on the sampling results.
[0091] Verifier 60 is connected to decoder 40 and is used to verify the decoding result.
[0092] like Figure 6 As shown, the period calculator 50 includes a first counter 51, a second counter 52, and a first controller 53.
[0093] The first controller 53 is connected to the frame header detector 30, the edge detector 20, the first counter 51, and the second counter 52.
[0094] The first counter 51 starts counting based on the first frame header flag and stops counting based on the second frame header flag. It takes the average value of the count and outputs the first counter value representing the initial symbol period.
[0095] Combination Figure 7 As shown in one specific embodiment, the first controller 53 controls the first counter 51 to start counting based on the first frame header flag bit, and the first controller 53 controls the first counter 51 to stop counting based on the second frame header flag bit. At this time, the count value Ca1 of the first counter 51 is two symbol periods. Then, the first controller 53 controls the count value of the first counter 51 to shift right by one bit, that is, the count value is divided by 2. Then the first counter 51 outputs the first counter value Ca1 / 2. At this time, the first counter value Ca1 / 2 can represent the initial symbol period T1, specifically the average period between the center transition edges of multiple symbols in the frame header.
[0096] In other embodiments, the first counter 51 may also output a first counter value representing the initial symbol period based on other principles.
[0097] Then, the first controller 53 calculates the sampling interval based on the first counter value. Specifically, the value of the sampling interval can be... Where T1 is the initial symbol period, and a and b are coefficients, and , Preferably, a is 0.75, b is 1.25, and the sampling interval is... .
[0098] Next, the first controller 53 controls the second counter 52 to start counting based on the second frame header flag bit. The first controller 53 samples the transition edge of the encoded data within the sampling interval after the second counter 52 starts counting. After sampling the transition edge, the first controller 53 controls the second counter 52 to output the second counter value representing the sampling interval and restarts counting.
[0099] The first counter 51 is also used to calculate the actual symbol period based on the second counter value (i.e., the sampling interval), update the first counter value based on the actual symbol period, and the first controller 53 updates the sampling interval based on the updated first counter value and continues sampling.
[0100] In one embodiment, the actual symbol period may include: a weighted average of the sampling interval (i.e., the second counter value) and the initial symbol period (the first counter value), preferably an exponentially weighted average.
[0101] Combination Figure 7 As shown in one specific embodiment, the first controller 53 is in the sampling interval after the second counter 52 starts counting for the first time. When the center transition edge of the first symbol is sampled, the second counter 52 is controlled to output the second counter value representing the sampling interval Cb1. At the same time, the second counter 52 is cleared and starts counting again.
[0102] Simultaneously, the first counter 51 adds the first counter value to the second counter value and shifts it one position to the right to obtain the new first counter value. At this point, the actual sampling period represented by the first counter value is:
[0103]
[0104] Next, the first controller 53 updates the sampling interval based on the actual symbol period T2. And the count value of the second counter 52 enters the sampling interval. After sampling, the center transition edge of the second symbol is obtained, and the second counter 52 is controlled to output the second counter value representing the sampling interval Cb2 corresponding to the second symbol. At the same time, the second counter 52 is cleared and starts counting again.
[0105] Simultaneously, the first counter 51 adds the first counter value to the second counter value and shifts it one position to the right to obtain the new first counter value. At this point, the actual sampling period represented by the first counter value is:
[0106]
[0107] Repeat the above process until the last symbol has been sampled. It can be seen that, during the above process, the actual sampling period can be expressed as follows, based on the calculations of the first counter 51:
[0108]
[0109] in, The first calculator conveniently achieves the calculation of the actual symbol period as the exponentially weighted average of the sampling interval and the initial symbol period.
[0110] like Figure 8 As shown, the decoder 40 includes a third counter 41 and a second controller 42.
[0111] The third counter 41 starts counting based on the second frame header flag. The second controller 42 samples the transition edges of the encoded data within the corresponding sampling interval after the third counter 41 starts counting. After sampling a transition edge, it controls the third counter 41 to restart counting and continues sampling the transition edges of the encoded data within the updated sampling interval. The second controller 42 is also used to decode the encoded data based on the sampling results. The second controller 42 can be connected to the first controller 53 to obtain the values of each sampling interval.
[0112] Combination Figure 7 As shown in one specific embodiment, after the third counter 41 starts counting based on the second frame header flag, the second controller 42 in the sampling interval corresponding to the first symbol... Inside, the center transition edge of the first symbol is sampled, the third counter 41 is cleared and restarted, and the second controller 42 decodes the center transition edge and outputs the first data "0".
[0113] Next, the second controller 42 enters the sampling interval corresponding to the second symbol when the count value of the third counter 41 enters the sampling interval. Afterwards, the center transition edge of the second symbol is sampled, the third counter 41 is cleared and restarted, and the second controller 42 decodes the center transition edge and outputs the second bit data "1".
[0114] Repeat the above process until all symbols have been sampled.
[0115] In the above process, if no transition edge is sampled in any sampling interval, the first controller 53 and the second controller 42 can determine that the decoding has failed.
[0116] Finally, the verifier 60 verifies the decoding result. Specifically, after detecting the CRC check bit and the end of the frame, the verifier 60 determines that decoding is complete. Then, the verifier 60 can control the frame header detector 30, the period calculator 50, and the first counter 51, the second counter 52, and the third counter 41 in the decoder 40 to be cleared and reset, waiting for the next decoding.
[0117] In other embodiments, the pre-filter 10 may not be provided.
[0118] In other embodiments, the edge detector 20 may be omitted, and the frame header detector 30, period calculator 50, and decoder 40 may directly sample the transition edges of the encoded data.
[0119] In other embodiments, the CRC checker 60 may not be provided.
[0120] like Figure 9 As shown, this embodiment also provides a decoding module 70, including at least one processor 71, a memory 72 (e.g., non-volatile memory), a main memory 73, and a communication interface 74, and the at least one processor 71, memory 72, main memory 73, and communication interface 74 are connected together via a bus 75. The at least one processor 71 executes at least one computer-readable instruction stored or encoded in the memory 72.
[0121] It should be understood that the computer-executable instructions stored in memory 72, when executed, cause at least one processor 71 to perform the various operations and functions described in the various embodiments of this specification.
[0122] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the various operations and functions described in the various embodiments of this specification.
[0123] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0127] It will be apparent to those skilled in the art that this disclosure is not limited to the details of the exemplary embodiments described above, and that this disclosure can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of this disclosure is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this disclosure. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0128] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A decoding method for Manchester encoded data, characterized in that, include: Obtain the initial symbol period, which includes the average period of multiple symbols in the encoded data, a preset period value, and any one of the actual sampled symbol periods; calculate the sampling interval based on the initial symbol period. The transition edges of the encoded data within the sampling interval are sampled, and the actual symbol period is calculated based on the sampling interval. The actual symbol period includes the weighted average of the sampling interval and the initial symbol period. The sampling interval is updated based on the actual symbol period T2. , where a and b are coefficients, and , And continue to sample the transition edges of the encoded data within the updated sampling interval to continue updating the sampling interval; Based on the updated sampling interval, the transition edges of the encoded data within each sampling interval are sampled to obtain sampling results, and the encoded data is decoded based on the sampling results.
2. The decoding method according to claim 1, characterized in that, The weighted average is an exponentially weighted average.
3. The decoding method according to claim 1, characterized in that, The decoding method further includes performing filtering preprocessing on the encoded data; and / or The decoding method further includes determining that a decoding error has occurred if no transition edge is sampled within the sampling interval. and / or The decoding method also includes verifying the decoding result.
4. A decoding apparatus, based on the decoding method according to any one of claims 1 to 3, characterized in that, The decoding device includes: The frame header detector is used to detect the frame header of encoded data and outputs the first frame header flag bit and the second frame header flag bit, which represent the first and second code bits in the frame header. The period calculator is used to calculate the initial symbol period based on the first frame header flag and the second frame header flag, calculate the sampling interval based on the initial symbol period, sample the transition edges of the encoded data within the sampling interval, calculate the actual symbol period based on the sampling interval, update the value of the sampling interval based on the actual symbol period, and continue to sample the transition edges of the encoded data within the updated sampling interval to continue updating the sampling interval. A decoder is used to sample the transition edges of the encoded data in each sampling interval based on the updated sampling interval, and to decode the encoded data based on the sampling results.
5. The decoding device according to claim 4, characterized in that, The period calculator includes a first counter, a second counter, and a first controller; The first counter starts counting based on the first frame header flag and stops counting based on the second frame header flag. The average value of the count obtained by the first counter from the start of counting based on the first frame header flag to the stop of counting based on the second frame header flag is taken, and the first counter value representing the initial symbol period is output. The first controller calculates the sampling interval based on the first counter value; The second counter starts counting based on the second frame header flag. The first controller samples the transition edge of the encoded data within the sampling interval after the second counter starts counting. After sampling the transition edge, the first controller controls the second counter to output the second counter value representing the sampling interval and restarts counting. The first counter is also used to calculate the actual symbol period based on the second counter value, update the first counter value based on the actual symbol period, and the first controller updates the sampling interval based on the updated first counter value and continues sampling.
6. The decoding device according to claim 5, characterized in that, The decoder includes a third counter and a second controller; The third counter starts counting based on the second frame header flag. The second controller samples the transition edges of the encoded data in the corresponding sampling interval after the third counter starts counting. After sampling the transition edge, the second controller controls the third counter to start counting again and continues to sample the transition edges of the encoded data in the updated sampling interval. The second controller is also used to decode the encoded data based on the sampling results.
7. The decoding device according to claim 5, characterized in that, The decoding device further includes: A pre-filter is used to perform filtering preprocessing on the encoded data; and / or An edge detector is used to detect the transition edges of the encoded data and output a corresponding transition edge flag. The frame header detector also detects the frame header based on the transition edge flag. The period calculator and decoder also sample the transition edges based on the transition edge flag; and / or A verifier is used to verify the decoding results.
8. A decoding module, characterized in that, include: At least one processor; as well as A memory that stores instructions, which, when executed by the at least one of the processors, cause the at least one of the processors to perform the decoding method as described in any one of claims 1 to 3.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the decoding method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Manchester decoding device and method based on OSP protocol
CN118487717A
Data decoding method and apparatus, electronic device, and storage medium
WO2025108397A1