Location>code7788 >text

[SDR] GNU Radio Tutorial Series -- Basics of GNU Radio TX PDU (Send Packet Operation) (Super Complete)

Popularity:352 ℃/2024-07-30 11:15:52

catalogs
  • 1 PDU Overview
  • 2 Demo Details
    • 2.1 Random PDU Generator
    • 2.2 Async CRC32
    • 2.3 Protocol Formatter (Async)
    • 2.4 Combining header and payload outputs
    • 2.5 Applying Burst Fill and Fade to PDUs
    • 2.6 RRC Filtering with Multiphase Arbitrary Resampling
      • 2.6.1 FIR Filter Example
      • 2.6.2 Filter Basics and RRC Knowledge
        • 1) When to use RRC?
        • 2) What is RRC?
        • 3) Difference between Gaussian filtering and ascending Yu Xuan filtering
        • 4) Filtering Basics
      • 2.6.3 Come back to understand RRC
      • 2.6.4 Understanding Resampling
  • 3 Send related small DEMO
    • 3.1 Forward Error Correction Coding
    • 3.2 Chat App
    • 3.3 PDU Operation Set Demonstration
  • Reference Links
  • Tutorial List
    • Basic Tutorial:
    • Comprehensive Tutorial:
    • SDR Widget Tutorial:
    • Basic Block Tutorial:
  • Videos and blogs


1 PDU Overview

In the field of telecommunications.Protocol Data Unit (PDU)[1] is a single unit of information that is transmitted between peer entities on a computer network. It is defined by the protocol-specificControl Information cap (a poem)user data Components. In the layered architecture of the communication protocol stack, each layer implements protocols customized for a specific type or mode of data exchange.

For example, the Transmission Control Protocol (TCP) implements a connection-oriented mode of transport where PDUs are referred to as segments, while the User Data Protocol (UDP) uses packets as PDUs for connectionless communication. At the lower level of the Internet Protocol family, the Internet layer, PDUs are referred to as packets, regardless of their payload type.

In this article, we will understand the PDU related operations of GNU Radio with some listed examples. It will lay the groundwork for us to use digital modulation to transfer files, audio, video and other data.


2 Demo Details

2.1 Random PDU Generator

The block sends a random PDU once at startup and then every time it receives a message, the first demo is as followspdu_simple_demo1_random.grc[2]


After running, a PDU is generated every 2S:

message_debug :info: The `print_pdu` port is deprecated and will be removed; forwarding to `print`.
***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =        110 bytes
pdu vector contents = 
0000: 69 e4 6c f5 94 8c 28 23 c3 26 3a 41 cf d7 fd 41 
0010: 55 d0 4c 3e 03 ed 37 59 e8 32 d9 40 f4 9d c7 79 
0020: fc 5a 11 d4 cb 95 98 8c bb ea b1 49 ae c1 64 c0 
0030: 8f 61 35 91 87 13 67 0d 5a 87 97 c7 5b ef f7 21 
0040: 27 91 65 78 63 03 ba 56 63 29 ed cb 6f 4f dc 87 
0050: 9e 2a 1e 9a 78 43 57 a7 87 b0 b7 bf fd 73 b8 15 
0060: e9 3a 81 e9 8e 27 80 d3 76 89 8b ff 72 14 
************************************

Its four parameters affect respectively: PDU length ranges from a minimum of 15 to a maximum of 150 bytes, mask does an AND operation with each byte of pdu, and the total length must beLength Modulo Multiples of.


2.2 Async CRC32

In version 3.10 this block has beenCRC_Append cap (a poem)CRC_Check Replacement.[4]

This block is used to process the byte streams of asynchronous messages, and you can choose between create mode and check mode:

  • create: add 4 more bytes after the pdu data, i.e. CRC32 of the input data
  • check: Calculate whether the CRC32 of LEN(PDU)-4 of the input data and the last 4 bytes of the PDU are equal or not, if they are equal, output the data with CRC32 removed, if they are not equal, no output.

Examples are as followstx_stage1.grc

Output LOG:

Press Enter to quit: ***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =         44 bytes
pdu vector contents = 
0000: 22 e7 d5 20 f8 e9 38 a1 4e 18 8c 47 30 8c fe f5 
0010: ff f7 f7 28 b9 f8 fb f5 1c 7c cc cc 4c 24 01 6b 
0020: 1c ea a3 ca e0 f5 80 a7 cc 09 5c d9 
************************************
***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =         48 bytes
pdu vector contents = 
0000: 22 e7 d5 20 f8 e9 38 a1 4e 18 8c 47 30 8c fe f5 
0010: ff f7 f7 28 b9 f8 fb f5 1c 7c cc cc 4c 24 01 6b 
0020: 1c ea a3 ca e0 f5 80 a7 cc 09 5c d9 db 73 02 76 
************************************

2.3 Protocol Formatter (Async)

A data frame generally consists ofHeader + content + checksum (end of frame) composition, this example shows how to add a frame headertx_stage3.grc

1)Default Header Format Obj

Default Header Format Obj [14] Default header formatter for PDU formatting. Used to process the default packet header. The default header consists of an access code and a packet length. The length is encoded as a 16-bit value repeated twice:

 | access code | hdr | payload |

When access code <= 64 bits hdr is.

 |  0 -- 15 | 16 -- 31 |
 | pkt len  | pkt len  |

Access codes and headers are formatted in network byte order.

This header generator does not compute CRCs or append CRCs to packets. Use the CRC32 asynchronous block before adding the header.

So: The meaning of the settings in the flowchart is as follows:

  • Access Code: '101010101011110101010101', up to 64 bits long, used by other blocks to find the start of the packet (Tests show that the final output of the Aceesss Code is always 8bits times 8 bits from right to left.
  • Threshold: How many bits of the access code can be wrong and still be counted as correct?
  • Payload Bits per Symbol: number of bits per symbol used in the payload modulator

2)Protocol Formatter (Async)

Protocol Formatter (Async) [15] The block can append a a header format object to the PDU. The length of the header will then measure the payload plus the CRC length (CRC32 is 4 bytes).

This block receives PDUs and creates headers, typically for MAC-level processing. Each received PDU is considered its own frame, so any fragmentation has to be processed upstream or in a previous flowchart.

The block's 'header' message port outputs the header created in the block. the header is based entirely on objects that are derived from the header_format_base class. All of these packet header format objects are the same: they receive the payload data as well as possible metadata information about the PDU.

For different packet header formatting needs, we can define new classes that inherit from the header_format_base block and overload the header_format_base::format function.


Therefore, the output after the run is:

***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =          6 bytes
pdu vector contents = 
0000: af 55 00 30 00 30 
************************************
***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =         48 bytes
pdu vector contents = 
0000: 22 e7 d5 20 f8 e9 38 a1 4e 18 8c 47 30 8c fe f5 
0010: ff f7 f7 28 b9 f8 fb f5 1c 7c cc cc 4c 24 01 6b 
0020: 1c ea a3 ca e0 f5 80 a7 cc 09 5c d9 db 73 02 76 
************************************

2.4 Combining header and payload outputs

The three examples above have finally synthesized a complete data frame, so let's try to merge the header and payload parts of it into a single output:tx_stage4.grc

The above example is based on the synthesized information in 2.3, converting the header and payload PDUs to Stream, and then outputting 1bytes of data for every 1 bit (which is actually bit 0 -> byte 0; bit 1 -> byte 1), and then the Map actually performs output[i] = map[input[]], then with the help of Chunks to Symbols, we can use the output[i] = map[input[]], then with the help of Chunks to Symbols. i]], and then with the help of Chunks to Symbols[21][22] The bytes are converted to complex numbers (using a constellation diagram conversion), and finally the two inputs are merged into an output using Tagged Steam Mux. After running and looking at the time sink graph you can see the header (0xaf 0x55 ...) -> 10101111 0101010101 ...). -> 10101111 0101010101 ...) Corresponds to: 1 -1 1 -1 1 1 1 1 -1 1 ....

Remarks: This flowchart involves knowledge of constellation diagrams, which can be referenced in the[16] [17] [18] [19] [20] [21] [22]


2.5 Applying Burst Fill and Fade to PDUs

burst shaper block The burst shaper block used to apply burst fill and ramp makes the pulse more stable and clearer by adding some compensation before and after each pulse. It has two types of compensation:

  • One is to add some zeros before and after the pulses, i.e. blanks with no signal, which avoids interference between the pulses and also regulates the interval between the pulses.
  • The other is to add some phase symbols before and after the pulse, i.e. alternating +1/-1 signals, which makes the rise and fall of the pulse smoother and also regulates the shape of the pulse.

If phasing symbols are used, an alternating pattern of +1/-1 symbols of length ceil (N/2) will be inserted before and after each burst, where N is the length of the tap vector. Slant up/slant down shapes will be applied to these phase symbols.

If the phase symbols are not used, the gradient will be applied directly to the head and tail of each burst.

The burst shaper block has the following parameters:

  • Window Taps: This is a set of coefficients used to control the rise and fall of a pulse, which can be used to change the waveform of a pulse, for example, to change a square wave into a sine wave, or to change an analog signal into a digital signal.[23] [24]

  • Pre-padding Length: This is the number of zeros added in front of each pulse, which can be used to regulate the spacing of the pulses and also to avoid interference between pulses.

  • Post-padding Length: This is the number of zeros added after each pulse, which can be used to regulate the spacing of pulses and also to avoid interference between pulses.

  • Insert Phasing Symbols: this is a boolean value indicating whether to add phasing symbols before and after each pulse, if true then alternate +1/-1 signals will be added before and after each pulse (ceil(N/2) for the upper flank, ceil(N/2) for the lower flank, and if odd, the middle tag will be used as the last one on the upper flank and the first one on the lower flank), if false then no phasing symbols will be added, instead the head and tail of the pulse will be compensated directly. be used as the last one on the upper flank, and the first one on the lower flank), and if false, then no phase sign is added, but the head and tail of the pulse are compensated directly.

  • Length Tag Name: This is the name of the tag used to mark the length of each pulse, which can be used to control the sending and receiving of pulses, or to analyze the performance of pulses.

