0% found this document useful (0 votes)
142 views7 pages

Assignment 6: Matlab Code For BER Generation of QPSK System Over AWGN Channel

The document describes a MATLAB assignment to generate plots of bit error rate (BER) versus signal-to-noise ratio (SNR) and bit energy to noise power spectral density (Eb/N0) for a QPSK modulation system over an additive white Gaussian noise (AWGN) channel. The assignment involves writing MATLAB code to generate random QPSK data, transmit it over the channel with AWGN noise, detect and decode the received signal, calculate the number of bit errors, and plot the resulting BER curves.

Uploaded by

DANIELGONFA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
142 views7 pages

Assignment 6: Matlab Code For BER Generation of QPSK System Over AWGN Channel

The document describes a MATLAB assignment to generate plots of bit error rate (BER) versus signal-to-noise ratio (SNR) and bit energy to noise power spectral density (Eb/N0) for a QPSK modulation system over an additive white Gaussian noise (AWGN) channel. The assignment involves writing MATLAB code to generate random QPSK data, transmit it over the channel with AWGN noise, detect and decode the received signal, calculate the number of bit errors, and plot the resulting BER curves.

Uploaded by

DANIELGONFA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

G. S.

Sanyal School of Telecommunications


Indian Institute of Technology Kharagpur

MOOC: Spread Spectrum Communications & Jamming

Assignment 6: Matlab code for BER generation of QPSK system


over AWGN channel.
Due date: Max. marks: 20

Write a MATLAB code to generate Bit Error Rate (BER) vs Bit-Energy-to-Noise-Power-


Spectral-Density ratio (Eb /N0 ) and Signal-Power-to-Noise-Power ratio (SN R) for Quadra-
ture Phase Shift Keying (QPSK) system over Additive White Guassian Noise (AWGN)
channel based on the QPSK modulator and demodulator system depicted in Fig. 1. Re-
ferring to the same, and following the table of notations (Table 1), answer the following
questions:

Bipolar In-phase
݅ In-phase ଓƸ
stream
generation detection

‫ݏ‬ ‫ݎ‬ BER


calculation

Bipolar quadrature ‫ݍ‬


Quadrature
stream generation ݊ detection ‫ݍ‬ො
Complex
operator, j

Figure 1: QPSK modulator and demodulator system

1
Parameter Mathematical MATLAB
notation variable
In-phase bipolar data i I data
Quadrature bipolar data q Q data
Transmitted complex data s tx data
AWGN channel noise n n AWGN
Received signal r rec data
Decoded in-phase data î decod sig I
Decoded quadrature data q̂ decod sig Q
Number of error in in-phase data Ei Err1
Number of error in quadrature data Eq Err2

Table 1: Table of notations.

1. The random bipolar data samples (3 × 105 samples each) can be generated using the
following MATLAB command: (2 marks)

i I data (or Q data) = 4 ∗ (rand(1, 3 ∗ 105 ) ≥ 0.5) − 1


ii I data (or Q data) = 2 ∗ (rand(1, 3 ∗ 105 ) ≥ 0.5) + 1
iii I data (or Q data) = 2 ∗ (rand(1, 3 ∗ 105 ) ≥ 0.5) − 1
iv I data (or Q data) = 2 ∗ (rand(1, 3 ∗ 105 ) ≥ 0.5) − 2

2. The baseband QPSK modulated signal s can be generated using the MATLAB com-
mand:(2 marks)

i tx data=I data
ii tx data=I data+Q data
iii tx data=Q data
iv tx data=I data+j*Q data

3. The complex AWGN signal, n with zero mean and variance equal to 0.5 can be gen-
erated using the following MATLAB command: (Hint: The MATLAB function randn
generates a zero mean Gaussian random variable with unit variance. AWGN noise for
QPSK signal is complex Gaussian (in-phase and quadrature components)).(2 marks)

i n AWGN = (1/sqrt(2))*(randn(1, 3 ∗ 105 )+j*randn(1, 3 ∗ 105 ));


ii n AWGN = (randn(1, 3 ∗ 105 )+j*randn(1, 3 ∗ 105 ));
iii n AWGN = (1/2)*(randn(1, 3 ∗ 105 )+j*randn(1, 3 ∗ 105 ));
iv n AWGN = (sqrt(2)/(randn(1, 3 ∗ 105 )+j*randn(1, 3 ∗ 105 ));

2/7
4. The zero crossing detector at the receiver can be implemented using the following MAT-
LAB command: (2 marks)

i decod sig I = 2*(real(rec data)>0.5)-1; decod sig Q = 2*(imag(rec data)>0.5)-1;


ii decod sig I = 2*(imag(rec data)>0)-1; decod sig Q = 2*(real(rec data)>0)-1;
iii decod sig I = 2*(real(rec data)>0)-1; decod sig Q = 2*(imag(rec data)>0)-1;
iv decod sig I = 4*(real(rec data)>0)-1; decod sig Q = 4*(imag(rec data)>0)-1;

5. The number of bit errors for in-phase transmission is calculated using the MATLAB
command:(2 marks)

i Err1=sum(decod sig I=I data)


ii Err1=sum(decod sig I∼=(-1)*I data)
iii Err1=sum(decod sig I∼=I data)
iv Err1=sum(decod sig I=(-1)*I data)

6. The BER for QPSK transmission is calculated using the MATLAB command: (2
marks)

i BER=(Err1+Err2)/(3*105 )
ii BER=(Err1+Err2)
iii BER=(3*105 )/(Err1+Err2)
iv BER=(Err1+Err2)/(6*105 )

7. The BER plot versus Eb /N0 for the QPSK system is: (4 marks)

3/7
10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

-2 0 2 4 6 8 10 12
Eb/No in dB

ii

10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

-4 -2 0 2 4 6 8
Eb/No in dB

iii

4/7
10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

4 6 8 10 12 14 16
Eb/No in dB

iv

10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

-2 0 2 4 6 8 10
Eb/No in dB

8. The BER plot versus SNR for the QPSK system is: (Hint: For QPSK, 2*Eb/No =
SNR) (4 marks)

5/7
10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

-2 0 2 4 6 8 10
SNR in dB

ii

10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

4 6 8 10 12 14 16
SNR in dB

iii

6/7
10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

-4 -2 0 2 4 6 8
SNR in dB

iv

10 0
Prob. of Error

10 -1

10 -2
BER

10 -3

10 -4

-2 0 2 4 6 8 10 12
SNR in dB

7/7

You might also like