Digital Modulation on the AIR-T¶
This tutorial will demonstrate how to create a basic digital communications system using the AIR-T. While this tutorial implements the communications system using GNU Radio, it is intended to be a blueprint for implementing communication in other frameworks, such as CuPy.
GNU Radio is an open-source toolkit that provides signal processing blocks to build software-defined radios and wireless communication systems using a flowgraph-based approach. Here, a quadrature phase-shift keying (QPSK) modulation scheme is implemented using GNU Radio. The transmit port of the AIR-T will be directly connected to the receive port so that the signal is looped back into the AIR-T. Then, a QPSK demodulation scheme returns the signal to the original data. Finally, the output result is plotted to demonstrate a basic digital communications system. This process is highlighted in the following signal processing pipeline:
flowchart TB
TRANSMIT --> RECEIVE
linkStyle 0 stroke:transparent
%% Define Shapes
subgraph TRANSMIT[**Transmitter**]
direction LR
Data_Source[**Data Source**] -->
Encoder[**Encoder**] -->
Modulator[**Modulator**] -->
AIRT_Sink[**RF<br>Transmitter**]
end
subgraph RECEIVE[**Receiver**]
direction RL
AIRT_Source[**RF<br>Receiver**] -->
Demodulator[**Demodulator**] -->
Decoder[**Decoder**] -->
Data_Sink[**Data Sink**]
end
Flowgraph Step-By-Step¶
Below is the GNU Radio flowgraph for this tutorial, airstack_qpsk_demo.grc
, linked here. In the following sections, we will discuss the various stages of this communications system so that you can tailor this design to your needs.
Step 1: Packetize¶
This step was included in this demonstration to verify that the data being transmitted by the AIR-T is indeed the same data being received by the AIR-T. This is largely done by using the Stream to Tagged Stream and Protocol Formatter blocks, along with the access_key and hdr_format user-defined variables. The key functionality of this subsystem is as follows:
- The bitstream generated by the Random Uniform Source block is processed in 256-byte long packets.
- Given the access_key and hdr_format variables, the Protocol Formatter block formats the packets to include both the 32-bit access key and header.
Step 2: Encode¶
Included in this step is symbol mapping for QPSK modulation as well as differential encoding. Both of these operations are done by the Constellation Modulator block, and will be described in the next step.
Step 3: Modulate¶
The digital modulation scheme used in this example is a QPSK constellation for modulation and demodulation, but GNU Radio supports multiple digital constellations, such as BPSK, 8PSK, and 16QAM. The modulation blocks used and their respective settings are:
- Constellation Object (Rectangular): This block provides automatic amplitude normalization (useful when using an actual radio over a simulation). Parameters of note:
- Symbol Map: The symbol mapping was chosen specifically to support QPSK, which typically consists of four symbols, represented by two bits each. In this example, Gray coding is used to aid differential encoding, ensuring that each symbol is only one bit apart.
- Constellation Points: The unit amplitude complex constellation points begin in the third quadrant of the unit circle and increment clockwise.
- Constellation Modulator: This block generates RRC (Root-Raised-Cosine) filtered, QPSK (in our case) modulated output. Parameters of note:
- Differential Encoding: Differential encoding is used in this example as an easy-to-understand encoding method. It takes the Exclusive Or (XOR) between successive symbols (current and previous).
- Samples Per Symbol (SPS): Since symbols for QPSK go up to four, at least two samples per symbol are required. In this example, we will use four, effectively oversampling by a factor of 2.
- Excess Bandwidth: This parameter is a number between zero and one used to design the rolloff of the RRC filter. The lower this number, the sharper the rolloff of the RRC filter. Note that sharper rolloff comes at the expense of added time-domain ripple.
Step 4: Filter¶
Before transmitting, we use an RRC pulse shaping filter embedded in the Constellation Modulator block. The characteristics of this filter are set in the user-defined variable rrc_taps. This filter is used in conjunction with another RRC filter on the receiving end of this system. Together, they effectively produce a Raised-Cosine (RC) filter, which helps to prevent intersymbol interference (ISI).
Step 5: Transmit¶
Here is a closer look inside the Soapy AIR-T Sink block and some key parameters chosen:
In this demonstration, the variable base_adc_rate represents the master clock rate of the AIR-T, and is set via the Soapy AIR-T device arguments.
Here, the center frequency of the AIR-T transmitter can be set between 300MHz - 6GHz, and the gain can be set between -56dB - 0dB, with 0dB being the maximum output power of the AIR-T.
For more information on the AIR7310's master clock rate and sample rate, please click here.
Step 6: Receive¶
Here is a closer look inside the Soapy AIR-T Source block and some key parameters chosen:
In addition to setting the master clock rate (shown above in Step 5), we can now specify up to two receive channels on the AIR-T.
In addition to setting the center frequency and sample rate of the AIR-T receiver (shown above in Step 5), we can set the gain mode. The default setting is AGC (Automatic Gain Control) mode, and it can also be set to Manual mode, in which the gain can be set between -51dB - 0dB.
Step 7: Filter¶
On the receiving end, we use another RRC pulse shaping filter to work in conjunction with the RRC filter we used before transmission. This time, the RRC filter is embedded in the Polyphase Clock Sync block, which I will describe below. As mentioned, this creates an RC filter that helps combat intersymbol interference (ISI). Furthermore, since we are doing phase-shift modulation, we expect a constant amplitude, and can therefore use the Linear Equalizer block to help remove signal distortion and thus flatten the received signal. The adaptive algorithm chosen to dynamically adjust the linear equalizer filter coefficients to optimize flatness is the Constant Modulus Algorithm (CMA), but this can be changed depending on your needs.
- Polyphase Clock Sync: Before using the RRC filter as mentioned above, this block performs clock recovery of the initial signal. It does this through a control loop in which multiple filters (32 in this case) at different phases are generated, and the one that minimizes error the most is selected. For more information on designing the control loop, and thus modifying the Loop Bandwidth parameter, click here. Since we had oversampled the original signal by a factor of two by using four samples per symbol (only two are needed for QPSK), this block also downsamples by a factor of two.
Step 8: Demodulate¶
Before demodulating the received signal, we must first bring it down to baseband. To do this, the Costas Loop block is used with an order of four for QPSK modulation. Again, information on choosing a Loop Bandwidth can be found here. Next up, the Constellation Decoder block does all the heavy lifting for us and demodulates the data back into a bitstream.
Step 9: Decode¶
As mentioned in Steps 2 and 3, we used differential encoding on our signal, and so now we need the Differential Decoder block to decode the signal. Furthermore, since we defined our symbol mapping in the Constellation Object (Rectangular), we can use the Map block to recover the original symbols that were transmitted.
Step 10: Unpack¶
Finally, we are on the last step to recover the original signal we packetized in Step 1. First, we unpack the two bits per symbol that were downsampled from the initial received signal by the Polyphase Clock Sync block. Then, the Correlate Access Code - Tag Stream block searches for the given access key, decodes the header, and outputs the tagged stream. The received streams can be seen using the QT GUI Time Sink block. The “tag” can be seen in the Decoded Packets time plot below every 256 bytes (2048 bits). At this point, you have successfully transmitted and received QPSK-modulated data - well done!
Results¶
Other References