The output of the burst shaper block is a shaped and compensated sequence of pulses whose length labels are updated to include the compensated lengths and which are placed at the beginning of the output. Other labels are placed on the appropriate outputs, depending on their location, to maintain association with the pulse.

Remarks: Window function (English: window function) in signal processing refers to a kind of real function that takes the value of 0 except in the given interval. For example, a window function that is constant within a given interval and zero outside the interval is figuratively called a rectangular window. The product of any function and the window function is still a window function, so the result of multiplication is like "looking" through a window at other functions. Window functions have a wide range of applications in spectrum analysis, filter design, beamforming, and audio data compression (e.g., in the Ogg Vorbis audio format).[23] [24]

A simple example is as follows:burst_tagger.grc

The effect after running is as follows:

Where Vector Source is 8 1's and 8 -1's, 160 samples are packed and length labeled (i.e., 10 sets of vectors) in a Stream to Tagged Stream, and then the data is sent to two Burst shaper blocks with different configurations (one enabling directional symbols, one disabling them, and both using Haining windows, N=50):

  • So the first output is: 25 alternating 1,-1 signals in the upper wing (acting as a Haining window), then 160 samples, then 25 alternating 1,-1 signals in the lower wing, and finally padding 20 0 signals. The total length of the final data is therefore: 25+160+25+20 = 230

  • So the second output data is: Haining window directly acts on the first 25 of the 160 samples to form the upper wing, acts on the second 25 to form the lower wing, does not act on the middle 110, and finally padding 20 0 signals. So the total length of the final data is: 160+20=180

Further, we can build on the full data frame of 2.4 by adding burst shaper (with 10 zeros filled in front and back, using a Haining window to enable directional symbols) ->tx_stage5.grc


2.6 RRC Filtering with Multiphase Arbitrary Resampling

2.6.1 FIR Filter Example

First look at the effect of a few common filtersfilter_taps.grc

The effect is as follows:

Among them:

1) Low-pass filter: cutoff frequency of 14K, bandwidth of 1K, look at the figure can be directly get to the
2) High-pass filter: cutoff frequency of 2K, bandwidth of 1K, look at the figure can also get
3) Bandpass filter: set 6K to 10K, also can see the graph get
4) Band reject filter: set 6K to 10K, also can see the graph get
5) RRC Root Root (Square Root) Rising Cosine Filters need to be described separately.


2.6.2 Filter Basics and RRC Knowledge

A few additional basics are needed to understand RRC

1) When to use RRC?

In digital communication systems, before the baseband signal enters the modulator, the waveform is a rectangular pulse, and the abrupt rising and falling edges contain abundant high-frequency components; the spectrum of the signal is generally wide, and when passing through a band-limited channel, the pulses of the individual symbols will be extended into the code elements of the neighboring symbols, generating inter-code crosstalk. Therefore, in the case of limited channel bandwidth, to reduce the BER, it is necessary to perform pulse shaping processing on the signal through the transmitter filter (pulse shaping filter) before transmission to improve its spectral characteristics and produce a waveform suitable for channel transmission. Commonly used waveform shaping filters in digital systems are rising-coefficient pulse filters, square-root rising-coefficient filters, Gaussian filters, and so on.[32]


2) What is RRC?

Raised cosine filters: A Raised-cosine filter is a type of pulse-forming filter that is often used to minimize inter-code interference (ISI). It is so named because the filter's spectrum in its simplest form (\(\beta = 1\)The nonzero part of ) is a cosine function and is lifted above the horizontal axis[33] [34]

The math describes it as:

A rising cosine filter is a realization of a low-pass Nyquist filter, i.e. a filter with symmetry. This means that it has a spectrum inf=± 1/(2T) exhibits odd symmetry (Ts is the sign rate) as follows:

Leads to a root-lift Yuhuan filter:

When used to filter the stream of charismatic elements, the Nyquist filter has the property of eliminating ISIs because, in addition to the\(n = 0\) All\(nT\)(n is an integer) the impulse responses are all zero.

Thus, if the transmitted waveform is correctly sampled at the receiving end, the original value of the runic element can be fully recovered.

However, in many practical communication systems, matched filters are used in the receiver due to the effects of white noise. For zero ISI, the net response of the transmitter and receiver filters must be equal to\(H(f)\)

\[{\displaystyle H_{R}(f)\cdot H_{T}(f)=H(f)} \]

So:

\[{\displaystyle |H_{R}(f)|=|H_{T}(f)|={\sqrt {|H(f)|}}} \]

These filters are called root ascending cosine filters[33] [34]

Centralize important parameters:

roll-off factor: Roll-off coefficient\(\beta\) is a measure of the filter bandwidth excess (excess bandwidth), i.e., the occupied bandwidth exceeds the Nyquist bandwidth\(\frac {1}{2T}\) section, some authors will use the\({\displaystyle \alpha }\) Expressing.

