# Lab 3- Introduction to Digital Communications-BPSK Modulation

## Objective

• Understand the principles of Binary Phase Shift Keying (BPSK)
• Measure Bit Error Rate (BER)
• Understand the effects of having phase errors in the received signal
• Understand the effects of time synchronization in real-time transmission
• Understand the effects of Interference in real-time transmission

## 1. Prelab

1. Draw the constellation diagram for BPSK. Which bit does each point represent?
2. Given that   , what are Bit Error Rate (BER) and the Symbol Error Rate for BPSK modulation scheme?

## 2. Building Simulink Model of BPSK Modulator and Demodulator

1. Standard 16 QAM Simulation
2. The Simulink model of BPSK modulator and demodulator is shown below

• Build the Simulink model shown in Figure 1.
• Double-click on the Random Integer Generator and adjust the set size to a proper value (Remember that the input to the BPSK modulator should be either a 0 or a 1).
• Set the Sample Time in the Random Integer Generator and the Symbol period parameter in the AWGN blocks to 1e-6 (i.e. 1 µs).
• Set the Samples per frame parameter in the Random Integer Generator to 1024.
• For the Error Rate Calculation block, set the Output data field to “port” so you can connect the Display block.
• The Display Block will show you three values. The first value is the BER, the second value is the number of incorrect bits, and the third value is the total number of bits received.
• Set the simulation time to 10 seconds.
• In this experiment, you will adjust the value of the $\frac{E_b}{N_0}$  in the AWGN block, starting from 3, incrementing by 1 every step, and ending at 15, and observe the error rate displayed in the Display block. Make a table recording the value of $\frac{E_b}{N_0}$ and the corresponding BER.
• Plot BER vs. $\frac{E_b}{N_0}$  and compare with the theoretical values. Comment on the results.
3. A Music File Transmission with BPSK
4. The following model will be used to simulate a music file transmission using BPSK modulation with AWGN channel. You will observe both constellations in the transmitter and the receiver side and the Bit Error Rate.

• In the From Multimedia File Block, set the Samples per audio channel parameter to 1024, and check the Inherit sample time from file box.
• The music file that you will use (named Music-1.wav) is located on the Desktop.
• The music file length is 62 seconds, so set the Simulation Time to 62 seconds.
• In the Integer to Bit Converter and Bit to Integer Converter Blocks, set the Number of bits per integer parameter to 16, and the Output data type parameter to double and int16 respectively
• In this experiment, you will adjust the value of SNR in the AWGN block and observe the error rate displayed in the Display block. Make a table recording the value of SNR and the corresponding Bit Error Rate (BER). Make sure you record enough values (at least 10 points) to have a good plot.
• Comment on the quality of the music as you change the SNR value.
• Plot BER vs. SNR and comment on the plot.

## 3. BPSK Modulator and Demodulator Using USRP Hardware

In this part, you will learn that for real-time transmission, it is not enough just to have a demodulator block to regenerate the transmitted message. There are other issues that need to be dealt with such as Phase errors and Synchronization.

1. Standard System
• Double-click the file named BPSK1.mat in the MATLAB window. This will load the parameters that are used in the receiver block diagram.
• Open the file named BPSK1.slx. This model represents the receiver side. The transmitter side is already running. Look at the structure of the receiver and list the main components. Give a brief description of each component’s functionality.
• Run the model and observe the output in the MATLAB window. Take a snap shot of the constellation diagrams at every stage and comment on the plots.
2. Phase Errors Issues
3. Phase errors happen due to the noise introduced by the channel. The noise will rotate the constellation points. Therefore, the receiver needs to correct these errors before the demodulation process.
To solve this issue, a Phase Locked Loop (PLL) is usually used. This is done by the Phase Correction component in the standard system you worked with in Part 3.I.

• Open the file named BPSK_Phase_Error.slx. This file is the same as the previous one except that the phase cancellation block is removed.
• Run the model and observe the output in the MATLAB window. Take a snap shot of the constellation diagrams at every stage and compare with the plots from the previous section.
4. Time Synchronization Issues
5. Due to slight differences in the internal clocks of the transmitter and the receiver, the receiver is not 100% synchronized to the transmitter. If the receiver is not synchronized with the transmitter, the starting and ending of a symbol at the receiver will be different than the transmitter, which will lead to errors. This is illustrated in Figure 3.
In addition to the synchronization at the symbol level, the receiver needs to synchronize the whole frame as well (i.e., where the frame begins and where it ends) for proper decoding and demodulation.

• Open the file named BPSK_Time_Sync.slx. This file is the same as the file from the first section except that the Time Synchronization block is removed.
• Run the model and observe the output in the MATLAB window. Take a snap shot of the constellation diagrams at every stage and compare with the plots from the first section.