Introduction to commonly used transfer codes


Preliminary knowledge

Before introducing the commonly used transmission codes, let's briefly introduce the DC component.
The DC component of the signal is the average value of the signal. It is a constant that has nothing to do with time. The mathematical formula of the DC component is expressed as: When judging whether there is a DC
insert image description here
component, you can see whether the areas of the upper and lower parts of the signal function diagram on the abscissa axis are equal. , there is a DC component if they are not equal. Or in the case of +1, -1 and 0 codes, the sum of all codes is 0, and there is no DC component.
Selection principles of transmission code (line code):
In terms of power spectrum : the line code should have no DC component, limit the signal bandwidth, reduce the high and low frequency components in the power spectrum, and match the transmission channel; ② In terms of timing: the
line code or its passing The baseband signal after nonlinear transformation should contain the discrete spectrum related to the timing component, which is convenient for the receiving end to extract the timing information from the signal; ③ Transparency: the
code conversion from the information symbol output by the source to the line code should be transparent
In terms of performance monitoring : the line code should preferably have inherent error detection capability, which is convenient for the receiving end to perform error detection; ⑤ In
terms of transmission reliability : in terms of given transmission conditions Under certain circumstances, the circuit code should make the error probability of the system as small as possible;
⑥In terms of equipment complexity : the circuit coding and decoding equipment should be as simple as possible.


1. AMI code

AMI code is also called 1B/1T code, which refers to the conversion of a binary symbol into a ternary symbol, which is an alternate mark reversal code.
AMI code encoding rules :
① Message code "1" (mark) is alternately transformed into "+1" and "-1";
② Message code "0" (empty number) remains unchanged.
Examples are as follows.
Code: 1 0 0 1 0 0 0 0 1 1 1
AMI code: +1 0 0 -1 0 0 0 0 +1 -1 +1
You can see that the original code has only two symbols 0 and 1, but there are three AMI codes Symbols +1, 0 and -1.
Features of AMI codes :
①Change the shape of signal power spectrum density without direct current;
②Easy to encode and decode;
③Easy to observe bit errors;
④When there are long consecutive "0" codes, it is not conducive to extract timing information.
AMI code + scrambling code can solve the problem of long consecutive "0" strings, and is widely used in North America and Japan.
Another method is to use HDB3 codes to solve the above problems.


2. HDB3 code

HDB3 code, also known as third-order high-density bipolar code, is also 1B/1T code.
HDB3 code encoding rules :
① Encode according to the rules of AMI code;
② The number of consecutive "0"s does not exceed 3, and the AMI code is HDB3 code;
③ If there are 4 consecutive "0", replace "0000" with "000V" to destroy The polarity of the symbol V is the same as that of the previous non-zero symbol, and the polarity of the V code alternates;
④ If there is an even number of non-zero codes between two adjacent V codes, replace the last "000V" with "B00V", B , The polarity of V is opposite to the polarity of the previous non-zero symbol, and the polarity of the following symbols changes alternately from V.
An example of the application of the first two coding rules follows.
Code: 1 0 0 0 1 0 0 1
HDB3 code: +1 0 0 0 -1 0 0 +1
The application examples of the first three coding rules are as follows.
Code: 1 0 0 0 0 1 0 1
HDB3 code: +1 0 0 0 +V -1 0 +1
The application examples of the first four coding rules are as follows.
Code: 1 0 0 0 0 1 1 0 0 0 0 1
Only use the first three rules, the code is: +1 0 0 0 +V -1 +1 0 0 0 +V -1, you can find the poles of the two V codes If there is no alternation of sex, the fourth coding rule is used.
First use "B00V" to replace the latter "000V", at this time the code is: +1 0 0 0 +V -1 +1 B 0 0 +V -1 B
, the polarity of V is opposite to the polarity of the previous non-zero symbol, At this time, change the code to: +1 0 0 0 +V -1 +1 -B 0 0 -V -1 The
sign behind the sign changes polarity alternately from V, and the final code is: +1 0 0 0 +V - 1 +1 -B 0 0 -V +1
So the code: 1 0 0 0 0 1 1 0 0 0 0 1 HDB3 code is: +1 0 0 0 +V -1 +1 -B 0 0 -V +1 In recognition, ±V, ±B are
equivalent In ±1, so the above HDB3 code is identified as: +1 0 0 0 +1 -1 +1 -1 0 0 -1 +1
When decoding, if two adjacent non-zero symbols have the same sign, then the next The four symbols of the forward number of non-zero symbols are decoded into four 0s, and the remaining non-zero symbols are decoded into 1s to complete the decoding. So +1 0 0 0 +1 -1 +1 -1 0 0 -1 +1 after decoding is: 1 0 0 0 0 1 1 0 0 0 0 1, which is the same as the original code.
In the HDB3 code, the V code reduces the number of consecutive 0s to no more than 3, and the B code ensures that the polarity of the V code alternates, thereby eliminating DC.
Features of HDB3 codes :
①Change the signal power spectral density shape, no DC;
②Simple decoding;
③Have a certain error detection ability;
④No more than 3 consecutive 0 codes, which is beneficial to extract timing information;
⑤Complex coding, simple decoding .


