CN113438052B - Signal decoding method, device, electronic equipment and storage medium - Google Patents

Signal decoding method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113438052B
CN113438052B CN202110668856.6A CN202110668856A CN113438052B CN 113438052 B CN113438052 B CN 113438052B CN 202110668856 A CN202110668856 A CN 202110668856A CN 113438052 B CN113438052 B CN 113438052B
Authority
CN
China
Prior art keywords
bit stream
decoded
sub
initial bit
bits
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110668856.6A
Other languages
Chinese (zh)
Other versions
CN113438052A (en
Inventor
刘均
覃富钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Yuanzheng Future Automobile Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yuanzheng Future Automobile Technology Co ltd filed Critical Shenzhen Yuanzheng Future Automobile Technology Co ltd
Priority to CN202110668856.6A priority Critical patent/CN113438052B/en
Publication of CN113438052A publication Critical patent/CN113438052A/en
Application granted granted Critical
Publication of CN113438052B publication Critical patent/CN113438052B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0057Block codes
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M5/00Conversion of the form of the representation of individual digits
    • H03M5/02Conversion to or from representation by pulses
    • H03M5/04Conversion to or from representation by pulses the pulses having two levels
    • H03M5/06Code representation, e.g. transition, for a given bit cell depending only on the information in that bit cell
    • H03M5/12Biphase level code, e.g. split phase code, Manchester code; Biphase space or mark code, e.g. double frequency code

Abstract

The application relates to a signal decoding method, a signal decoding device, an electronic device and a storage medium. The method comprises the following steps: receiving a level signal to be decoded; decoding the level signal to be decoded by adopting a non-return-to-zero (NRZ) mode to obtain an initial bit stream, wherein the initial bit stream comprises 2N bits, and N is an integer greater than 0; grouping the initial bit streams pairwise in a shifting mode to obtain N groups of sub bit streams; and decoding the N groups of sub bit streams to obtain decoded data. And a group of sub bit streams are processed each time, so that the probability of errors in the decoding process is reduced, and the decoding accuracy is improved.

Description

Signal decoding method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of information technology, and in particular, to a signal decoding method, apparatus, electronic device, and storage medium.
Background
In a communication system, signals need to be encoded in order to match the transmitted signals with the channel and prevent interference or collision of information. The encoding is to encode the information to be transmitted by the transmitting end, so that the signal to be transmitted is matched with the channel, and the information is prevented from being interfered and collided. Encoding converts analog signals to digital signals in a communication system or encodes digital signals to digital signals more suitable for transmission. The receiving end decodes the received digital signal to obtain the required information. The decoding at the receiving end corresponds to the encoding.
Manchester encoding is a commonly used encoding method. Manchester coding (Manchester), also called split phase code, synchronous code, phase coding, is a coding method which uses level jump to represent 1 or 0, and the change rule is simple, namely each code element is represented by two level signals with different phases, namely a square wave of one period, but the phases of the 0 code and the 1 code are opposite. The manchester decoding corresponds to the manchester encoding process, and whether the code is 0 or 1 is determined according to the jump of the level. When decoding a received level signal, errors are likely to occur.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present application aims to provide a signal decoding method, apparatus, electronic device and storage medium, aiming to solve the problem that the decoding process is prone to errors.
In a first aspect, an embodiment of the present application provides a signal decoding method, including:
receiving a level signal to be decoded;
decoding the level signal to be decoded by adopting a non-return-to-zero (NRZ) mode to obtain an initial bit stream, wherein the initial bit stream comprises 2N bits, and N is an integer greater than 0;
grouping the initial bit streams pairwise in a shifting mode to obtain N groups of sub bit streams;
and decoding the N groups of sub bit streams to obtain decoded data.
In the embodiment of the application, a non-return-to-zero code mode is adopted to decode the received level signal to be decoded to obtain an initial bit stream, then the initial bit stream is grouped in pairs in a shifting mode to obtain N groups of sub bit streams, and then the N groups of sub bit streams are respectively decoded to obtain decoded data. And a group of sub bit streams are processed each time, so that the probability of errors in the decoding process is reduced, and the decoding accuracy is improved.
In one implementation manner of the first aspect, after receiving the level signal to be decoded, the method further includes:
determining the maximum value of the high-level duration time and the maximum value of the low-level duration time of the level signal to be decoded, and determining the minimum value of the high-level duration time and the low-level duration time of the level signal to be decoded;
and if the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded and the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned in a set threshold interval, executing the step of decoding the level signal to be decoded by adopting an NRZ mode.
In the embodiment of the application, the distortion of the level signal to be decoded is determined by the duration of the high level and the duration of the low level, and the level signal to be decoded is decoded under the condition that the level signal to be decoded is not distorted. The method can improve the identification rate of the equipment to the level with longer duration or the level with shorter duration in the level signal to be decoded, so that the level signal to be decoded is better converted into effective integer data, and the decoding accuracy is improved.
In one embodiment of the first aspect, the method further comprises:
and if the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded or the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned outside the set threshold interval, determining that the level signal to be decoded does not conform to the decoding condition.
In the embodiment of the application, if the maximum value of the duration of the high level in the level signal to be decoded and the maximum value of the duration of the low level in the level signal to be decoded or the minimum value of the duration of the high level in the level signal to be decoded and the minimum value of the duration of the low level in the level signal to be decoded are located outside the set threshold interval, it is indicated that the signal to be decoded is distorted in the transmission process, the decoding condition is not met, the level signal to be decoded is not decoded, the time consumed in the decoding process of the level signal to be decoded is saved, and the communication efficiency between the vehicle-mounted equipment and the tire pressure sensor is improved.
In an implementation manner of the first aspect, pairwise grouping the initial bit streams by shifting to obtain N groups of sub-bit streams includes:
and right shifting the initial bit stream by 2M bits, and taking the last two bits of the shifted initial bit stream as an (N-M) th group of sub-bit streams, wherein M is an integer less than N.
In the embodiment of the application, the target bit in the initial bit stream is shifted to the last two bits in the right shift mode, the last two bits of the shifted initial bit stream are used as a group of sub bit streams, pairwise grouping of the initial bit stream can be accurately performed, the grouping mode is simple, and errors are not prone to occurring.
In an implementation manner of the first aspect, pairwise grouping the initial bit streams by a shifting manner to obtain N groups of sub-bit streams includes:
and left-shifting the initial bit stream by 2M bits, and taking the first two bits of the shifted initial bit stream as an (M +1) th group of sub-bit streams, wherein M is an integer less than N.
In the embodiment of the application, the target bit in the initial bit stream is shifted to the first two bits in a left shifting manner, the first two bits of the shifted initial bit stream are used as a group of sub bit streams, the initial bit streams can be accurately grouped pairwise, the grouping manner is simple, and errors are not easy to occur.
In an embodiment of the first aspect, before the pairwise grouping the initial bit streams by shifting, the method further includes:
grouping the initial bit stream to obtain a first grouped bit stream, wherein the first grouped bit stream comprises 2S bits, and S is an integer less than N;
the initial bit streams are grouped pairwise in a shifting mode, and the initial bit streams are grouped pairwise in the shifting mode to obtain N groups of sub bit streams; decoding the N groups of sub-bit streams to obtain decoded data, including:
grouping the first grouped bit streams pairwise in a shifting mode to obtain S groups of sub bit streams;
and decoding the S groups of sub bit streams to obtain decoded data.
In the embodiment of the present application, the initial bit stream is grouped to obtain the grouped bit stream, and then the grouped bit stream is grouped pairwise by a shifting manner. And the grouped bit streams are grouped pairwise in a shifting mode, so that the workload is reduced, and the decoding efficiency is improved.
In one embodiment of the first aspect, the level signal to be decoded is transmitted by a tire pressure sensor.
In a second aspect, an embodiment of the present application provides a signal decoding apparatus, including:
a receiving unit for receiving a level signal to be decoded;
a first decoding unit, configured to decode the level signal to be decoded by using a non-return-to-zero (NRZ) mode to obtain an initial bit stream, where the initial bit stream includes 2N bits, and N is an integer greater than 0;
the grouping unit is used for grouping the initial bit stream pairwise in a shifting mode to obtain N groups of sub bit streams;
and the second decoding unit is used for decoding the N groups of sub bit streams to obtain decoded data.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory is configured to store one or more programs configured to be executed by the processor, and the program includes a program for performing some or all of the steps described in the first aspect of the embodiment of the present application.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform some or all of the steps as described in the first aspect of embodiments of the present application.
In the embodiment of the application, a non-return-to-zero code mode is adopted to decode the received level signal to be decoded to obtain an initial bit stream, then the initial bit stream is grouped pairwise in a shifting mode to obtain N groups of sub bit streams, and then the N groups of sub bit streams are respectively decoded to obtain decoded data. The initial bit streams are grouped pairwise by a shifting mode, other data positions except the first sub bit stream in the shifted initial bit streams are set to be zero, and a group of sub bit streams are processed each time, so that the probability of errors in the decoding process is reduced, and the decoding accuracy is improved.
Drawings
Fig. 1 is a schematic diagram of a common encoding method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a signal decoding method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another signal decoding method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a signal decoding apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To facilitate an understanding of the present application, the present application will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present application are given in the accompanying drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
In a communication system, signals need to be encoded in order to match the transmitted signals with the channel and prevent interference or collision of information. The encoding is to encode the information to be transmitted by the transmitting end, so that the signal to be transmitted is matched with the channel, and the information is prevented from being interfered and collided. Encoding converts analog signals to digital signals in a communication system or encodes digital signals to digital signals more suitable for transmission. The receiving end decodes the received digital signal to obtain the required information. The decoding at the receiving end corresponds to the encoding. Commonly used encoding methods include Non-Return-to-Zero (NRZ) Code, Manchester Code (Manchester Code), and differential Manchester Code.
As shown in fig. 1, Non-Return-to-Zero (NRZ) refers to that digital signals can be directly transmitted by using baseband, i.e. baseband refers to baseband. The baseband transmission is to transmit the electrical pulse of the digital signal directly in the line, which is the simplest transmission mode, the local area network of the short-distance communication adopts the baseband transmission, the signal level is represented by 0, 1, and after representing one code element, the voltage does not need to return to 0.
Manchester Code (Manchester Code), also called phase-splitting Code, synchronous Code, phase Code, is a coding method which uses level jump to represent 1 or 0, and the change rule is simple, namely each Code element is represented by two level signals with different phases, namely a square wave of one period, but the phase of the 0 Code and the phase of the 1 Code are opposite. In manchester encoding, there is a transition in the middle of each bit, with the transition in the middle of the bit serving as both a clock signal and a data signal.
Differential manchester encoding is also a bi-phase code, and unlike manchester encoding, the middle level-shifted side of the code symbol of this encoding is used only as a clock signal, and does not represent a data signal. The data is represented by whether there is a level transition at the beginning of each bit, with a level transition representing a 0 and without a level transition representing a 1.
The manchester decoding corresponds to the manchester encoding process, and whether the code is 0 or 1 is determined according to the jump of the level. When the received level signal is subjected to manchester decoding, whether the level signal is a 0 code or a 1 code is judged according to the jump of the level signal, and errors are easy to occur.
Based on this, the present application intends to provide a solution to the above technical problem, the details of which will be explained in the following embodiments.
Referring to fig. 2, fig. 2 is a flowchart illustrating a signal decoding method according to an embodiment of the present disclosure. As shown in fig. 2, the signal decoding method includes the following steps.
201, receiving a level signal to be decoded.
Specifically, the level signal to be decoded is a series of high and low level signals, and the device is obtained by sampling at a preset sampling frequency. In order to ensure the accuracy of the sampled level signal to be decoded, the sampling frequency should be higher than the frequency of the level signal to be decoded.
Optionally, the level signal to be decoded is sent by the tire pressure sensor.
Specifically, the tire pressure sensor is an electronic device capable of transmitting a high-frequency signal, and can interact with vehicle-mounted equipment. The tire pressure sensor sends relevant information such as tire pressure, temperature, Identification (ID) and the like to the vehicle-mounted equipment, and the vehicle-mounted equipment can send a data acquisition command to the tire pressure sensor. The signals sent by the vehicle-mounted equipment to the tire pressure sensor are low-frequency signals, and the tire pressure sensor starts to acquire tire data and sends corresponding high-frequency signals to the vehicle-mounted equipment after receiving the low-frequency signals. In the interaction process of the vehicle-mounted equipment and the tire pressure sensor, after the tire pressure sensor collects relevant information such as tire pressure, temperature, ID and the like, the collected data are coded in a Manchester coding mode, and then the coded data are sent to the vehicle-mounted equipment. The level signal to be decoded received by the vehicle-mounted equipment is a series of high and low level signals, and the level signal to be decoded needs to be decoded.
The tire pressure sensor can encode the collected data by adopting Manchester encoding and differential Manchester encoding. The transition in the middle of each bit of the differential manchester code provides only clock timing, and the beginning of each bit is used to indicate either a "0" or a "1" with a transition to a "0" and no transition to a "1". The differential Manchester encoding is performed by comparing the level signals in two consecutive cycles, and if the level in one cycle is wrong, domino type error occurs, which results in a series of data errors. And the Manchester code is a periodic level rule, and if the periodic level has errors, the next or other periods cannot be influenced. Data interaction can be carried out between the tire pressure sensor and the vehicle-mounted equipment in a Manchester code encoding mode, the Manchester code encoding mode is simple, the decoding algorithm is not complex, and the accuracy of decoding of the vehicle-mounted equipment is higher.
Further, after receiving the level signal to be decoded, the signal decoding method may further include the steps of:
(11) determining the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded, and determining the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded;
(12) and if the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded and the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned in a set threshold interval, executing the step of decoding the level signal to be decoded by adopting an NRZ mode.
Specifically, the length of the level may be determined according to a transition edge of the level signal to be decoded. In manchester coding, level transitions are used to represent binary 0's and 1's, a transition from a high level to a low level represents a 1, a transition from a low level to a high level represents a 0, or a transition from a high level to a low level represents a 0, and a transition from a low level to a high level represents a 1. In manchester encoding, there is a transition in the middle of each bit, with the transition in the middle of the bit serving as both a clock signal and a data signal. Therefore, at most two same levels in the received level signal to be decoded are adjacent, and the situation of a series of high levels or a series of low levels does not occur. If a series of high levels or a series of low levels occur, it indicates that the signal is affected by noise and distorted during transmission. It is possible to determine that the level signal to be decoded is distorted by the high level duration and the low level duration.
The high level duration and the low level duration may be determined according to the sampling frequency and the number of samples. The device collects the level signal to be decoded at a set sampling frequency, and determines the number of continuous high levels collected by the device, so as to determine the duration of the high levels in the level signal to be decoded, wherein the duration of the high levels is equal to the number of continuous high levels multiplied by the sampling time interval. For example, if the sampling time interval is 10 microseconds and the number of the consecutive high levels is 10, the duration of the high level may be determined to be 100 microseconds. The maximum value of the duration of the high level can be determined by calculating the duration of each high level and then determining the maximum value of the number of the collected continuous high levels, and then calculating the maximum value of the duration of the high level by using the maximum value of the number of the continuous high levels. The determination of the maximum value of the duration of the low level may be performed by first calculating the duration of each low level and then determining the maximum value of the duration of the low level, or may be performed by calculating the maximum value of the duration of the low level using the maximum value of the number of the collected continuous low levels. Similarly, the specific implementation of determining the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded may refer to the above determination of the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded.
The set threshold interval refers to a value interval of a high level duration or a low level duration under a normal condition. In multiple times of normal communication between the vehicle-mounted equipment and the tire pressure sensor, calculating the average value of the high level duration and the low level duration of the level signal to be decoded, which is subjected to multiple times of normal Manchester encoding. Because errors may occur in the signal transmission, transmission and reception processes, when the duration of the high level and the duration of the low level of the level signal to be decoded are limited, a certain error is allowed to exist, and the duration of the high level or the low level is normal within the allowed error range. In the embodiment of the present application, a specific value of the set threshold interval may be within 18% of fluctuation of an average value of the high level duration and the low level duration.
If the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded and the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned in a set threshold interval, which indicates that the level signal to be decoded is not distorted in the transmission process, the step of decoding the level signal to be decoded in the NRZ mode is executed, and the level signal to be decoded is decoded to obtain decoded data.
In the embodiment of the application, the distortion of the level signal to be decoded is determined by the duration of the high level and the duration of the low level, and the level signal to be decoded is decoded under the condition that the level signal to be decoded is not distorted. The method can improve the identification rate of the equipment to the level with longer duration or the level with shorter duration in the level signal to be decoded, so that the level signal to be decoded is better converted into effective integer data, and the decoding accuracy is improved.
Further, the signal decoding method further includes the steps of:
and if the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded or the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned outside a set threshold interval, determining that the level signal to be decoded does not accord with the decoding condition.
In the embodiment of the application, if the maximum value of the duration of the high level in the level signal to be decoded and the maximum value of the duration of the low level in the level signal to be decoded or the minimum value of the duration of the high level in the level signal to be decoded and the minimum value of the duration of the low level in the level signal to be decoded are located outside the set threshold interval, it is indicated that the signal to be decoded is distorted in the transmission process, the decoding condition is not met, the level signal to be decoded is not decoded, the time consumed in the decoding process of the level signal to be decoded is saved, and the communication efficiency between the vehicle-mounted equipment and the tire pressure sensor is improved.
202, decoding the level signal to be decoded by using a non-return-to-zero (NRZ) mode to obtain an initial bit stream.
Specifically, the received level signal to be decoded is a series of high and low level signals, and the level signal to be decoded is decoded in a sampling NRZ mode and converted into binary data. The conversion rule is: the high level in the level signal to be decoded is represented as 1, and the low level is represented as 0. In Manchester coding, the middle of each bit has a jump which is used as both a clock signal and a data signal, so that the level signal in the same period in the level signal to be decoded can be determined according to the clock signal carried in the level signal to be decoded, and the level in the normal fluctuation range of the level signal to be decoded, wherein the duration of the high level or the low level in the level signal to be decoded is longer than the duration of one level, is determined as two high levels or two low levels. The high level in the level signal to be decoded is represented as 1 and the low level in the level signal to be decoded is represented as 0 according to the NRZ conversion rule. After the level signal to be decoded is NRZ decoded, an initial bit stream corresponding to the level signal to be decoded can be obtained, where the initial bit stream includes 2N bits, and N is an integer greater than 0. After the initial bit stream is obtained, the initial bit stream is stored in an array for subsequent data processing of the obtained bit stream.
And 203, grouping the initial bit streams pairwise in a shifting mode to obtain N groups of sub bit streams.
Specifically, after the level signal to be decoded is decoded by using a non-return-to-zero (NRZ) mode to obtain an initial bit stream, the initial bit stream is grouped into a group of data and stored into an array. The fixed position in the array may be set as a target position, the target bit in the initial bitstream may be shifted to the target position in the array by a shifting manner, and the bitstream at the target position may be obtained to obtain a sub-bitstream. In this embodiment of the present application, the first two bits or the last two bits of the initial bit stream may be specifically used as target positions, and the target bits in the initial bit stream are shifted to the first two bits or the last two bits of the array by a shifting manner. And forming a group of sub bit streams by the first two bits or the last two bits of the shifted initial bit stream, namely forming a group of sub bit streams by the first two bits or the last two bits of the array.
Further, the grouping the initial bit streams pairwise by shifting to obtain N groups of sub-bit streams may include the following steps:
and right shifting the initial bit stream by 2M bits, and taking the last two bits of the shifted initial bit stream as an (N-M) th group of sub-bit streams, wherein M is an integer less than N.
Specifically, the last two bits of the initial bit stream may be used as the target position, the target position is shifted to the last two bits by shifting the initial bit stream to the right, and the last two bits of the shifted initial bit stream form a group of sub-bit streams, so that the initial bit stream is grouped into two groups. The initial bit stream comprises 2N bits, the 1 st group of sub-bit streams consists of the first two bits of the initial bit stream, when the 1 st group of sub-bit streams are obtained, the initial bit stream is shifted to the right by 2(N-1) bits, namely the first two bits of the initial bit stream can be shifted to the last two bits, and the shifted last two bits of the initial bit stream form the 1 st group of sub-bit streams. And the (N-M) th group of sub-bit streams are composed of the 2(N-M) -1 th bit and the 2(N-M) th bit of the initial bit stream, when the (N-M) th group of sub-bit streams are obtained, the initial bit stream is shifted to the right by 2M bits, namely, the (2(N-M) -1 th bit and the 2(N-M) th bit in the initial bit stream can be shifted to the last two bits, and the (N-M) th group of sub-bit streams are composed of the last two bits of the shifted initial bit stream.
In the embodiment of the application, the target bit in the initial bit stream is shifted to the last two bits in the right shift mode, the last two bits of the shifted initial bit stream are used as a group of sub bit streams, pairwise grouping of the initial bit stream can be accurately performed, the grouping mode is simple, and errors are not prone to occurring.
Further, the grouping the initial bit stream pairwise by shifting to obtain N groups of sub-bit streams may include the following steps:
and left-shifting the initial bit stream by 2M bits, and taking the first two bits of the shifted initial bit stream as an (M +1) th group of sub-bit streams, wherein M is an integer less than N.
Specifically, the first two bits of the initial bit stream may be used as a target position, the target position is shifted to the first two bits by shifting the initial bit stream to the left, and the first two bits of the shifted initial bit stream form a group of sub-bit streams, so that the initial bit stream is grouped into two groups. The initial bit stream comprises 2N bits, the 1 st group of sub-bit streams consists of the first two bits of the initial bit stream, when the 1 st group of sub-bit streams are obtained, the initial bit stream does not need to be shifted left, and the 1 st group of sub-bit streams are formed by the first two bits of the initial bit stream. The (M +1) th sub-bit stream is composed of the (2(M +1) -1) th bit and the 2(M +1) th bit of the initial bit stream, the initial bit stream is shifted to the left by 2M bits, namely, the (2(M +1) -1) th bit and the 2(M +1) th bit of the initial bit stream can be shifted to the first two bits, and the (M +1) th sub-bit stream is composed of the first two bits of the shifted initial bit stream.
In the embodiment of the application, the target bit in the initial bit stream is shifted to the last two bits in the right shift mode, the last two bits of the shifted initial bit stream are used as a group of sub bit streams, pairwise grouping of the initial bit stream can be accurately performed, the grouping mode is simple, and errors are not prone to occurring.
And 204, decoding the N groups of sub bit streams to obtain decoded data.
Specifically, N groups of sub-bit streams are respectively formed by shifting the initial bit stream N times and then decoding the N groups of sub-bit streams respectively corresponding to the level signals in the same period in the level signals to be decoded, so as to obtain decoded data.
The first sub-bitstream is any one of the above N groups of sub-bitstreams. Since the original bitstream includes N groups of sub-bitstreams and each group of sub-bitstreams in the N groups of sub-bitstreams needs to be decoded, for the sake of simplicity and convenience of description, in this embodiment, a group of sub-bitstreams is randomly extracted from the N groups of sub-bitstreams as a first sub-bitstream, and then the decoding of the first sub-bitstream is described as an example, where the first sub-bitstream represents any group of sub-bitstreams in the N groups of sub-bitstreams.
The bit stream of the target position of the shifted initial bit stream constitutes a first sub-bit stream. And setting the data positions except the target position in the shifted initial bit stream to be zero, and storing the data positions in a data variable. The sub-bitstream may be decoded according to values of the data variables. For example, the last two bits of the initial bitstream are used as the target position, and after the target position is shifted to the last two bits after shifting, the first sub-bitstream is composed of the last two bits of the shifted initial bitstream. And after the other data positions except the last two bits in the shifted initial bit stream are set to be zero, converting the data positions into 16-system data variables. Since manchester encoding is composed of a high level and a low level, when manchester encoding is performed on data, a high level jumps to a low level to represent a 1, and a low level jumps to a high level to represent a 0. Therefore, for two bits in the first sub-bitstream, which can only be 10 or 01, the value of the converted 16-ary data variable can only be 0x02 or 0x 01. When the value of the 16-ary data variable is 0x02, it indicates that two bits in the first sub-bitstream are 10, i.e. there is a high level jump to a low level in the signal corresponding to the level to be decoded, and therefore when the value of the 16-ary data variable is 0x02, the decoded data corresponding to the first sub-bitstream is 1; when the value of the 16-ary data variable is 0x01, the decoded data corresponding to the first sub-bitstream is 0.
In the embodiment of the application, a non-return-to-zero code mode is adopted to decode the received level signal to be decoded to obtain an initial bit stream, then the initial bit stream is grouped in pairs in a shifting mode to obtain N groups of sub bit streams, and then the N groups of sub bit streams are respectively decoded to obtain decoded data. The initial bit streams are grouped pairwise by a shifting mode, other data positions except the first sub bit stream in the shifted initial bit streams are set to be zero, and a group of sub bit streams are processed each time, so that the probability of errors in the decoding process is reduced, and the decoding accuracy is improved. Meanwhile, the first sub-bit stream is converted into a 16-system data variable, and the first sub-bit stream is decoded according to the value of the 16-system data variable, so that the decoding mode is simple, and errors are not easy to occur.
Referring to fig. 3, fig. 3 is a flowchart illustrating another signal decoding method according to an embodiment of the present disclosure. As shown in fig. 3, the signal decoding method includes the following steps.
301, receiving a level signal to be decoded.
The specific implementation of step 301 may refer to the specific description of step 201 shown in fig. 2, and is not described herein again.
And 302, decoding the level signal to be decoded by adopting a non-return-to-zero (NRZ) mode to obtain an initial bit stream.
The specific implementation of step 302 may refer to the specific description of step 202 shown in fig. 2, and is not described herein again.
303, grouping the initial bit stream to obtain a first grouped bit stream.
Specifically, the level signal to be decoded is decoded in a non-return-to-zero NRZ manner to obtain an initial bit stream, where the initial bit stream includes 2N bits. And after the initial bit stream is obtained, grouping the initial bit stream to obtain a plurality of groups of grouped bit streams, and then respectively decoding each group of grouped bit streams. The original bit stream may be grouped by the number of bits, with the number of bits of the resulting multi-group packetized bit stream being fixed.
The first packetized bitstream is any one of the groups of packetized bitstreams described above. Since the initial bit stream includes N groups of packet bit streams and each group of packet bit streams in the N groups of packet bit streams needs to be decoded, in order to make the description more convenient and concise, in this embodiment, a group of packet bit streams is randomly extracted from the plurality of packet bit streams as a first packet bit stream, and then the decoding of the first packet bit stream will be described as an example, where the first packet bit stream represents any group of packet bit streams in the plurality of packet bit streams.
The first packetized bit stream includes 2S bits, S is an integer less than N, and each 2S bits in the initial bit stream are grouped to obtain a first packetized bit stream. The first two bits in the first grouped bit stream correspond to the level signals in the same period in the level signals to be decoded. Specifically, 2S may be 16, that is, 16 bits in the original bit stream are formed into the first packet bit stream. And combining the 16 bits in the first grouped bit stream into a group of 16-system data and storing the 16-system data in an array.
And 304, grouping the first grouped bit stream pairwise in a shifting mode to obtain S groups of sub bit streams.
Specifically, 2S bits in the first packetized bit stream are grouped into a set of 16-ary data and stored in the array. The fixed position in the array can be set as a target position, the target bit in the first packet bit stream is shifted to the target position of the array in a shifting mode, and the bit stream on the target position of the array is obtained to obtain the sub-bit stream. Specifically, the last two digits of the array may be used as a target position, the target position in the first group of bit streams is shifted to the target position of the target array in a right shift manner, and then the last two digits of the array are taken to obtain a group of sub-bit streams.
Assuming that the first packetized bitstream includes 16 bits, shifting the first packetized bitstream may be accomplished by performing the following code:
for(j=0;j<8;j++)
{temp=*NRZ_DATA>>((7-j)<<1);}
NRZ _ DATA is an array of 16 bits in the first packetized bitstream, and the DATA variable temp is a 16-ary variable. The code is used for grouping the 16 bits in the first grouped bit stream two by two from the beginning to obtain 8 groups of sub bit streams, and storing the obtained sub bit streams in a data variable temp.
The S groups of sub-bitstreams are decoded 305 to obtain decoded data.
The specific implementation of step 305 may refer to the specific description of step 204 shown in fig. 2, and is not described herein again.
In the embodiment of the present application, the initial bit stream is grouped to obtain the grouped bit stream, and then the grouped bit stream is grouped pairwise by a shifting manner. And the grouped bit streams are grouped pairwise in a shifting mode, so that the workload is reduced, and the decoding efficiency is improved. Meanwhile, the grouped data is stored in the 16-system array, the data variable is obtained in a shifting mode, the sub-bit stream is decoded according to the value of the variable, the decoded data is obtained, judgment is easy, and decoding errors are avoided.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a signal decoding apparatus according to an embodiment of the present disclosure. As shown in fig. 4, the signal decoding apparatus 400 includes a receiving unit 401, a first decoding unit 402, a grouping unit 403, and a second decoding unit 404.
The receiving unit 401 is configured to receive a level signal to be decoded;
the first decoding unit 402 is configured to decode the level signal to be decoded by using a non-return-to-zero NRZ method to obtain an initial bit stream, where the initial bit stream includes 2N bits, and N is an integer greater than 0.
The grouping unit 403 is configured to group the initial bit streams pairwise by shifting to obtain N groups of sub bit streams.
The second decoding unit 404 decodes the N groups of sub bit streams to obtain decoded data.
In the embodiment of the application, a non-return-to-zero code mode is adopted to decode the received level signal to be decoded to obtain an initial bit stream, then the initial bit stream is grouped pairwise in a shifting mode to obtain N groups of sub bit streams, and then the N groups of sub bit streams are respectively decoded to obtain decoded data. The initial bit streams are grouped pairwise through a shifting mode, other data positions except the first sub bit stream in the shifted initial bit streams are set to be zero, and one group of sub bit streams are processed each time, so that the probability of errors in the decoding process is reduced, and the decoding accuracy is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and as shown in fig. 5, the electronic device 500 includes a processor 501 and a memory 502. The processor 501 and the memory 502 may be connected to each other by a communication bus 503. The communication bus 503 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 503 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus. The memory 502 is used for storing a computer program comprising program instructions, and the processor 501 is configured for invoking the program instructions, the program comprising instructions for performing some or all of the steps of the method shown in fig. 2.
The processor 501 may be a general purpose Central Processing Unit (CPU), a microprocessor, an Application-Specific Integrated Circuit (ASIC), or one or more Integrated circuits for controlling the execution of programs according to the above schemes.
The Memory 502 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The electronic device 500 may further include a communication interface including a Universal Serial Bus (USB) interface, which may be used to connect an external storage medium.
In addition, the electronic device 500 may further include general components such as an antenna, which will not be described in detail herein.
Embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the signal decoding methods described in the method embodiments shown in fig. 2.
It should be understood that the application of the present application is not limited to the above examples, and that modifications or changes may be made by those skilled in the art based on the above description, and all such modifications and changes are intended to fall within the scope of the appended claims.

Claims (10)

1. A method of decoding a signal, comprising:
receiving a level signal to be decoded;
decoding the level signal to be decoded by adopting a non-return-to-zero (NRZ) mode to obtain an initial bit stream, wherein the initial bit stream comprises 2N bits, and N is an integer greater than 0;
grouping the initial bit streams pairwise in a shifting mode to obtain N groups of sub bit streams; wherein, the initial bit stream is formed into a group of data and stored in an array; shifting the target bit in the initial bit stream to the first two bits in the array in a shifting mode, and forming a group of sub bit streams by the first two bits of the shifted initial bit stream; or, the target bit in the initial bit stream is shifted to the last two bits in the array by a shifting mode, and the last two bits of the shifted initial bit stream form a group of sub bit streams; setting other data positions except the sub bit stream in the shifted initial bit stream to be zero;
decoding the N groups of sub bit streams to obtain decoded data; wherein one set of sub-bitstreams is decoded at a time.
2. The method of claim 1, wherein after receiving the level signal to be decoded, the method further comprises:
determining the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded, and determining the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded;
and if the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded and the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned in a set threshold interval, executing the step of decoding the level signal to be decoded by adopting an NRZ mode.
3. The method of claim 2, further comprising:
and if the maximum value of the duration of the high level and the maximum value of the duration of the low level in the level signal to be decoded or the minimum value of the duration of the high level and the minimum value of the duration of the low level in the level signal to be decoded are positioned outside the set threshold interval, determining that the level signal to be decoded does not accord with the decoding condition.
4. The method of claim 1, wherein grouping the initial bit stream into two groups by shifting the initial bit stream to obtain N groups of sub-bit streams comprises:
and right shifting the initial bit stream by 2M bits, and taking the last two bits of the shifted initial bit stream as an (N-M) th group of sub bit streams, wherein M is an integer less than N.
5. The method of claim 1, wherein grouping the initial bit stream into two groups by shifting the initial bit stream to obtain N groups of sub-bit streams comprises:
and left-shifting the initial bit stream by 2M bits, and taking the first two bits of the shifted initial bit stream as an (M +1) th group of sub-bit streams, wherein M is an integer less than N.
6. The method of claim 1, wherein before said pairwise grouping the initial bit streams by shifting, the method further comprises:
grouping the initial bit stream to obtain a first grouped bit stream, wherein the first grouped bit stream comprises 2S bits, and S is an integer less than N;
grouping the initial bit streams pairwise in a shifting mode to obtain N groups of sub bit streams; decoding the N groups of sub-bit streams to obtain decoded data, including:
grouping the first grouped bit streams pairwise in a shifting mode to obtain S groups of sub bit streams;
and decoding the S groups of sub bit streams to obtain decoded data.
7. The method of claim 1, wherein the level signal to be decoded is transmitted by a tire pressure sensor.
8. A signal decoding apparatus, comprising:
a receiving unit for receiving a level signal to be decoded;
a first decoding unit, configured to decode the level signal to be decoded by using a non-return-to-zero (NRZ) mode to obtain an initial bit stream, where the initial bit stream includes 2N bits, and N is an integer greater than zero;
the grouping unit is used for grouping the initial bit streams pairwise in a shifting mode to obtain N groups of sub bit streams; wherein, the initial bit stream is formed into a group of data and stored in an array; shifting the target bit in the initial bit stream to the first two bits in the array in a shifting mode, and forming a group of sub bit streams by the first two bits of the shifted initial bit stream; or, the target bit in the initial bit stream is shifted to the last two bits in the array by a shifting mode, and the last two bits of the shifted initial bit stream form a group of sub bit streams; setting other data positions except the sub bit stream in the shifted initial bit stream to be zero;
a second decoding unit, configured to decode the N groups of sub-bit streams to obtain decoded data; wherein a group of sub-bitstreams is decoded at a time.
9. An electronic device comprising a processor and a memory for storing one or more programs configured for execution by the processor, the programs comprising instructions for performing the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method according to any one of claims 1 to 7.
CN202110668856.6A 2021-06-15 2021-06-15 Signal decoding method, device, electronic equipment and storage medium Active CN113438052B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110668856.6A CN113438052B (en) 2021-06-15 2021-06-15 Signal decoding method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110668856.6A CN113438052B (en) 2021-06-15 2021-06-15 Signal decoding method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113438052A CN113438052A (en) 2021-09-24
CN113438052B true CN113438052B (en) 2022-09-16

Family

ID=77756360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110668856.6A Active CN113438052B (en) 2021-06-15 2021-06-15 Signal decoding method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113438052B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117200939B (en) * 2023-11-08 2024-02-02 无锡国芯微高新技术有限公司 Signal decoding method, device and equipment of PSI5 interface and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1647390A (en) * 2002-04-18 2005-07-27 皇家飞利浦电子股份有限公司 Signal, storage medium, method and device for encoding, method and device for decoding
CN108737384A (en) * 2017-04-24 2018-11-02 特克特朗尼克公司 The system and method that the syntax tree generated with compiler carries out bit stream decoding

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2643481B1 (en) * 1989-02-22 1991-05-31 Peugeot METHOD AND DEVICE FOR TRANSMITTING INFORMATION BETWEEN STATIONS OF A COMMUNICATION NETWORK, IN PARTICULAR FOR A MOTOR VEHICLE
US5748123A (en) * 1995-12-20 1998-05-05 Lg Semicon Co., Ltd. Decoding apparatus for Manchester code
CN100417058C (en) * 2001-07-11 2008-09-03 中兴通讯股份有限公司 Coder-decoder for return-to-zero code or mark inverse code
DE60223649T2 (en) * 2002-03-22 2008-10-30 Stmicroelectronics S.R.L., Agrate Brianza Method and apparatus for decoding Manchester encoded signals
CN102629875B (en) * 2012-04-24 2015-09-16 广西大学 Rub the decoding circuit of Manchester's code of river encoder more
US11115141B2 (en) * 2018-04-30 2021-09-07 Nxp B.V. Wired communications device and method for operating a wired communications device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1647390A (en) * 2002-04-18 2005-07-27 皇家飞利浦电子股份有限公司 Signal, storage medium, method and device for encoding, method and device for decoding
CN108737384A (en) * 2017-04-24 2018-11-02 特克特朗尼克公司 The system and method that the syntax tree generated with compiler carries out bit stream decoding

Also Published As

Publication number Publication date
CN113438052A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
US7653165B2 (en) Pulse amplitude modulated system with reduced intersymbol interference
FI2297856T3 (en) Method for encoding a symbol, method for decoding a symbol, method for transmitting a symbol from a transmitter to a receiver, encoder, decoder and system for transmitting a symbol from a transmitter to a receiver
RU96118250A (en) METHOD FOR TRANSFORMING A SEQUENCE OF M-BIT INFORMATION LAYERS INTO A MODULATED SIGNAL, METHOD FOR PRODUCING A RECORDING MEDIA, A CODING DEVICE, A DECODING DEVICE, A WRITING RECORDER
US20130064330A1 (en) Semiconductor device and communication device
CN101201970A (en) Self-adaptive decoding method for wireless remote control receiving chip
CN1819504A (en) Blind detection method and apparatus, and mobile communication receiver having the same
CN110086575A (en) Coding method, coding/decoding method, relevant apparatus and storage medium
CN113438052B (en) Signal decoding method, device, electronic equipment and storage medium
CN111726312A (en) Differential signal processing apparatus, operation method thereof and method of electronic signaling
US3457510A (en) Modified duobinary data transmission
EP1790077B1 (en) Wide window decoder circuit for dual phase pulse modulation
EP0803999B1 (en) Demodulator device for data carried by subcarriers
CN110620635A (en) Decoding method, apparatus and readable storage medium
KR101723336B1 (en) Binary data compression and decompression method
EP4208966A1 (en) Digital radio receivers
JP4609425B2 (en) Wireless tag reader
CN112235221A (en) BPSK signal decoding method and device
CN1102818C (en) Data transmission by impulse position modulation and amplitude modulation
KR100940830B1 (en) Data receiving apparatus and receiving method thereof
JP4507089B2 (en) Optical receiver
CN112688892B (en) Subcarrier detection method, carrier signal demodulation method and demodulation device
CN114362770B (en) Data transmitting device, data receiving device, electronic apparatus, and method
CN113691349A (en) Data coding and decoding method and device of Sigma-Delta modulator
KR20050056839A (en) Communication device
KR100526937B1 (en) Differential Code Generator

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221026

Address after: 518000 Guangdong province Shenzhen Longgang District Bantian Street five and Avenue North 4012 Yuan Zheng Industrial Park.

Patentee after: LAUNCH TECH Co.,Ltd.

Address before: 518000 1001, building B3, phase I, Baoneng Technology Park (South District), Qinghu Industrial Zone, Gangtou community, Bantian street, Longgang District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen Yuanzheng Future Automobile Technology Co.,Ltd.