Gr4-packet-modem waveform design: Difference between revisions
(Created page with "This page documents all the aspects of the waveform used by gr4-packet-modem. == Modulation == The modulation is a single-carrier RRC (root-raised-cosine) filtered PAM (pulse amplitude modulation) waveform. The RRC filter has a roll-off of 0.35. The following constellations are defined. There are provisions in the modem to use higher-order constellations for the payload data. * BPSK. Formed by the points 1, -1, which encode the bits 0 and 1 respectively. This is...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
The modem transmitter supports two modes of operation: | The modem transmitter supports two modes of operation: | ||
* Burst mode. Each packet is radiated as a standalone RF burst, without radiation of any RF signal between packets. In this mode there is amplitude shaping: the amplitude at the beginning and end of the packet are tapered off to avoid amplifier clicks caused by sudden amplitude changes. The taper is done over the duration of 4 symbols using a quarter-sine waveform (<math>\sin t</math> for <math>0 \leq t \leq \pi/2</math>). At the beginning of the packet, the taper is applied to the first symbols of the synchronization word. At the end of the packet, the payload symbols are extended with pseudorandom QPSK symbols to which the taper is applied, in order to avoid applying the taper to payload symbols. The history of the RRC filter starts filled with zeros at the beginning of each packet and the RRC filter is flushed with zeros at the end of each packet. (''Design note:'' With an RRC filter it is not really necessary to include amplitude shaping, since the RRC pulse shape already provides a smooth amplitude change. The amplitude shaping is included mainly to mimic the operation of other modems in which it is necessary, such as modems using a constant-envelope waveform.) | * Burst mode. Each packet is radiated as a standalone RF burst, without radiation of any RF signal between packets. In this mode there is amplitude shaping: the amplitude at the beginning and end of the packet are tapered off to avoid amplifier clicks caused by sudden amplitude changes. The taper is done over the duration of 4 symbols using a quarter-sine waveform (<math>\sin t</math> for <math>0 \leq t \leq \pi/2</math>). At the beginning of the packet, the taper is applied to the first symbols of the synchronization word. At the end of the packet, the payload symbols are extended with pseudorandom QPSK symbols to which the taper is applied, in order to avoid applying the taper to payload symbols. This pseudorandom sequence is known as the ramp-down sequence. It is 9 symbols long: 5 are used to flush the RRC filter history and 4 for the amplitude taper. The modem transmitter generates a different pseudorandom sequence for each packet, and the receiver ignores its contents, so the sequence to be used is not specified in the waveform design. The history of the RRC filter starts filled with zeros at the beginning of each packet and the RRC filter is flushed with zeros at the end of each packet. (''Design note:'' With an RRC filter it is not really necessary to include amplitude shaping, since the RRC pulse shape already provides a smooth amplitude change. The amplitude shaping is included mainly to mimic the operation of other modems in which it is necessary, such as modems using a constant-envelope waveform.) | ||
* Stream mode. The transmitter radiates an RF signal continuously. The RF signal is phase continuous and composed of back-to-back packets. If there are no packets available to be transmitted, idle packets are inserted. All the stream of symbols is RRC filtered as a continuous stream, so the symbols at the beginning and end of a packet affect how the neighboring packets are modulated. This mode emulates the way that a continuous carrier system such as DVB-S2 works. | * Stream mode. The transmitter radiates an RF signal continuously. The RF signal is phase continuous and composed of back-to-back packets. If there are no packets available to be transmitted, idle packets are inserted. All the stream of symbols is RRC filtered as a continuous stream, so the symbols at the beginning and end of a packet affect how the neighboring packets are modulated. This mode emulates the way that a continuous carrier system such as DVB-S2 works. | ||
The receiver in gr4-packet-modem treats these two modes in the same way. It detects and estimates the parameters of each packet independently, without assuming that an RF signal is always present. It would be possible to design a different receiver that takes advantage of the characteristics of the stream mode. | The receiver in gr4-packet-modem treats these two modes in the same way. It detects and estimates the parameters of each packet independently, without assuming that an RF signal is always present. It would be possible to design a different receiver that takes advantage of the characteristics of the stream mode. | ||
== Packet structure == | |||
The following table describes the structure of a packet. Each of the sections of the packet is explained in more detail below. | |||
{| class="wikitable" style="margin:auto" | |||
|- | |||
! | |||
! scope="col"| Symbols | |||
! scope="col"| Constellation | |||
! scope="col"| Notes | |||
|- | |||
! scope="row"| Synchronization word | |||
|| 64 || BPSK || CCSDS 64-bit ASM | |||
|- | |||
! scope="row"| Header | |||
|| 128 || QPSK || 32 bit with r=1/4 LDPC and r=1/2 repetition | |||
|- | |||
! scope="row | Payload | |||
|| Variable || QPSK/other || | |||
|- | |||
! scope="row" | CRC-32 | |||
|| 32 bits || QPSK/other || CRC-32 of payload | |||
|- | |||
! scope="row" | Ramp-down sequence | |||
|| 9 || QPSK || Only burst mode; pseudorandom | |||
|} | |||
== Synchronization word == | |||
The synchronization word is the CCSDS 64-bit ASM, defined in [https://public.ccsds.org/Pubs/131x0b5.pdf CCSDS 131.0-B-5], given in hex by <code>034776C7272895B0</code>. It is BPSK modulated and transmitted at the beginning of each packet. | |||
== Scrambling == | |||
The header, payload and CRC-32 sections of the packet are scrambled with an additive (synchronous) scrambler. In the transmitter, scrambling is the last operation that is done before mapping to constellation symbols. In particular, it is done before any FEC encoding. The scrambling algorithm is the 17-bit scrambler defined in [https://public.ccsds.org/Pubs/131x0b5.pdf CCSDS 131.0-B-5] Section 10.4. | |||
== Header == | |||
The header contains information about the length, format (MODCOD, etc.) and type of the packet. There is provision for user customization in the format of the header. It has 32 bits and is formed by the following fields. | |||
{| class="wikitable" style="margin:auto" | |||
|- | |||
! scope="col"| Field name | |||
! scope="col"| Bits | |||
! scope="col"| Description | |||
|- | |||
! scope="row"| Packet length | |||
|| 16 || The payload length in bytes as a 16-bit big-endian integer. | |||
|- | |||
! scope="row"| Packet type | |||
|| 8 || Indicates the packet type and MODCOD (see below). | |||
|- | |||
! scope="row | Spare | |||
|| 8 || Included to support future extensions and user customization. It is filled with the value <code>0x55</code>. | |||
|} | |||
The following values for the packet type field are defined: | |||
* <code>0x00</code> Uncoded QPSK-modulated payload containing user data. | |||
* <code>0x01</code> Uncoded QPSK-modulated payload containing idle data. | |||
This list can be extended with other MODCODs and packet types. | |||
=== Header FEC === | |||
The header is encoded by a concatenation of an r=1/4 LDCP outer code and an r=1/2 repetition inner code. This r=1/8 coding results in 128 QPSK symbols and is design to allow decoding the header at SNRs as low as 0 dB Es/N0. '''Design note:''' the reason for this is that if a MODCOD is defined using state-of-the art r=1/2 FEC that works at around 0 dB Eb/N0 and QPSK modulation, then the Es/N0 will be 0 dB, so header decoding should not be the limiting factor in the design. | |||
The LDPC code is a (128, 32) LDPC code which has been designed using the PEG (progressive edge growth) algorithm with [https://github.com/daniestevez/ldpc-toolbox ldpc-toolbox]. It has a column weight of 3, and the row weight is 4 except in two of the rows (which have weights 3 and 5). Many LDPC codes with these parameters were generated pseudorandomly and simulated, and the one with a best FER at 6 dB Eb/N0 was selected. Note that with r=1/2 repetition inner coding and QPSK modulation, 6 dB Eb/N0 is equivalent to 0 dB Es/N0. In the figure below, the FER versus Eb/N0 of all the codes tested is shown, with the selected code marked in red. | |||
[[File:Gr4_packet_modem_fer_peg_codes.png]] | |||
The alist for the LDPC code can be found in the [https://github.com/daniestevez/gr4-packet-modem/blob/main/blocks/include/gnuradio-4.0/packet-modem/header_fec_decoder.hpp header_fec_decoder.hpp] file. Systematic encoding is done using a dense generator matrix. The r=1/2 repetition coding is implemented by repeating twice the 128-bit LDPC codeword to form a 256-bit vector. | |||
== Payload == | |||
The payload must have a length that is an integer number of bytes and between 1 and 65535 bytes. At the moment only uncoded QPSK-modulated payloads are defined. There is the provision to define additional MODCODs and packet types for the payload. The payload type "user data" corresponds to data from the upper layers of the application. For instance, when the modem is used for IP communications, the user data payload is an IPv4 or IPv6 frame. The payload type "idle data" is used in stream mode to insert idle packets when no other packets are available in the transmitter. The contents of an idle data payload can be arbitrary (they can be all zeros, since there is scrambling). | |||
== CRC-32 == | |||
The CRC-32 is computed over the payload bytes only. The algorithm is the commonly used CRC-32 algorithm (polynomial 0x04C11DB7). |
Latest revision as of 10:13, 21 August 2024
This page documents all the aspects of the waveform used by gr4-packet-modem.
Modulation
The modulation is a single-carrier RRC (root-raised-cosine) filtered PAM (pulse amplitude modulation) waveform. The RRC filter has a roll-off of 0.35.
The following constellations are defined. There are provisions in the modem to use higher-order constellations for the payload data.
- BPSK. Formed by the points 1, -1, which encode the bits 0 and 1 respectively. This is used for the synchronization word.
- QPSK. Formed by the points , , , , which encode the values 0, 1, 2, and 3 respectively. This is used for the header and the payload data.
The modem transmitter supports two modes of operation:
- Burst mode. Each packet is radiated as a standalone RF burst, without radiation of any RF signal between packets. In this mode there is amplitude shaping: the amplitude at the beginning and end of the packet are tapered off to avoid amplifier clicks caused by sudden amplitude changes. The taper is done over the duration of 4 symbols using a quarter-sine waveform ( for ). At the beginning of the packet, the taper is applied to the first symbols of the synchronization word. At the end of the packet, the payload symbols are extended with pseudorandom QPSK symbols to which the taper is applied, in order to avoid applying the taper to payload symbols. This pseudorandom sequence is known as the ramp-down sequence. It is 9 symbols long: 5 are used to flush the RRC filter history and 4 for the amplitude taper. The modem transmitter generates a different pseudorandom sequence for each packet, and the receiver ignores its contents, so the sequence to be used is not specified in the waveform design. The history of the RRC filter starts filled with zeros at the beginning of each packet and the RRC filter is flushed with zeros at the end of each packet. (Design note: With an RRC filter it is not really necessary to include amplitude shaping, since the RRC pulse shape already provides a smooth amplitude change. The amplitude shaping is included mainly to mimic the operation of other modems in which it is necessary, such as modems using a constant-envelope waveform.)
- Stream mode. The transmitter radiates an RF signal continuously. The RF signal is phase continuous and composed of back-to-back packets. If there are no packets available to be transmitted, idle packets are inserted. All the stream of symbols is RRC filtered as a continuous stream, so the symbols at the beginning and end of a packet affect how the neighboring packets are modulated. This mode emulates the way that a continuous carrier system such as DVB-S2 works.
The receiver in gr4-packet-modem treats these two modes in the same way. It detects and estimates the parameters of each packet independently, without assuming that an RF signal is always present. It would be possible to design a different receiver that takes advantage of the characteristics of the stream mode.
Packet structure
The following table describes the structure of a packet. Each of the sections of the packet is explained in more detail below.
Symbols | Constellation | Notes | |
---|---|---|---|
Synchronization word | 64 | BPSK | CCSDS 64-bit ASM |
Header | 128 | QPSK | 32 bit with r=1/4 LDPC and r=1/2 repetition |
Payload | Variable | QPSK/other | |
CRC-32 | 32 bits | QPSK/other | CRC-32 of payload |
Ramp-down sequence | 9 | QPSK | Only burst mode; pseudorandom |
Synchronization word
The synchronization word is the CCSDS 64-bit ASM, defined in CCSDS 131.0-B-5, given in hex by 034776C7272895B0
. It is BPSK modulated and transmitted at the beginning of each packet.
Scrambling
The header, payload and CRC-32 sections of the packet are scrambled with an additive (synchronous) scrambler. In the transmitter, scrambling is the last operation that is done before mapping to constellation symbols. In particular, it is done before any FEC encoding. The scrambling algorithm is the 17-bit scrambler defined in CCSDS 131.0-B-5 Section 10.4.
Header
The header contains information about the length, format (MODCOD, etc.) and type of the packet. There is provision for user customization in the format of the header. It has 32 bits and is formed by the following fields.
Field name | Bits | Description |
---|---|---|
Packet length | 16 | The payload length in bytes as a 16-bit big-endian integer. |
Packet type | 8 | Indicates the packet type and MODCOD (see below). |
Spare | 8 | Included to support future extensions and user customization. It is filled with the value 0x55 .
|
The following values for the packet type field are defined:
0x00
Uncoded QPSK-modulated payload containing user data.0x01
Uncoded QPSK-modulated payload containing idle data.
This list can be extended with other MODCODs and packet types.
Header FEC
The header is encoded by a concatenation of an r=1/4 LDCP outer code and an r=1/2 repetition inner code. This r=1/8 coding results in 128 QPSK symbols and is design to allow decoding the header at SNRs as low as 0 dB Es/N0. Design note: the reason for this is that if a MODCOD is defined using state-of-the art r=1/2 FEC that works at around 0 dB Eb/N0 and QPSK modulation, then the Es/N0 will be 0 dB, so header decoding should not be the limiting factor in the design.
The LDPC code is a (128, 32) LDPC code which has been designed using the PEG (progressive edge growth) algorithm with ldpc-toolbox. It has a column weight of 3, and the row weight is 4 except in two of the rows (which have weights 3 and 5). Many LDPC codes with these parameters were generated pseudorandomly and simulated, and the one with a best FER at 6 dB Eb/N0 was selected. Note that with r=1/2 repetition inner coding and QPSK modulation, 6 dB Eb/N0 is equivalent to 0 dB Es/N0. In the figure below, the FER versus Eb/N0 of all the codes tested is shown, with the selected code marked in red.
The alist for the LDPC code can be found in the header_fec_decoder.hpp file. Systematic encoding is done using a dense generator matrix. The r=1/2 repetition coding is implemented by repeating twice the 128-bit LDPC codeword to form a 256-bit vector.
Payload
The payload must have a length that is an integer number of bytes and between 1 and 65535 bytes. At the moment only uncoded QPSK-modulated payloads are defined. There is the provision to define additional MODCODs and packet types for the payload. The payload type "user data" corresponds to data from the upper layers of the application. For instance, when the modem is used for IP communications, the user data payload is an IPv4 or IPv6 frame. The payload type "idle data" is used in stream mode to insert idle packets when no other packets are available in the transmitter. The contents of an idle data payload can be arbitrary (they can be all zeros, since there is scrambling).
CRC-32
The CRC-32 is computed over the payload bytes only. The algorithm is the commonly used CRC-32 algorithm (polynomial 0x04C11DB7).