Disclosure of Invention
The invention mainly provides a physical layer transmission signal generation method based on MFSK modulation and Chirp spread spectrum technology, and the generation flow of a transmitter signal is shown in figure 1.
The frame structure of the physical layer of the present invention is composed of preamble, frame control and payload, and the frame structure of one frame signal is shown in fig. 2. Wherein the preamble is composed of unmodulated a, modulated a, and unmodulated B. The specific format of the pre-derivative data is shown in fig. 3. Without loss of generality, can be provided withThe number of the A is 8 or more than 8. A of the modulation is 2 and is respectively set as a1And a2If a1Is set to be 4, a2Can be set as M-4, M is the modulation order of FSK modulation; a can also be set1Is 4, a2Is 8, a1,a2The specific value of (A) can be flexibly changed according to actual requirements. B is the reverse spreading of a.
The invention also provides a cyclic coding method, which divides data into 4-bit groups, adds a supervision bit to each group, and the length of a code word of each group is 7 or 8.
In another aspect, the present invention provides an interleaving method. The interleaving method comprises the following steps: determining the size of an interleaving matrix according to the size of the load data block; inputting the data into the interleaver according to columns; then, circularly shifting the data of each row in the interleaver, and circularly shifting the ith row by i data without loss of generality; and finally, reading data according to rows to complete interleaving.
The invention also provides an information mapping method, which maps the interleaved data bit into the data to be modulated in a certain mapping mode.
The invention provides a modulation method, which is based on MFSK modulation to obtain initial frequency, and then performs chirp spread spectrum to obtain a linear frequency modulation signal.
The technical scheme of the invention comprises the following steps:
(1) the physical layer receives input from a Medium Access Control (MAC) sublayer;
(2) the physical layer encodes data from the MAC layer;
(3) interleaving the encoded data;
(4) carrying out information mapping on the interleaved data;
(5) modulating the data after information mapping;
(6) generating a preamble signal;
(7) adding the preamble to generate a frame signal to enter the radio frequency link.
The invention has the following advantages:
the invention utilizes MFSK modulation and chirp spread spectrum technology, thus having many advantages. For example, the modulation technique of the present invention has the characteristics of low power consumption, high sensitivity, high reliability, etc. The method can normally communicate in a severe noise environment, and has strong channel fading resistance and strong Doppler frequency shift tolerance. The invention reduces the error rate of data and improves the robustness of the system by the modes of cyclic coding, interleaving, information mapping and the like. Reasonable selection among rate and robustness can be made through different parameter configurations.
Detailed Description
The following description of the exemplary embodiments of the present invention is intended to be taken in conjunction with the accompanying drawings, but is not intended to represent the only embodiments in which the present invention may be practiced. The term "exemplary" used throughout this description means "serving as an example, instance, or illustration," and should not necessarily be construed as preferred or advantageous over other exemplary embodiments. The detailed description includes specific details for the purpose of providing a thorough understanding of exemplary embodiments of the present invention. It will be apparent to one skilled in the art that the exemplary embodiments of the invention may be practiced without these specific details.
Referring to fig. 1, the specific implementation steps of the present invention are as follows:
step one, a physical layer receives input from a MAC layer.
Step two, the physical layer encodes the data from the MAC layer:
fig. 4 shows the working principle of the [7,4] cyclic code encoder, in which information bits are grouped into 4-bit groups, 4-bit information is sequentially sent into a shift register, and after shifting for 3 times by performing shift operation and modulo-2 addition operation, 3-bit supervisory bits are all output. Together with the 4bit information bits, form a complete code group.
[7,4]The cyclic code coding may also be according to the primitive polynomial g (x) x3And encoding the generator matrix corresponding to + x + 1.
[7,4] the generator matrix corresponding to the cyclic code is:
the [8,4] cyclic code is formed by adding a parity bit of one bit behind the [7,4] cyclic code, so that the checking capability is enhanced.
Step three, interleaving the coded data:
the interleaving process comprises the following steps: determining the size of an interleaving matrix according to the number PB of bytes sent and the number of effective information bits infoBitPerSymbol sent by each symbol; inputting the data into the interleaver according to columns; then, circularly shifting the data of each line in the interleaver; and finally, reading data according to rows to complete interleaving.
3a) Determining the size of an interleaving matrix;
the data size of the payload is defined from PB4 to PB 508. The number of valid information bits transmitted per symbol during modulation is denoted as infobitperssymbol.
The interleaver column number nColumn is shown in table 1:
table 1: number of interleaver columns
inforBitPerSymbol/PB
|
PB<16
|
16=<PB<64
|
64=<PB<128
|
PB>=128
|
1
|
8
|
16
|
32
|
64
|
2
|
8
|
16
|
32
|
64
|
3
|
6
|
12
|
24
|
48
|
4
|
8
|
16
|
32
|
64
|
5
|
5
|
20
|
40
|
80
|
6
|
6
|
24
|
48
|
96
|
7
|
7
|
14
|
28
|
56
|
8
|
8
|
16
|
32
|
64
|
9
|
9
|
18
|
36
|
72
|
10
|
10
|
20
|
40
|
80
|
11
|
11
|
22
|
44
|
88
|
12
|
12
|
24
|
48
|
96 |
The interleaver row number is calculated as follows:
where nRow represents the number of interleaving rows, PB represents the number of bytes of a transmission signal, codeRate represents the coding rate, and nColumn represents the number of columns of the interleaver.
3b) Inputting data into an interleaver in columns;
before data is input into the interleaver, the size requirement of the interleaver may not be met, zero padding is needed first, and the number of the zero padding is as follows:
where Npad indicates the number of zero padding required, PB indicates the number of bytes of a transmission signal, codeRate indicates the coding rate, and nColumn indicates the number of interleaver columns.
Then, the data is input into the interleaver column by column, and assuming that the input data is 7 and then is sized without loss of generality, the specific input method is as shown in fig. 5.
3c) Circularly shifting each row of data in the interleaver;
without loss of generality, assuming that the interleaver size is 7-interleaver, the cyclic shift method is as shown in fig. 6 below. The cyclic shift interval can be flexibly set according to specific situations, and in the embodiment, it is assumed that the cyclic shift parameter of the ith row is mod (i, bitPerSymbol), and can also be set as the cyclic shift mod (2i, bitPerSymbol) of the ith row according to actual situations.
3d) Reading data by row
And reading the data after cyclic shift according to rows, and finishing interleaving.
Step four, carrying out information mapping on the interleaved data:
the input data stream is grouped in infoBitPerSymbol bits, mapped once per infoBitPerSymbol information bit. The input data flow is carried out according to the sequence of low order advanced and high order backward.
The information mapping is to add redundant bits to the infoBitPerSymbol bits in a certain mapping mode and map the bits into bitPerSymbol bits. Finally, the bitPerSymbol bits are remapped to decimal positions.
Let the number of bits actually sent by each symbol be bitPerSymbol, and the information bit before mapping be (I)1I2…IinforBitPerSymbol-1IinforBitPerSymbol)
Wherein, IinforBitPerSymbolThe information bit indicating the position of the first infoBitPerSymbol before mapping is 0 or 1.
The mapped information bit is (m)1m2… mbitPerSymbol-1mbitPerSymbol)
Wherein m isbitPerSymbolAnd the information bit for indicating the position of the mapped bit PerSymbol is 0 or 1.
The mapping method is as follows:
m1=0;
…
mbitPerSymbol-inforBitPerSymbol=1;
mbitPerSymbol-inforBitPerSymbol+1=mod(I1+I2+…+IinforBitPerSymbol,2);
mbitPerSymbol-inforBitPerSymbol+2=mod(I2+…+IinforBitPerSymbol,2);
…
mbitPerSymbol-1=mod(IinforBitPerSymbol-1+IinforBitPerSymbol,2);
mbitPerSymbol=IinforBitPerSymbol;
the way in which the bitPerSymbol bits are mapped into decimal positions is as follows:
Li=2bitPerSymbol-inforBitPerSymbol-1
+mbitPerSymbol-inforBitPerSymbol+1×2bitPerSymbol-inforBitPerSymbol
+mbitPerSymbol-inforBitPerSymbol+2×2bitPerSymbol-inforBitPerSymbol+1
+mbitPerSymbol-inforBitPerSymbol+3×2bitPerSymbol-inforBitPerSymbol+2
+…
+mbitPerSymbol-1×2bitPerSymbol-2+mbitPerSymbol×2bitPerSymbol-1
wherein L isiThe decimal position of the bit PerSymbol bit information after mapping is represented, and L is more than or equal to 0i≤2bitPerSymbol-1。LiAlso indicates the corresponding position of the MFSK mapped frequency.
Without loss of generality, let infobibitpsersymbol be 5, bitPerSymbol be 7, information bit before mapping be (10110), information bit after mapping be (0110010), and 7bit is remapped to decimal place be loc be 38.
Step five, modulating the data after information mapping:
5a) MFSK modulation
Through the information mapping, each infoBitPerSymbol information bit is mapped to obtain a decimal position LiL of the compoundiCorresponding to the modulation frequency of the MFSK.
MFSK modulation frequency and LiThe correspondence of (a) is as follows:
wherein M is 2
bitPerSymbol,i=1,2,…2
inforBitPerSymbol,
Is expressed log
2Frequency, T, corresponding to Mbit information
sIndicates the length of time of one modulation symbol,
to represent
Without loss of generality, the starting frequency f0And may be any frequency including, but not limited to, -B/2.
The MFSK-modulated signal is represented as
5b) Chirp spread spectrum
Through MFSK modulation, the frequency is obtained
Of the signal of (1). The signal is Chirp spread, and the Chirp spread signal can be expressed as
Where y represents the time domain signal, B represents the signal bandwidth, T
sRepresenting one symbol time, M representing the number of sample points of one symbol, M-2
bitPerSymbol。
The slope k represents how fast the frequency varies linearly with time. The frequency f varies with M as shown in fig. 7.
Firstly, MFSK modulation is performed to generate the starting frequency
Then Chirp spread spectrum is carried out, and the signals after MFSK + Chirp spread spectrum mixed modulation can be representedIs composed of
Wherein, x represents the time domain signal after MFSK + Chirp spread spectrum, B represents the signal bandwidth, M represents the number of sampling points of a symbol, and M is 2
bitPerSymbol,
Indicating the starting frequency.
Without loss of generality, assuming loc is 38, the time-frequency plot after modulation is shown in fig. 10 below.
Step six, generating a leading signal,
FIG. 3 shows a preamble data structure, the preamble being modulated by 8 unmodulated A, 1 into a1One modulation is a22.25 unmodulated B. A is the basic waveform and B is the reverse spreading of A. Modulated a1And a2Can be flexibly changed according to actual requirements. Without loss of generality, if a1Is set to be 4, a2Can be set to M-4, M being the modulation order of FSK modulation, or a1Is set to be 4, a2Set to 8.
Here the starting frequency f of the MFSK is set0is-B/2, the decimal position loc corresponding to the unmodulated A is 0, and the frequency range is-B/2 to B/2. Modulation is a1Has a decimal position loc corresponding to the symbol of1In the frequency range-B/2 + a1/Ts~B/2,-B/2~-B/2+a1/Ts. Modulation is a2Has a decimal position loc corresponding to the symbol of2Frequency range-B/2 + a2/Ts~B/2,-B/2~-B/2+a2/Ts. The unmodulated B is the inverse modulation of the unmodulated A, and the frequency range is B/2 to-B/2. Specific time-frequency curves and time-domain waveforms are shown in fig. 8 and 9.
And step seven, adding the preamble to generate a frame signal to enter the radio frequency link.
The frame structure of one frame signal is shown in fig. 2. The frame structure of the physical layer consists of a preamble, a frame control and a data payload. As shown in fig. 2, each symbol has a length of nLength, where the number of leading symbols is 12.25 and the length is 12.25 × nLength. The number of symbols of the frame control and data payload is variable and is related to the infobitperssymbol of the information map.