If we denote the excess bandwidth as\({\displaystyle \Delta f}\)Then:

\[{\displaystyle \beta ={\frac {\Delta f}{\left({\frac {1}{2T}}\right)}}={\frac {\Delta f}{R_{S}/2}}=2T\,\Delta f} \]

\({\displaystyle R_{S}={\frac {1}{T}}}\) It's the runescape rate.

The graph above shows as\({\displaystyle \beta }\) amplitude response varying between 0 and 1, and the corresponding effect on the impulse response. It can be seen that the ripple collinearity in the time domain varies with the\({\displaystyle \beta }\) decreases and increases, which reduces the filter bandwidth excess, but only at the cost of elongating the impulse response.


wideband: The bandwidth of a rising cosine filter is usually defined as the width of the non-zero positive frequency portion of its spectrum, i.e.:

\[{\displaystyle BW={\frac {R_{S}}{2}}(\beta +1),\quad (0<\beta <1)} \]


3) Difference between Gaussian filtering and ascending Yu Xuan filtering

Q: Why is a Gaussian filter added to GMSK and a rising cosine filter added to QPSK? What is the main difference between adding these two filters in this way? What are the benefits?[30]

A: GMSK plus Gaussian filter is mainly to reduce the out-of-band radiation, so that the signal bandwidth is narrower, thus increasing the channel capacity, after adding Gaussian, on the contrary, it will increase the ISI. while QPSK plus rising cosine filter is mainly to reduce the ISI, and there is a certain reduction on the signal bandwidth, but the reduction is not as powerful as Gaussian.


4) Filtering Basics

To better understand RRC, we need to add some more filter basics:

The role of digital filters can usually be summarized in two ways

  • Signal restoration: Signal recovery refers to the ability of a filter to recover a distorted signal.
  • Signal separationSignal Separation means that the filter can separate the target signal from conflicts, interference, or noise.

The two aspects of digital filtering correspond precisely to the two different modes in which a signal carries information

  • time domain modulation: Time-domain modulation Refers to the use of waveform characteristics such as amplitude and phase of the signal to represent the information content to be carried, in which case the sampling results in the time domain can be used directly for the extraction of the information content;
  • frequency domain modulation: Frequency domain modulation utilizes the frequency characteristics of periodic signals to distinguish and represent different information;

Filter Classification


time domain parameter (math.)

Typically usedStep Response Characterize the filter in the time domain[40] . The step response refers to the output of the filter response when the input signal is a unit quasi-step signal (the form of the step signal is shown below). Since the step signal is essentially the integral in time of the unit impulse signal, for a linear system, the step response is the integral in time of the unit impulse response.

Given a filter step response, which parameters of the step response can be used to characterize the performance of that filter?

  • Transition speed: The number of samples taken to change the output amplitude from 10% to 90% of the amplitude in the step response is specified as the transition speed.
  • Overshoot: Overshoot refers to the phenomenon of fluctuations in the time-domain amplitude of a signal after it passes through a filter, which is a fundamental distortion of the information contained in the time domain.
  • Linear phase: It is desired that the top half of the step response be symmetrical to the bottom half. This symmetry is intended to make the rising and falling edges look the same. This symmetry is called linear phase because when the step response is symmetrical up and down, the phase of the frequency response is a straight line.

classifier for sums of money: This section is essentially copied from Frontier Practices in the Internet of Things, for a detailed breakdown please refer to[40]


frequency domain parameter

In the frequency domain, the function of a filter is to allow signals of certain frequencies to pass through without distortion, while completely blocking signals of other frequencies. There are: low-pass, high-pass, band-pass, and band-stop.

The common feature of the above four filters is the ability to separate signal components of different frequencies in the frequency domain. When designing and selecting filters, we need to consider the following three important parameters:

  • Roll-off speed: in order to separate closely spaced frequencies, the filter must have a fast roll-off
  • Passband Ripple: In order for the passband frequency to pass through the filter unchanged, the passband ripple must be suppressed as much as possible.
  • Stopband attenuation: In order to adequately block stopband frequencies, good stopband attenuation is necessary.

classifier for sums of money: This section is essentially copied from Frontier Practices in the Internet of Things, for a detailed breakdown please refer to[40]


2.6.3 Come back to understand RRC

RRC Filter Taps have the following parameters[41]

  • Gain: Overall gain of filter (default 1.0)
  • Sample Rate: Sample rate in samples per second.
  • Symbol Rate: Symbol rate, must be a factor of sample rate. Typically ((samples/second) / (samples/symbol)).
  • Excess BW: Excess bandwidth factor, also known as alpha. (default: 0.35)
  • Num Taps: Number of taps (default: 11*samp_rate). Note that the number of generated filter coefficients will be num_taps + 1.

Since 2.2 Introduction The bandwidth of a rising cosine filter is usually defined as the width of the non-zero positive frequency portion of its spectrum, i. e:

\[{\displaystyle BW={\frac {R_{S}}{2}}(\beta +1),\quad (0<\beta <1)} \]

