Disclosure of Invention
The embodiment of the invention aims to provide a QAM signal modulation method, a QAM signal modulation device and electronic equipment so as to improve transmission efficiency. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for modulating a QAM signal, where the method includes:
acquiring a target binary signal sequence;
dividing the target binary signal sequence into a plurality of subsequences according to a preset number;
determining constellation points corresponding to each subsequence based on a preset constellation diagram and the occurrence frequency of the subsequences, wherein the preset constellation diagram is established in advance according to an equation of Huffman coding probability, the distance between every two adjacent constellation points is equal, the subsequences corresponding to at least two constellation points are the same, and the subsequences consist of the preset number of binary code words;
modulating the target binary signal sequence based on the determined constellation point.
Optionally, the step of determining the constellation point corresponding to each subsequence based on the preset constellation diagram and the number of times of occurrence of the subsequence includes:
determining the subsequence with the occurrence number more than 1 as a target subsequence;
for each target subsequence, determining whether the target subsequence corresponds to two constellation points in the constellation diagram;
if yes, aiming at the target subsequence, when the target subsequence appears for the ith time, determining a constellation point corresponding to the target subsequence as a first preset constellation point; when the target subsequence appears for the jth time, determining that the constellation point corresponding to the target subsequence is a second preset constellation point, wherein i is an odd number, and j is an even number;
and determining a third preset constellation point corresponding to each other subsequence according to a preset mapping relation aiming at other subsequences corresponding to one constellation point.
Optionally, the step of modulating the target binary signal sequence based on the determined constellation point includes:
determining a preset probability corresponding to each constellation point;
and modulating the target binary signal sequence according to each preset probability.
Optionally, the determining manner of the preset probability includes:
according to formula P1×n1+P2×n2+…+Pl×nlCalculating the preset probability corresponding to each constellation point as 1;
wherein n is
1、n
2、...n
lRespectively the number of each type of constellation point,
P
1、P
2…P
lprobability, m, corresponding to each type of constellation point
1、m
2、...m
lThe constellation points of the same type are the same distance from the origin in the constellation diagram.
Optionally, the preset number is 4.
In a second aspect, an embodiment of the present invention provides a QAM signal modulation apparatus, where the apparatus includes:
the signal sequence acquisition module is used for acquiring a target binary signal sequence;
the sequence dividing module is used for dividing the target binary signal sequence into a plurality of subsequences according to a preset number;
the constellation point determining module is used for determining constellation points corresponding to each subsequence based on a preset constellation diagram and the occurrence frequency of the subsequences, wherein the preset constellation diagram is established in advance according to an equation of Huffman coding probability, the distance between every two adjacent constellation points is equal, the subsequences corresponding to at least two constellation points are the same, and the subsequences are composed of the preset number of binary code words;
a modulation module, configured to modulate the target binary signal sequence based on the determined constellation point.
Optionally, the constellation point determining module includes:
a target subsequence determining sub-module, configured to determine the subsequence whose occurrence number is greater than 1 as a target subsequence;
the judgment sub-module is used for determining whether each target subsequence corresponds to two constellation points in the constellation diagram;
a constellation point first determining sub-module, configured to determine, for the target subsequence, that the constellation point corresponding to the target subsequence is a first preset constellation point when the target subsequence appears for the ith time if the target subsequence has two constellation points corresponding to the target subsequence in the constellation diagram; when the target subsequence appears for the jth time, determining that the constellation point corresponding to the target subsequence is a second preset constellation point, wherein i is an odd number, and j is an even number;
and the constellation point second determining submodule is used for determining a third preset constellation point corresponding to each other subsequence according to the preset mapping relation aiming at the other subsequences corresponding to one constellation point.
Optionally, the modulation module includes:
the probability determination submodule is used for determining a preset probability corresponding to each constellation point, wherein the preset probability is predetermined by the probability calculation submodule based on an equation of the Huffman coding probability;
and the signal modulation submodule is used for modulating the target binary signal sequence according to each preset probability.
Optionally, the probability calculation sub-module includes:
a probability calculation unit for calculating the probability of the current time according to the formula P1×n1+P2×n2+…+Pl×nlCalculating the preset probability corresponding to each constellation point as 1;
wherein n is
1、n
2、...n
lRespectively the number of each type of constellation point,
P
1、P
2…P
lprobability, m, corresponding to each type of constellation point
1、m
2、...m
lThe constellation points of the same type are the same distance from the origin in the constellation diagram.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the steps of the QAM signal modulation method when executing the program stored in the memory.
In the scheme provided by the embodiment of the invention, an electronic device can acquire a target binary signal sequence, then divide the target binary signal sequence into a plurality of subsequences according to a preset number, and determine constellation points corresponding to each subsequence based on a preset constellation diagram and the occurrence frequency of the subsequences, wherein the preset constellation diagram is established in advance according to an equation of Huffman coding probability, the distance between every two adjacent constellation points is equal, at least two subsequences corresponding to the constellation points are the same, and the subsequences are composed of a preset number of binary code words; the target binary signal sequence may then be modulated based on the determined constellation points. Therefore, one subsequence can correspond to a plurality of constellation points, so that the number of constellation points in a preset constellation diagram can be increased, the number of combinations of amplitude values and phases can also be increased, and the electronic equipment modulates a target binary signal sequence according to the constellation points in the preset constellation diagram, so that the transmission efficiency can be improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a QAM signal modulation method, a QAM signal modulation device, electronic equipment and a computer-readable storage medium for transmission efficiency.
First, a method for modulating a QAM signal according to an embodiment of the present invention is described below. The QAM signal modulation method provided by the embodiment of the present invention may be applied to any electronic device that needs to modulate a signal, for example, a signal transmitting device, a processor, and the like.
As shown in fig. 1, a signal modulation method may include:
s101, acquiring a target binary signal sequence;
s102, dividing the target binary signal sequence into a plurality of subsequences according to a preset number;
s103, determining a constellation point corresponding to each subsequence based on a preset constellation diagram and the occurrence frequency of the subsequences;
the preset constellation diagram is established in advance according to an equation of Huffman coding probability, wherein the distance between every two adjacent constellation points is equal, at least two subsequences corresponding to the two constellation points are the same, and the subsequences consist of the preset number of binary code words.
And S104, modulating the target binary signal sequence based on the determined constellation point.
It can be seen that in the scheme provided by the embodiment of the present invention, an electronic device may obtain a target binary signal sequence, then divide the target binary signal sequence into a plurality of subsequences according to a preset number, and determine constellation points corresponding to each subsequence based on a preset constellation diagram and the number of times of occurrence of the subsequences, where the preset constellation diagram is established in advance according to an equation of huffman coding probability, where the distance between every two adjacent constellation points is equal, and at least two subsequences corresponding to the constellation points are the same, and the subsequences are composed of the preset number of binary codewords; the target binary signal sequence may then be modulated based on the determined constellation points. Therefore, one subsequence can correspond to a plurality of constellation points, so that the number of constellation points in a preset constellation diagram can be increased, the number of combinations of amplitude values and phases can also be increased, and the electronic equipment modulates a target binary signal sequence according to the constellation points in the preset constellation diagram, so that the transmission efficiency can be improved.
In step S101, the electronic device may acquire a target binary signal sequence transmitted by the signal source. The target binary signal sequence is a binary signal sequence that needs to be modulated.
The target binary signal sequence usually consists of a plurality of binary code words, and in order to perform modulation processing on the target binary signal sequence, after the target binary signal sequence is obtained, the electronic device may perform step S102, that is, divide the target binary signal sequence into a plurality of subsequences according to a preset number.
For example, the predetermined number may be 4, and the target binary signal sequence is 100111000100010110111001, the electronic device may divide the target binary signal sequence into the sub-sequence 1001, the sub-sequence 1100, the sub-sequence 0100, the sub-sequence 0101, the sub-sequence 1011, and the sub-sequence 1001 according to the predetermined number.
After dividing the target binary signal sequence into a plurality of subsequences, in order to determine the amplitude and phase corresponding to each subsequence, the electronic device may determine, based on a preset constellation diagram and the number of times that the subsequences appear, a constellation point corresponding to each subsequence in the target binary signal sequence.
The constellation diagram is established in advance according to a Huffman coding probability equation. In the constellation diagram, the abscissa of a constellation point represents the amplitude corresponding to the constellation point, the ordinate represents the phase corresponding to the constellation point, and the distance between every two adjacent constellation points is equal.
According to the huffman coding probability equation, the electronic device may predetermine the probability, i.e., the preset probability, corresponding to each constellation point in the constellation diagram. Generally, when the distances between the constellation points and the origin are the same, the preset probabilities corresponding to the constellation points are also the same, and the larger the preset probability corresponding to the constellation point closer to the origin is, the smaller the preset probability corresponding to the constellation point farther from the origin is. Thus, the energy consumption of signal transmission can be reduced, and the channel capacity can be improved.
Generally, the greater the number of constellation points in the constellation diagram, the higher the transmission efficiency thereof, so that a plurality of constellation points in the constellation diagram may exist to correspond to the same subsequence, and thus, the number of constellation points in the constellation diagram may be increased, and the transmission efficiency may be improved. For example, as shown in fig. 2, fig. 2 is a pre-established constellation diagram, which may be referred to as a 19-QAM constellation diagram because it has 19 constellation points, where the subsequences corresponding to the constellation point 201 and the constellation point 202 are all 0001.
According to the specific requirement of the transmission efficiency in the optical fiber communication, the electronic device may preset the same subsequences corresponding to the multiple constellation points, for example, the same subsequences corresponding to two, three, or four constellation points may be preset, which is not specifically limited herein. In the constellation diagram, the sub-sequence corresponding to each constellation point is composed of the preset number of binary code words.
The electronic device may determine the constellation point corresponding to each subsequence according to the number of times that the included subsequences appear in the target binary signal sequence.
For example, the target binary signal sequence 000111000100000110111001 includes subsequences of 0001, 1100, 0100, 0001, 1011, 1001. The frequency of occurrence of the subsequence 0001 is 2 times, and the preset constellation diagram is shown in fig. 2, where the constellation point 201 is a constellation point corresponding to the odd-numbered occurrence of the subsequence 0001, and the constellation point 202 is a constellation point corresponding to the even-numbered occurrence of the subsequence 0001. Then, when subsequence 0001 first appears, the electronic device may determine that the constellation point corresponding to subsequence 0001 is constellation point 201; when subsequence 0001 occurs a second time, the electronic device can determine that the constellation point corresponding to subsequence 0001 is constellation point 202.
After determining the constellation point corresponding to each subsequence, the electronic device may determine the amplitude and phase corresponding to each subsequence according to the coordinates of the constellation point corresponding to each subsequence in the constellation diagram. Furthermore, the electronic device may modulate the target binary signal sequence according to the amplitude and the phase corresponding to each subsequence to obtain a modulated signal, and then transmit the modulated signal to the peer device to complete the transmission of the signal.
As an implementation manner of the embodiment of the present invention, as shown in fig. 3, the step of determining the constellation point corresponding to each subsequence based on the preset constellation diagram and the number of times of occurrence of the subsequence may include:
s301, determining the subsequence with the occurrence frequency more than 1 as a target subsequence;
in order to improve the transmission efficiency, in the constellation diagram, at least two sub-sequences corresponding to the constellation point are the same. Therefore, when the number of occurrences of a sub-sequence in the target binary signal sequence is greater than 1, the sub-sequence may have a plurality of corresponding constellation points. In this way, the electronic device may determine the sub-sequence with the occurrence number greater than 1 as the target sub-sequence.
S302, aiming at each target subsequence, determining whether the target subsequence corresponds to two constellation points in the constellation diagram;
in the target binary signal sequence, there are likely to be a plurality of target subsequences that occur more than 1. However, in the preset constellation diagram, the target sub-sequences may not necessarily all correspond to two constellation points. For example, the target binary signal sequence includes a target subsequence 0001, a target subsequence 1000, and a target subsequence 1010, when the constellation diagram is the constellation diagram shown in fig. 2, the target subsequence 0001 corresponds to two constellation points, and the target subsequence 1000 and the target subsequence 1010 each correspond to one constellation point.
Thus, after determining the target subsequences, the electronic device needs to determine whether each target subsequence corresponds to two constellation points in the constellation diagram.
S303, if yes, aiming at the target subsequence, when the target subsequence appears for the ith time, determining a constellation point corresponding to the target subsequence as a first preset constellation point; when the target subsequence appears for the jth time, determining that the constellation point corresponding to the target subsequence is a second preset constellation point, wherein i is an odd number, and j is an even number;
if the target subsequence has two constellation points, when the target subsequence appears for the odd number of times, the electronic device can determine that the constellation point corresponding to the target subsequence is a first preset constellation point; when the target subsequence occurs an even number of times, the electronic device may determine that the constellation point corresponding to the target subsequence is a second preset constellation point.
The first preset constellation point and the second preset constellation point may be preset by the electronic device according to a requirement of QAM signal modulation. For example, the sub-sequence a corresponds to two constellation points, which are a constellation point a and a constellation point b, respectively, so that the constellation point a can be preset as a constellation point corresponding to the sub-sequence a occurring at the odd number of times, and the constellation point b can be preset as a constellation point corresponding to the sub-sequence a occurring at the even number of times.
And S304, determining a third preset constellation point corresponding to each other subsequence according to a preset mapping relation aiming at the other subsequences corresponding to one constellation point.
In the above constellation diagram, the subsequences except the target subsequence corresponding to two constellation points respectively correspond to one constellation point. Each constellation point in the constellation map corresponds to a subsequence including a preset number of binary code words, that is, the constellation map includes a mapping relationship between the subsequence and the constellation point, that is, a preset mapping relationship.
Therefore, for other subsequences corresponding to one constellation point, a third preset constellation point corresponding to each other subsequence can be determined according to the preset mapping relation. The other subsequences include subsequences other than the target subsequence and target subsequences corresponding to only one constellation point.
It can be seen that, in the scheme provided in the embodiment of the present invention, the electronic device may determine a subsequence whose occurrence frequency is greater than 1 as a target subsequence, and may determine, for each target subsequence, whether the target subsequence corresponds to two constellation points in a constellation diagram, if so, for the target subsequence, when the target subsequence occurs for the ith time, determine that the constellation point corresponding to the target subsequence is a first preset constellation point; when the target subsequence appears for the jth time, determining that the constellation point corresponding to the target subsequence is a second preset constellation point, wherein i is an odd number, and j is an even number; for other subsequences corresponding to one constellation point, a third preset constellation point corresponding to each other subsequence can be determined according to a preset mapping relationship. Therefore, when the target subsequence included in the target binary signal sequence is the same as the subsequence corresponding to the plurality of constellation points in the constellation diagram, the electronic device can determine that the number of the constellation points corresponding to the subsequence is two, so that the number of the constellation points can be increased, and the transmission efficiency is improved.
As an implementation manner of the embodiment of the present invention, the step of modulating the target binary signal sequence based on the determined constellation point may include:
determining a preset probability corresponding to each constellation point; and modulating the target binary signal sequence according to each preset probability.
The constellation diagram is established in advance by the electronic equipment according to a Huffman coding probability equation. According to the Huffman coding probability equation, the electronic equipment can calculate the preset probability corresponding to each constellation point in the constellation diagram.
In this way, after determining the constellation point corresponding to each sub-sequence, the electronic device may determine a preset probability corresponding to each sub-sequence. Then, the electronic device may determine the amplitude and the phase corresponding to each subsequence according to the coordinates of each constellation point, and further modulate the subsequence in the target binary signal sequence according to the amplitude and the phase corresponding to each subsequence and the preset probability.
In the above constellation diagram, the closer to the origin, the higher the preset probability of the constellation point corresponding to the constellation point, and the farther away from the origin, the lower the preset probability of the constellation point corresponding to the constellation point. And modulating the binary signal sequence according to the preset probability, so that the energy consumption of signal transmission can be reduced, and the channel capacity can be improved.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can determine the preset probability corresponding to each constellation point, and then modulate the target binary signal sequence according to each preset probability. Therefore, the electronic equipment can modulate the binary signal sequence according to the preset probability, the energy consumption of signal transmission can be reduced, and the channel capacity is improved.
As an implementation manner of the embodiment of the present invention, the determining manner of the preset probability may include:
according to formula P1×n1+P2×n2+…+Pl×nlAnd calculating the preset probability corresponding to each constellation point as 1.
Wherein n is
1、n
2、...n
lRespectively the number of each type of constellation point,
P
1、P
2…P
lprobability, m, corresponding to each type of constellation point
1、m
2、...m
lThe constellation points of the same type are the same distance from the origin in the constellation diagram.
The electronic device may calculate the preset probability corresponding to each constellation point according to the following formula:
P1×n1+P2×n2+…+Pl×nl=1
wherein the content of the first and second substances,
the electronic equipment can calculate the number n of each type of constellation points in the constellation diagram
1、n
2、...n
lSubstituting the formula to obtain the corresponding equation of the Huffman coding probability:
solving this equation, m can be determined1、m2、...mlWherein m is1、m2、...mlIs a positive integer. Therefore, the electronic equipment can obtain the probability P corresponding to each type of constellation point1、P2…Pl。
For example, the 19-QAM constellation shown in fig. 2 includes three types of constellation points. The distances between the constellation points corresponding to the subsequences 1111, 1110, 1101, 1100, 1011, 1010, 1001, 1000, 0111, 0110, 0101 and 0011 and the origin are the same, and the constellation points are marked as first-class constellation points; the distances between the constellation points corresponding to the subsequences 0001, 0100 and 0010 and the origin are the same, and the constellation points are marked as second-class constellation points; the subsequence 0000 is located at the origin and is denoted as a third constellation point.
Then the number n of constellation points of the first type1I.e. 12, the number n of the second constellation points2I.e. 6, the number n of the third constellation points3Namely 1. The number n of the first constellation points is determined1The number n of the second constellation points2And the number n of the third constellation points3Substituting the formula to obtain the corresponding equation of the Huffman coding probability:
solving the equation to obtain m
1=5、m
2=4、m
32. Thus, a predetermined probability of correspondence of the first constellation point type can be determined
Predetermined probability of corresponding constellation points of the second kind
Preset probability corresponding to third constellation point
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can calculate the preset probability corresponding to each constellation point according to the formula. Therefore, when the electronic equipment modulates the target binary signal according to the constellation point, the electronic equipment can modulate according to the preset probability corresponding to each constellation point, the energy consumption of signal transmission can be reduced, and the channel capacity is improved.
As an implementation manner of the embodiment of the present invention, the preset number may be 4. That is, each of the subsequences obtained by dividing the target binary signal sequence includes 4 binary codewords. In the preset constellation diagram, the sub-sequence corresponding to each constellation point also includes 4 binary code words. In this way, the constellation point corresponding to each sub-sequence included in the target binary signal sequence can be conveniently determined.
There may be a large amount of consecutive invalid information, e.g. 00000000, in the target binary signal sequence. In order to determine whether there is a large amount of consecutive invalid information in the target binary signal sequence, in an embodiment, the electronic device may set a fourth preset constellation point in advance for the subsequence 0000, and when the subsequence 0000 appears in the target binary signal sequence twice consecutively, the electronic device may determine that the constellation point corresponding to the subsequence 0000 appearing for the second time is the fourth preset constellation point. Therefore, when the constellation point determined by the electronic equipment is the fourth preset constellation point, a large amount of continuous invalid information in the current target binary signal sequence can be determined.
Corresponding to the QAM signal modulation method, the embodiment of the invention also provides a QAM signal modulation device. A QAM signal modulation apparatus according to an embodiment of the present invention is described below.
As shown in fig. 4, a QAM signal modulation apparatus may include:
a signal sequence obtaining module 401, configured to obtain a target binary signal sequence;
a sequence dividing module 402, configured to divide the target binary signal sequence into a plurality of subsequences according to a preset number;
a constellation point determining module 403, configured to determine, based on a preset constellation diagram and the number of times that the subsequence appears, a constellation point corresponding to each subsequence;
the preset constellation diagram is established in advance according to an equation of Huffman coding probability, wherein the distance between every two adjacent constellation points is equal, at least two subsequences corresponding to the two constellation points are the same, and the subsequences consist of the preset number of binary code words.
A modulation module 404, configured to modulate the target binary signal sequence based on the determined constellation point.
It can be seen that in the scheme provided by the embodiment of the present invention, an electronic device may obtain a target binary signal sequence, then divide the target binary signal sequence into a plurality of subsequences according to a preset number, and determine constellation points corresponding to each subsequence based on a preset constellation diagram and the number of times of occurrence of the subsequences, where the preset constellation diagram is established in advance according to an equation of huffman coding probability, where the distance between every two adjacent constellation points is equal, and at least two subsequences corresponding to the constellation points are the same, and the subsequences are composed of the preset number of binary codewords; the target binary signal sequence may then be modulated based on the determined constellation points. Therefore, one subsequence can correspond to a plurality of constellation points, so that the number of constellation points in a preset constellation diagram can be increased, the number of combinations of amplitude values and phases can also be increased, and the electronic equipment modulates a target binary signal sequence according to the constellation points in the preset constellation diagram, so that the transmission efficiency can be improved.
As an implementation manner of the embodiment of the present invention, as shown in fig. 5, the constellation point determining module 403 may include:
a target subsequence determining submodule 501, configured to determine the subsequence whose occurrence number is greater than 1 as a target subsequence;
a determining sub-module 502, configured to determine, for each target subsequence, whether the target subsequence has two corresponding constellation points in the constellation diagram;
a constellation point first determining sub-module 503, configured to determine, for the target subsequence, that the constellation point corresponding to the target subsequence is a first preset constellation point when the target subsequence appears for the ith time if the target subsequence has two constellation points corresponding to the target subsequence in the constellation diagram; when the target subsequence appears for the jth time, determining the constellation point corresponding to the target subsequence as a second preset constellation point;
wherein i is an odd number and j is an even number.
The constellation point second determining submodule 504 is configured to determine, according to the preset mapping relationship, a third preset constellation point corresponding to each other subsequence, for the other subsequences corresponding to one constellation point.
As an implementation manner of the embodiment of the present invention, the modulation module 404 may include:
a probability determination submodule (not shown in fig. 4) for determining a preset probability corresponding to each of the constellation points;
the preset probability is predetermined by the probability calculation submodule based on an equation of the Huffman coding probability.
A signal modulation submodule (not shown in fig. 4) for modulating the target binary signal sequence according to each of the preset probabilities.
As an implementation manner of the embodiment of the present invention, the probability calculation sub-module may include:
a probability calculation unit (not shown in fig. 4) for calculating a probability according to the formula P1×n1+P2×n2+…+Pl×nlAnd calculating the preset probability corresponding to each constellation point as 1.
Wherein n is
1、n
2、...n
lRespectively the number of each type of constellation point,
P
1、P
2…P
lprobability, m, corresponding to each type of constellation point
1、m
2、...m
lThe constellation points of the same type are the same distance from the origin in the constellation diagram.
As an implementation manner of the embodiment of the present invention, the preset number may be 4.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring a target binary signal sequence;
dividing the target binary signal sequence into a plurality of subsequences according to a preset number;
determining a constellation point corresponding to each subsequence based on a preset constellation diagram and the occurrence frequency of the subsequences;
the preset constellation diagram is established in advance according to an equation of Huffman coding probability, wherein the distance between every two adjacent constellation points is equal, at least two subsequences corresponding to the two constellation points are the same, and the subsequences consist of the preset number of binary code words.
Modulating the target binary signal sequence based on the determined constellation point.
It can be seen that in the scheme provided by the embodiment of the present invention, an electronic device may obtain a target binary signal sequence, then divide the target binary signal sequence into a plurality of subsequences according to a preset number, and determine constellation points corresponding to each subsequence based on a preset constellation diagram and the number of times of occurrence of the subsequences, where the preset constellation diagram is established in advance according to an equation of huffman coding probability, where the distance between every two adjacent constellation points is equal, and at least two subsequences corresponding to the constellation points are the same, and the subsequences are composed of the preset number of binary codewords; the target binary signal sequence may then be modulated based on the determined constellation points. Therefore, one subsequence can correspond to a plurality of constellation points, so that the number of constellation points in a preset constellation diagram can be increased, the number of combinations of amplitude values and phases can also be increased, and the electronic equipment modulates a target binary signal sequence according to the constellation points in the preset constellation diagram, so that the transmission efficiency can be improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The step of determining the constellation point corresponding to each subsequence based on the preset constellation diagram and the number of times of occurrence of the subsequence may include:
determining the subsequence with the occurrence number more than 1 as a target subsequence;
for each target subsequence, determining whether the target subsequence corresponds to two constellation points in the constellation diagram;
if yes, aiming at the target subsequence, when the target subsequence appears for the ith time, determining a constellation point corresponding to the target subsequence as a first preset constellation point; when the target subsequence appears for the jth time, determining that the constellation point corresponding to the target subsequence is a second preset constellation point, wherein i is an odd number, and j is an even number;
and determining a third preset constellation point corresponding to each other subsequence according to a preset mapping relation aiming at other subsequences corresponding to one constellation point.
The step of modulating the target binary signal sequence based on the determined constellation point includes:
determining a preset probability corresponding to each constellation point;
and modulating the target binary signal sequence according to each preset probability.
The determining method of the preset probability includes:
according to formula P1×n1+P2×n2+…+Pl×nlCalculating the preset probability corresponding to each constellation point as 1;
wherein n is
1、n
2、...n
lRespectively the number of each type of constellation point,
P
1、P
2…P
lprobability, m, corresponding to each type of constellation point
1、m
2、...m
lThe constellation points of the same type are the same distance from the origin in the constellation diagram.
The predetermined number may be 4.
In yet another embodiment provided by the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, the computer program, when executed by a processor, implementing the steps of:
acquiring a target binary signal sequence;
dividing the target binary signal sequence into a plurality of subsequences according to a preset number;
determining a constellation point corresponding to each subsequence based on a preset constellation diagram and the occurrence frequency of the subsequences;
the preset constellation diagram is established in advance according to an equation of Huffman coding probability, wherein the distance between every two adjacent constellation points is equal, at least two subsequences corresponding to the two constellation points are the same, and the subsequences consist of the preset number of binary code words.
Modulating the target binary signal sequence based on the determined constellation point.
It can be seen that, in the scheme provided in the embodiment of the present invention, when a computer program stored in a computer-readable storage medium is executed by a processor, a target binary signal sequence may be obtained, and then the target binary signal sequence is divided into a plurality of subsequences according to a preset number, and a constellation point corresponding to each subsequence is determined based on a preset constellation diagram and the number of times of occurrence of the subsequences, where the preset constellation diagram is established in advance according to an equation of huffman coding probability, where distances between every two adjacent constellation points are equal, and at least two subsequences corresponding to the constellation points are the same, and the subsequence is composed of the preset number of binary code words; the target binary signal sequence may then be modulated based on the determined constellation points. Therefore, one subsequence can correspond to a plurality of constellation points, so that the number of constellation points in a preset constellation diagram can be increased, the number of combinations of amplitude values and phases can also be increased, and the electronic equipment modulates a target binary signal sequence according to the constellation points in the preset constellation diagram, so that the transmission efficiency can be improved.
The step of determining the constellation point corresponding to each subsequence based on the preset constellation diagram and the number of times of occurrence of the subsequence may include:
determining the subsequence with the occurrence number more than 1 as a target subsequence;
for each target subsequence, determining whether the target subsequence corresponds to two constellation points in the constellation diagram;
if yes, aiming at the target subsequence, when the target subsequence appears for the ith time, determining a constellation point corresponding to the target subsequence as a first preset constellation point; when the target subsequence appears for the jth time, determining that the constellation point corresponding to the target subsequence is a second preset constellation point, wherein i is an odd number, and j is an even number;
and determining a third preset constellation point corresponding to each other subsequence according to a preset mapping relation aiming at other subsequences corresponding to one constellation point.
The step of modulating the target binary signal sequence based on the determined constellation point includes:
determining a preset probability corresponding to each constellation point;
and modulating the target binary signal sequence according to each preset probability.
The determining method of the preset probability includes:
according to formula P1×n1+P2×n2+…+Pl×nlCalculating the preset probability corresponding to each constellation point as 1;
wherein n is
1、n
2、...n
lRespectively the number of each type of constellation point,
P
1、P
2…P
lprobability, m, corresponding to each type of constellation point
1、m
2、...m
lThe constellation points of the same type are the same distance from the origin in the constellation diagram.
The predetermined number may be 4.
It should be noted that, for the embodiments of the apparatus, the electronic device, and the computer-readable storage medium described above, since they are substantially similar to the embodiments of the method, the description is relatively simple, and for relevant points, reference may be made to the partial description of the embodiments of the method.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The term "comprising", without further limitation, means that the element so defined is not excluded from the group consisting of additional identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.