3. PST code

PST code is also called pairwise selection ternary code.
PST code encoding rules :
① first group binary codes in pairs;
② encode each code group into two ternary numbers (+, -, 0).
The encoding rules are expressed in tables as follows.

binary code Positive (+) mode Negative (-) mode
00 - + - +
01 0 + 0 -
10 + 0 - 0
11 + - + -

In practical applications, the positive and negative modes are generally alternated.
Examples are as follows.
Code: 0 0 1 0 0 1 1 1
PST code: - + + 0 0 - + -
In the above codes, the codes of 00 and 11 are the same in positive and negative mode, and 10 is coded as + 0 in positive mode, using alternating positive and negative modes , 01 is coded as 0 - in negative mode.
Features of PST codes :
① No direct current;
② Easy to extract timing information;
③ Simple coding;
④ Packet information is required when decoding.


4. Digital biphase code

Digital biphase codes are also called Manchester codes.
Digital bi-phase code coding rules :
① "0" code is represented by "01";
② "1" code is represented by "10".
Its encoded waveform is shown in the figure below.
insert image description here
The characteristics of digital biphase code :
①No DC;
②Easy to extract timing information;
③Easy coding;
④Bandwidth doubled.


5. CMI code

CMI code is also called mark inversion code.
CMI code coding rules :
① "1" code is alternately represented by "11" and "00";
② "0" code is fixedly represented by "01".
Its encoded waveform is shown in the figure below. insert image description here
Features of CMI code :
① No DC;
② Easy to extract timing information;
③ Simple encoding;
④ Macro error detection;
⑤ Double bandwidth.


6. nBmB code

Encoding rules of nBmB codes :
①Combine the n-bit binary codes of the original information stream into a new code group of m-bit binary codes; ②Because
m>n, the new code group may have 2 m 2^m2There are m combinations, so there are more (2 m 2^m2m- 2 n 2^n 2n ) combinations, select some favorable code groups as available code groups, and the rest are forbidden code groups.
Code word digital sum(WDS): According to the requirements of optical fiber communication, in the line code, "-1" is used to represent the symbol "0", and "+1" is used to represent the symbol "1", and each code element in the entire code group corresponds to The algebraic sum obtained by adding the value "-1" or "+1" of is called the codeword digital sum (WDS).
The mB code group with the smallest code word number sum (WDS) is usually selected to represent the nB code. In the optical fiber digital transmission system, m=n+1 is usually selected, and the commonly used line codes are 3B4B code and 5B6B code.
The following table is the corresponding relationship between 3B4B code signal code and line code, in which mode 1 is called positive mode, and mode 2 is called negative mode.
insert image description here
In practical applications, in order to reduce the DC drift, the code groups whose WDS is +2 and -2 in the table are used alternately during the conversion process.
The schematic diagram of the conversion process of 3B4B code is shown in the figure below.
insert image description here
The characteristics of nBmB codes:
①The probability of "0" and "1" codes in the code stream is equal, the number of consecutive "0"s and "1"s is small, and the timing information is rich; ②The
high and low frequency components are small, and the signal spectrum characteristics are relatively small. Good, the baseline drift is small;
③Introduce a certain amount of redundant code in the code stream, which is convenient for online error detection;
④Requires code group synchronization.


Reference video:
Common code patterns for baseband transmission

Guess you like

Origin blog.csdn.net/weixin_42570192/article/details/128625400