Thus the RRC filter in the flowchart is equivalent to a low-pass filter with a bandwidth of 16K/2(1+0.35) = 10.8

2.6.4 Understanding Resampling

For digital modulation:


Sample rate conversion, is an important concept in software radio. In general, the receiver side of the RF device to a higher sampling rate for sampling, can be sampled to increase the bandwidth, and is conducive to reducing the quantization noise, but the high sampling rate will make the sampled data rate is very high, for example, receiving satellite signals can reach a sampling rate of 500MSPS, 500M samples per second, a huge scale of data, which is prone to increase the burden of the subsequent signal processing, it is therefore very necessary to After the ADC to reduce the rate of processing, naturally involves the transformation of the sampling rate.

Sample rate transformations are usually categorized as interpolation (also known as upsampling) and extraction (also known as downsampling). Interpolation is the process of increasing the sampling rate to add data samples; extraction is the process of decreasing the sampling rate to remove excess data samples.

Here directly on the conclusion of the interpolated signal spectrum for the original signal spectrum after I times "compressed" to obtain, after the extraction of the signal spectrum to the original signal spectrum D times "broadening".

—— Copied from Zhihu - Chuyouma - gnuradio Beginning Development


GNU Radio offers the following resampling blocks: Fractional Resampler, Rational Resampler Base, Rational Resampler, Polyphase Arbitrary Resampler, and in our case the Polyphase Arbitrary Resampler is used in our example, so we will only introduce it briefly (the others will be introduced in a later issue):

Multiphase Arbitrary Resampler is a technique used to resample a signal stream in arbitrary proportions. It is based on the principle that a long filter is decomposed into multiple short filters to form a multi-phase filter bank, and then the input signal is decomposed in multiple phases so that each branch of the signal needs to pass through only one short filter, thus reducing the amount of operations and delay. Next, a certain number of output signals are cyclically taken out of the multiphase filter bank according to a target resampling ratio and interpolated between neighboring output signals to obtain an approximate resampling result[26] [28]

The advantage of the multiphase arbitrary resampler is that it can realize arbitrary resampling ratios, either rational or irrational, without the need for complex interpolation or extraction operations. It can also effectively reduce the filter length and the amount of operations and improve the efficiency and accuracy of resampling. Its disadvantage is that it requires a polyphase decomposition of the filter and the signal, which can add some storage and computational overhead. It also introduces some quantization error because it is an arbitrary proportion of resampling by interpolation rather than exact resampling. Therefore, it needs to choose the right number of filters and interpolation method according to the specific application scenario and performance requirements[27] [29]



3 Send related small DEMO

3.1 Forward Error Correction Coding

Coding requires the use ofFEC Async Encoder lump (of earth)[5]

Encodes frames received on the message port (as async messages or PDUs). The encoder encodes the complete message as a frame or block. The length of the message is used for the length of the frame, specifically the length of the block.MTU parameter is used to set the size of the maximum transmission unit, which means that the transmission frame length cannot be larger than this value.

The messages handled by this deployment are messages full of unpacked bits or PDU messages, which means that higher levels of the protocol need to complete the assembly of headers, footers, CRC checksums, and so on. In order to process PDUs, thepacked option is set to True, the block will then use the FEC API to correctly unpack the bits in the PDUs, pass them through the encoder again, and repackage them to output new PDUs for the next stage.

The block also provides for unpacking and packing order settings: LSB and MSB. default.rev_unpack cap (a poem)rev_pack is set to True, which means that the unpacking bits are reversed and the packing bits are reversed.

