Example Code

RF Simulation Demo: Phase Shift Keying

Code and Documents

Attachment

Download All

Overview


This step-by-step demo is designed to examine the Phase Shift Keying (PSK) digital modulation scheme. Fundamentally, digital modulation requires changing characteristics of the carrier wave over time. Each change results in a sine wave with a different phase, amplitude, or frequency than before. As a result, different “states” of the sine wave are referred to as symbols which represent some digital bit pattern. In this exercise, we will construct a LabVIEW VI that transmits and receives a digital bit stream in software using PSK.

Background

Below is a constellation plot that shows the symbol map for 8-PSK.  Here each of the 8 symbols (shown as white dots) represents 3-bits of digital data.  Notice that all of the symbols are at the same amplitude, and it is the phase that differentiates them.  Also notice that the each symbol is equally spaced in phase across the unit circle. 

Programming

Open “simple_psk_transceiver_temp.vi” and inspect the front panel that has already been constructed.  When this VI is completed, it will allow the user to choose the number of symbols that will be used (M-PSK) as well as the pulse shaping filter used for generation.  Additionally, there is a control for the amount of simulated channel noise in this system.

The block diagram consists of a while loop that will iterate once every 100 milliseconds.  Inside this loop, we will generate, modulate, demodulate and display digital data.

1)  Place a “Generate System Parameters” VI on the block diagram and select the polymorphic instance PSK (M).  Connect the wire coming from the M-PSK control to the corresponding input terminal on this VI.  This VI will create a PSK symbol map based on the M-PSK value selected on the front panel.

2)  Place an “MT Bit Generation” VI on the block diagram and wire the output of the multiplication function to the total bits input.  This VI will generate a digital bit stream that will later be modulated using PSK.

3)  Place a “Generate Filter Coefficients” VI on the block diagram.  Right click on the modulation type terminal and create a constant, then select PSK.  Wire the pulse shaping filter control into the appropriate input.  This VI will generate filter coefficients that will be used during modulation to reduce the bandwidth of the modulated signal.

4)  Place a “Modulate PSK” VI on the block diagram and wire in the system parameters, bit stream, and pulse shaping coefficients from the three previous VI's.  Also wire the Boolean value from the first call function into the reset? input.  This VI will perform PSK modulation on the input bit stream using the system parameters and filter coefficients specified.

5)  Place an “Add AWGN” VI on the block diagram and wire the Noise Impairments control to the Eb/N0 input.  Also wire the Boolean value from the first call function into the reset? input.  This VI will subject the modulated signal to Additive White Gaussian Noise based on the “noise impairments” control on the front panel.

6)  Place a “Demodulate PSK” VI on the block diagram and wire the system parameters, filter coefficients and input complex waveform form previous VI's.  Also wire the Boolean value from the first call function into the reset? input.  This VI will demodulate the input signal and return the recovered bit stream.

Finally, wire the error out of each VI to the error in of the next to handle any errors that occur and enforce dataflow between the VI's.  Return to the front panel and run the VI to see PSK modulation in action.  Experiment with the PSK (M), pulse shaping filter, and Noise impairments controls This simple transceiver demonstrates modulation and demodulation using Phase Shift Keying.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors