You are on page 1of 7

MARINDUQUE STATE COLLEGE

INSTITUTE OF ENGINEERING
DEPARTMENT OF ELECTRONICS ENGINEERING

EXPERIMENT
Quadrature Amplitude Modulation with Bit Error Rate

NAME

STUDENT NUMBER PROGRAM YEAR COURSE –SECTION

DATE PERFORMED DATE SUBMITTED

INSTRUCTOR
Experiment
Quadrature Amplitude Modulation with Bit Error Rate

I. OBJECTIVES:

1. Know how to code in Matlab.


2. Familiarized with the code that is used in MatLab.
3. Understand the Quadrature Amplitude Modulation
4. Distinguish the 4-QAM, 16-QAM and 64-QAM
5. Create a constellation diagram and able to get the bit error ratio.

II. MATERIALS TO BE USED:

MatLab Simulink Software

Table 1: Matlab Codes and its Description

Codes Description

rng Controls the random number generation.

randi Generates a random binary data stream.

bi2de Converts the binary signal to an integer-valued signal.

qammod Modulates using QAM

de2bi Converts the integer-valued signal to a binary signal.

qamdemod Demodulates using QAM.

comm.AWGNChannel Impairs the transmitted data using AWGN

scatterplot Creates constellation diagrams.


biterr Computes the system BER.

III. DISCUSSION

Quadrature Amplitude Modulation QAM is a digital modulation technique that combines


phase and amplitude control. It has a wide range of applications, not only in the field of mobile
communications but also in cable TV transmission, digital video broadcasting, satellite
communications, and other fields.

 It conveys two analog message signals, or two digital bit streams, by changing
(modulating) the amplitudes of two carrier waves, using the amplitude-shift keying (ASK) digital
modulation scheme or amplitude modulation (AM) analog modulation scheme. The two carrier
waves are of the same frequency and are out of phase with each other by 90°, a condition known
as orthogonality or quadrature. 

The bit error ratio is the number of bit errors divided by the total number of bits
transferred during a specific time interval. The bit error rate is the number of bit errors per unit of
time. The bit error rate gives you an indication of your system’s performance relative to bits
transferred vs bits received.

IV. PROCEDURE

1. Install the MatLab Simulink on your device by downloading it online and clicking this
link to continue https://getintopc.com/?s=mathlab+2022 and use the crack to generate the codes
that will be used in simulating.

2. Open the MatLab and used the code above and familiarize its function then create a
modulation scheme that uses 4-QAM, 16-QAM, and 64-QAM, in which the signal passes
through an additive white Gaussian noise (AWGN) channel. Defining parameters where M
represents the modulation order, r is the number of bits, n is the number of bits to process and
sps is the number of samples per symbol. Generate a Random Binary data stream. Use the coded
data below to obtain the graph of binary bits in the first 40 of data.

M = 4;
r = log2(M);
n = 30000;
sps = 1;
rng default;
dataIn = randi([0 1],n,1);
stem(dataIn(1:40),'filled');
title('Random Bits');
xlabel('Bit Index');
ylabel('Binary Value');

3. After inputting the code examines the result and input your observation below. The
output should be like the figure 1.

Figure 1: Binary Signal in 40 bit index

3. In order to convert Figure 1 to integer form of binary index copy the code below and
observe the changes of output by examining Figure 2.

dataInMatrix = reshape(dataIn,length(dataIn)/r,r);
dataSymbolsIn = bi2de(dataInMatrix);

stem(dataSymbolsIn(1:10));
title('Binary Symbols');
xlabel('Symbol Index');
ylabel('Integer Value');
Figure 2: Integer form of Binary index

4. Using the given codes below, you will be able to create the constellation diagram for 4-
QAM and try to observe the output after inputting the codes.

dataInMatrix = reshape(dataIn,length(dataIn)/r,r);
dataSymbolsIn = bi2de(dataInMatrix);
figure;
stem(dataSymbolsIn(1:10));
title('Random Symbols');
xlabel('Symbol Index');
ylabel('Integer Value');
dataMod = qammod(dataSymbolsIn,M,'bin');
dataModG = qammod(dataSymbolsIn,M);

EbNo = 10;
snr = EbNo+10*log10(r)-10*log10(sps);

receivedSignal = awgn(dataMod,snr,'measured');
receivedSignalG = awgn(dataModG,snr,'measured');

sPlotFig = scatterplot(receivedSignal,1,0,'g.');
hold on
scatterplot(dataMod,1,0,'r*',sPlotFig)

dataSymbolsOut = qamdemod(receivedSignal,M,'bin');
dataSymbolsOutG = qamdemod(receivedSignalG,M);

dataOutMatrix = de2bi(dataSymbolsOut,r);
dataOut = dataOutMatrix(:);
dataOutMatrixG = de2bi(dataSymbolsOutG,r);
dataOutG = dataOutMatrixG(:);
[numErrors,ber] = biterr(dataIn,dataOut);
fprintf('\nThe binary coding bit error rate is %5.2e, based on %d errors.\n',
...
ber,numErrors)

[numErrorsG,berG] = biterr(dataIn,dataOutG);
fprintf('\nThe Gray coding bit error rate is %5.2e, based on %d errors.\n',
...
berG,numErrorsG)

M = 4;
x = (0:3);
symbin = qammod(x,M,'bin');
symgray = qammod(x,M,'gray');

scatterplot(symgray,1,0,'b*');
for r = 1:M
text(real(symgray(r)) - 0.0,imag(symgray(r)) + 0.3,...
dec2base(x(r),2,4));
text(real(symgray(r)) - 0.5,imag(symgray(r)) + 0.3,...
num2str(x(r)));

text(real(symbin(r)) - 0.0,imag(symbin(r)) - 0.3,...


dec2base(x(r),2,4),'Color',[1 0 0]);
text(real(symbin(r)) - 0.5,imag(symbin(r)) - 0.3,...
num2str(x(r)),'Color',[1 0 0]);
end
title('4-QAM Symbol Mapping')
axis([-2 2 -2 2])

5. The output diagram for 4-QAM is given in figure 4 together with its bit error rate and
ratio below, try to observe and input your observation in the provided answer sheet.
Figure 4: Constellation Diagram of 4-QAM

The binary coding bit error rate is 0.00e+00, based on 0 errors.

The Gray coding bit error rate is 0.00e+00, based on 0 errors.

Figure 5: 4-QAM Symbol Mapping

Part 2. 16-QAM

1. Using the codes from 4-QAM change the codes and input M = 16 for the modulating
number. Axis is placed in ([-4 4 -4 4]). Label the graph based on the number of amplitude given.
The output should be like the results below.

You might also like