Therefore, the flowchart (tx_stage2.grcThe MTU of the Encoder module is set to 1.5K, packed is set to True, and the FEC packetization objects are optional:

EFC object block parameters Function
Repetition Encoder Definition[6] - Dimension:?
- Frame Bits: maximum frame bits
- Repeat: how many times per 1 bit.
How many repetitions by bits?
Dummy Encoder Definitio - Dimension:?
- Frame Bits
transmission (of information)
CC Encoder Definition[7] - Dimension:?
- Frame Bits
- Constraint Length (K):[2, 31]
- Rate Inverse(1/R)
- Polynomials
- Start State: Initial value of shift registers[0, 2^(K-1)-1], most literature and books use a shift register that is shifted from left to right, whereas here it is shifted from right to left, which means the value must be inverted.
- Streaming behavior: Specify the behavior of the convolutional encoder.
- Byte Padding: whether the encoded frame should be padded to the nearest byte or not
Convolutional coding is implemented for constant-length frames, allowing the specification of a constraint length (K), coding rate, and polynomial. The encoding object maintains a shift register that takes each bit from the input stream and then does an AND operation with the shift register with the

Voyager polynomials are commonly represented in binary as 1011011 and 1111001, and in octal as 133 and 171.For this block binary needs to be inverted: 1101101 and 1001111; in octal this is 155 and 117; and in decimal it is 109 and 79.Some standards (e.g., CCSDS 131.0-B-3) require that certain outputs be Inversion. This is supported by providing negative values for polynomials, such as -109.

NASA's Voyager code uses K=7, Rate=1/2:
1 + x^2 + x^3 + x^5 + x^6
1 + x + x^2 + x^3 + x^6

Convolutional coding behavior there:
- Streaming: This mode expects an uninterrupted stream of samples to enter the encoder and the output stream is encoded continuously.
- Terminated: Mode designed for packet-based systems. This mode swipes K-1 bits into the encoder and adds rate*(K-1) bits to the output, which improves protection of the last bits of the block and helps the decoder.
- Tailbiting: Another packet-based method. This mode will pre-initialize the encoder state with the last (k-1) bit of the packet, instead of adding bits at the end of the packet (e.g. "CC_TERMINATED").
- Truncated: always resets the register to its starting state between frames.
CCSDS Encoder Definition[13] Parameters similar to CC Encoder Definition It's a special kind of convolutional code:CCSDS Encoding class for convolutional encoding with rate 1/2, K=7, and polynomials [109, 79].

Output log using 3-repeat encoding.

***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =         48 bytes
pdu vector contents = 
0000: 22 e7 d5 20 f8 e9 38 a1 4e 18 8c 47 30 8c fe f5 
0010: ff f7 f7 28 b9 f8 fb f5 1c 7c cc cc 4c 24 01 6b 
0020: 1c ea a3 ca e0 f5 80 a7 cc 09 5c d9 db 73 02 76 
************************************
***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =        144 bytes
pdu vector contents = 
0000: 03 80 38 ff 81 ff fc 71 c7 03 80 00 ff fe 00 ff 
0010: 8e 07 03 fe 00 e3 80 07 1c 0f f8 00 7e 00 e0 0f 
0020: c0 1c 01 ff 03 f0 00 e0 0f c0 ff ff f8 ff f1 c7 
0030: ff ff ff ff f1 ff ff f1 ff 03 8e 00 e3 fe 07 ff 
0040: fe 00 ff fe 3f ff f1 c7 00 7f c0 1f ff c0 fc 0f 
0050: c0 fc 0f c0 1c 0f c0 03 81 c0 00 00 07 1f 8e 3f 
0060: 00 7f c0 ff 8e 38 e3 80 3f fc 0e 38 ff 80 00 ff 
0070: f1 c7 e0 00 00 e3 81 ff fc 0f c0 00 0e 07 1c 7f 
0080: c0 fc 7e 07 fc 7e 3f 1f f0 3f 00 00 38 1f f1 f8 
************************************

The arithmetic process:

22 e7 -> 0010 0010 1110 0111 -> [000 000 111 000] [000 000 111 000] [111 111 111 000] [000 111 111 111] 
							 -> 0000 0011 1000     0000 0011 1000    1111 1111 1000   0001 1111 1111
							 -> 0    3    8        0    3    8       f    f    8      1    f    f
							 -> 03        80            38           ff        81          ff  

Encoded with CC Encoder: K=7, Rate=1/2 (rate = 1/Rate = 2), polynomials used [109,79].

***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =         48 bytes
pdu vector contents = 
0000: 22 e7 d5 20 f8 e9 38 a1 4e 18 8c 47 30 8c fe f5 
0010: ff f7 f7 28 b9 f8 fb f5 1c 7c cc cc 4c 24 01 6b 
0020: 1c ea a3 ca e0 f5 80 a7 cc 09 5c d9 db 73 02 76 
************************************
***** VERBOSE PDU DEBUG PRINT ******
()
pdu length =         97 bytes
pdu vector contents = 
0000: 0d ff d7 ec 6e df 0a 42 26 b6 b9 c9 9e e1 8e dd 
0010: 8b 9e 16 63 43 c4 d0 f2 4b fe af c4 01 8c 83 9d 
0020: 21 3f ff 20 d3 20 38 5d 3d 7e c6 06 ba b8 34 2d 
0030: c4 24 6e ad 7f 0f 0f 0f d0 23 ea c5 0b 03 46 58 
0040: 61 e4 b2 c7 cc 10 a6 45 3b d5 26 5d 18 9c d2 e7 
0050: 6d 7f e7 dc 64 ef bc 47 0b fa 2b 3b fe 7d cb bf 
0060: 49 
************************************

rules of arithmetic[8][9][10][11][12]

22 e7 d5 20 -> 0010 0010 1110 0111 1101 0101 0010 0000 -> [001000] [101110] [011111] [010101] [001000] 00
							
	001000           001000              
	1011011          1111001             
	-------          -------            
	001000           001000              
	 000000           001000     -> 0 0 1 0 1 1     -> 000011011111 -> 0D F
	  001000           001000     -> 0 0 1 1 1 1
	   001000           001000
	    000000           000000 
	     001000           000000
	      001000           001000
	------           ------
	001011     	  001111			

More standardized & vivid calculation process:

  1. Converting polynomials to registers flowchart
    2) Initially, each register is 0, and then 00100010 is fed into this register one byte at a time in left-to-right order.
    (3) Every time a bit is sent in, 2 bits come out.
    4) Finally, the bit pairs of each output are connected in order.

3.2 Chat App

This example is relatively simple, it's just an input box to enter something and Message Debug to output something.pdu_simple_demo2_chat.grc


3.3 PDU Operation Set Demonstration

This example shows various blocks on PDU operationspdu_simple_demo3_pdu_tools.grc

Several of the new blocks have the following features:

  • PDU Set: This block will add a key-value data pair to the PDU metadata dictionary.
  • Add System Time: This block will add the system time as a double precision floating point value to the PDU metadata. The time key can be set by user.
  • Note: Typically, some PDU processing will take place here in order to apply the time base.
  • Time Delta: This block calculates the number of milliseconds that have elapsed since the time key was added and prints statistics when the flowchart is stopped.
  • PDU Split: PDU will be split into data dictionary metadata dictionary and uniform vector uniform vector , and then issued as dict/uvec PMT message respectively.

So the whole flowchart outputs a large PDU every 400ms, then adds a KEY1 key-value pair, then a SYS_TIME key-value pair, then does a little processing (mainly to demonstrate elapsed time stats), then adds a time_delta_ms key-value pair, and finally splits the information into dictionaries and vectors.

The dictionary prints as:

time_delta :debug: time_delta_ms PDU received at 1706628911.598694 with time delta 0.045776 milliseconds
******* MESSAGE DEBUG PRINT ********
((time_delta_ms . 0.0457764) (SYS_TIME . 1.70663e+09) (KEY1 . 123.4))
************************************

Reference Links

[1]. Wikipedia -- PDU
[2].GNU Radio —— Random PDU Generator
[3].GNU Radio —— PDU Set
[4].GNU Radio —— Async CRC32
[5].GNU Radio —— FEC Async Encoder
[6].GNU Radio —— Repetition Encoder Definition
[7].GNU Radio —— CC Encoder Definition
[8]. Yang Zhou Wu -- University of Science and Technology of China Personal Communication and Spread Spectrum Laboratory "Coding Theory Chapter 4" (super detailed introduction to convolutional coding)
[9]. Knowing -- Convolutional Codes (some errors, helpful for understanding 8)
[10]. Foreign Q&A Forum -- Question on how to implement convolutional codes on top of Voyager
[11]. U.S. Defense Information Security Center.
[12]. Wikipedia -- Convolutional codes
[13].GNU Radio —— CCSDS Encoder Definition
[14].GNU Radio —— Default Header Format Obj
[15].GNU Radio —— Protocol Formatter (Async)
[16]. Journal of Tsinghua University - Design of rotationally modulated adaptive interleaver for OFDM constellations
[17]. KNOWLEDGE -- Principles of Astrological Chart Communication (more examples and diagrams compared to 18)
[18].CSDN -- Detailed explanation of IQ modulation and the principles of constellation diagrams (more detailed than 20)
[19]. Chinese Core Journal of Science and Technology - A Review of Constellation Diagram Based Digital Signal Modulation Methods
[20].CSDN -- Principles and Applications of Constellation Charts (a brief introduction to IQ modulation and constellation charts)
[21].GNU Radio —— Chunks to Symbols
[22].GNU Radio —— Constellation Object
[23].CSDN -- An article on FFTs, the difference between hann and hamming windows, and how to choose a window function
[24]. Wikipedia -- Window function
[25].GNU Radio —— Burst Shaper
[26]. Knowing -- chuyouma-gnuradio entry level development
[27]. Journal of the Northern Institute of Technology - Design of a multi-rate sampling module based on extractive filter polyphase decomposition
[28].CSDN -- Multi-phase extractor implementation and matlab example
[29].Matlab -- Resampling non-uniformly sampled signals
[30]. Communication Technology Interactive Q&A -- Why do you add a Gaussian filter for GMSK and a rising cosine filter for QPSK?
[31].CSDN -- Filtering the ascending cosine (very simple to visualize and present clearly)
[32]. Tsinghua University Press -- MATLAB/System View Communication Principles Experimentation and System Simulation, 3.3.1 Raised Cosine Filters
[33].CSDN -- Unit Impulse Response of the Raised Cosine and Rooted Raised Cosine Filters (SRRC,RRC) (Details)
[34]. Wikipedia -- Raised cosine filters
[35]. Wikipedia -- impulse response
[36]. Wikipedia -- Filter
[37]. Wikipedia -- Low-pass filter
[38].Mr. IC -- Rising Hysteresis Filter Principle of Operation_Roll-off Coefficient_Expression for Impulse Response
[39]. Knowing -- The signal is shaped and filtered on the transmitter side with a root raised cosine filter, so what filter is used to match it on the receiver side?
[40]. Tsinghua University -- Chapter 5 Signal Filtering (Superb) in Frontiers of IoT Practice
[41].GNU Radio —— Root Raised Cosine Filter
[42].NASA —— Root Raised Cosine (RRC) Filters and Pulse Shaping in Communication Systems
[43].Matlab —— raised-cosine-filtering
[44].literatures —— The care and feeding of digital,pulse-shaping filters
[45]. Huaqiang Electronics -- What is FIR Filter, FIR Filter Working Principle, Composition, Advantages and Disadvantages, and Application Details
[46].Stack Exchange -- What is the correct gain for an RRC filter?
[47]. NI -- RFmx Waveform Creator User's Manual.
[48]. Blog -- Root Raised Cosine Filters in C
[49]. European Space Agency -- Square root raised cosine signals
[50]. BOOK —— Intuitive guide to topics in communications and digital signal processing(Very straightforward to watch signals and systems)


Tutorial List

Basic Tutorial:

  • [1]. GNU Radio Tutorial Series (I) -- What is GNU Radio?
  • [2]. GNU Radio Tutorial Series (II) -- Drawing the First Signal Analysis Flowchart
  • [3]. GNU Radio Tutorial Series (III) -- Using Variables
  • [4]. GNU Radio Tutorial Series (IV) -- Packing and Unpacking of Bits
  • [5]. GNU Radio Tutorial Series (V) -- Streams and Vectors
  • [6]. GNU Radio Tutorial Series (VI) -- Creating Your Own Blocks Based on Layers
  • [7]. GNU Radio Tutorial Series (VII) - Creating the First Block
  • [8]. GNU Radio Tutorial Series (VIII) - Creating Python Blocks That Work with Vectors
  • [9]. GNU Radio Tutorial Series (IX) - Message Passing with Python Blocks
  • [10]. GNU Radio Tutorial Series (X) - Tags for Python Blocks
  • [11]. GNU Radio Tutorial Series (XI) - Low Pass Filters
  • [12]. GNU Radio Tutorial Series (XII) - Narrowband FM Transmission and Receiving Systems (Based on ZMQ Analog RF Transmission)
  • [13]. GNU Radio Tutorial Series (XIII) - FM Transmission and Receiving with Two HackRFs.
  • [14]. GNU Radio Tutorial Series (XIV) - A Watershed of Low to High-Level Usage of GNU Radio Detailed Explanation of the Use of ZMQ
  • [15]. GNU Radio Tutorial Series (XV) - GNU Radio GFSK Module
  • [16]. GNU Radio Tutorial Series (XVI) - Message Strobe, a debugging tool for GNU Radio.
  • [17]. GNU Radio Tutorial Series (XVII) - GNU Radio PDU TX Minimal packet implementation using three blocks (frame header + data + checksum)
  • [18]. GNU Radio Tutorial Series (XVIII) - GNU Radio PDU TX Combining Header and Payload Messages into Data Frames
  • [19]. GNU Radio Tutorial Series (XIX) - GNU Radio PDU TX Implementing Pulse Burst Shaping Padding to Minimum Data Frames --> Making Frames More Stable
  • [20]. GNU Radio Tutorial Series (XX) - GNU Radio PDU TX Root Rising Cosine Depth Introduction & Wrapping Up Sending Data Frames
  • [21]. GNU Radio Tutorial Series (II.1) - GNU Radio PDU RX Finding the Beginning of a Data Frame Using a Correlation Estimator
  • [22]. GNU Radio Tutorial Series (II.2) - GNU Radio PDU RX Implementing Clock Skew Elimination Using a Polyphase Clock Synchronization Block
  • [23]. GNU Radio Tutorial Series (II-III) - GNU Radio PDU RX Elimination of ISI Using Adaptive Linear Equalizer
  • [24]. GNU Radio Tutorial Series (II-IV) - GNU Radio PDU RX Correcting Phase and Frequency Offsets with Costas Loop
  • [25]. GNU Radio Tutorial Series (II.5) - Hardcore, Designing a File Transfer System Based on Communication Principles
  • [26]. GNU Radio Tutorial Series (II.6) - Appetizer, hackrf Simple DEMO for sending ble broadcast packets.

Comprehensive Tutorial:

  • [1]. SDR Tutorial in Action (I) -- FM Radio with GNU Radio + HackRF
  • [2]. SDR Tutorial Hands-on (II) -- Bluetooth fixed-frequency test tool using GNU Radio + HackRF (ultra-low cost).
  • [3]. SDR Tutorial Hands-on (III) -- Bluetooth Packet Grabber with GNU Radio + HackRF + WireShark (Ultra Low Cost)
  • [4]. SDR Tutorial Hands-on (IV) -- Hands-on deep dive into the Bluetooth stack (from EM waves -> 01 data streams -> Bluetooth packets) using GNU Radio + HackRF
  • [5]. SDR Tutorial Hands-on (V) - Bluetooth Packet Grabber with GNU Radio + LimeSDR + WireShark (last video used HackRF)
  • [6]. SDR Tutorial Practice (V) -- Using two hackrf to achieve high-speed transfer of large files (video)

SDR Widget Tutorial:

  • [1]. SDR Widget - A minute to turn a dusty hackrf into a spectrum analyzer worth thousands of dollars

Basic Block Tutorial:

  • [1]. Introduction to GNU Radio Blocks (I) - GNU Radio's Absolute Value (Abs) Block

Videos and blogs



: If you think it's good, please help me to support it.