Professional Documents
Culture Documents
Quadrature Amplitude Modulation (4-QAM) : School of Electronics and Telecommunication
Quadrature Amplitude Modulation (4-QAM) : School of Electronics and Telecommunication
Quadrature Amplitude Modulation (4-QAM) : School of Electronics and Telecommunication
REPORT
QUADRATURE AMPLITUDE MODULATION
(4-QAM)
HaNoi, 09/11/2020
1
Table of Contents
I. Introduction....................................................................................................................................….3
II. Definition..........................................................................................................................................3
1. QAM....................................................................................................................................................3
2. Four level QAM (4-QAM)...................................................................................................................3
III. 4-QAM Modulation........................................................................................................................4
IV. 4-QAM Demodulation.....................................................................................................................7
V. 4-QAM Modulation/Demodulation simulation (using Matlab).....................................................7
1.Code.....................................................................................................................................................7
2. Result.................................................................................................................................................10
VI. Bit error rate (BER)......................................................................................................................11
1. BER theory........................................................................................................................................11
2. BER simulation using Matlab and comparing with theory.................................................................13
VII. Signal error rate..........................................................................................................................15
1. SER theory.........................................................................................................................................15
2. SER simulation by using Matlab and comparing with theory............................................................17
VIII. CONCLUSION..........................................................................................................................19
2
I. Introduction
With the fast development of modern communication techniques, the demand
for reliable high date rate transmission is increased significantly, which stimulate
much interest in modulation techniques. Different modulation techniques allow you to
send different bits per symbol and thus achieve different throughputs or efficiencies.
QAM is one of widely used modulation techniques because of its efficiency in power
and bandwidth. In QAM system, two amplitude-modulated (AM) signals are
combined into a single channel, there by doubling the effective bandwidth.
The QAM is one of the adaptive modulation techniques that are commonly used
for wireless communications. Different order modulations allow sending more bits per
symbol and thus achieving higher throughputs or better spectral efficiencies. This method
of modulation has the advantage of reducing or eliminating intermodulation interference
caused by a continuous carrier near the modulation sidebands.
II. Definition
1. QAM
Quadrature amplitude modulation (QAM) is both an analog and a digital
modulation scheme. It conveys two analog message signals, or two digital bit streams, by
changing the amplitudes of two carrier waves, using the amplitude-shift keying (ASK)
digital modulation scheme or amplitude modulation (AM) analog modulation scheme
These two waves, usually sinusoids, are out of phase with each other by 90° and
are thus called Quadrature carriers or Quadrature components — hence the name of the
scheme. The modulated waves are summed, and the resulting waveform is a combination
of both phase-shift keying (PSK) and amplitude-shift keying, or in the analog case of
phase modulation (PM) and amplitude modulation. In the digital QAM case, a finite
number of at least two phases, and at least two amplitudes are used. PSK modulators are
often designed using the QAM principle, but are not considered as QAM since the
amplitude of the modulated carrier signal is constant.
These combinations are shown as the white dots on the constellation plot in Figure
2.1.4 The red lines represent the phase and amplitude transitions from one symbol to
another. Labeled on the constellation plot is the digital bit pattern that each symbol
represents. Thus, a digital bit pattern can be sent over a carrier signal by generating
unique combinations of phase and amplitude.
The QAM modulation scheme encodes data by varying both amplitude and phase
of the carrier signal. Thus, it is sometimes viewed as a combination of ASK and PSK
modulation. A more fundamental way of viewing QAM thought is that it encodes data by
varying the amplitude of two carrier signals that are in-quadrature (phase difference of
90). Mathematically, 4-ary QAM is described by
S ( t ) =A C cos ( 2 π f c t +θ )
2 E0 2 E0
S (t)=
√ T
a k cos ( 2 π f c t )−
√ T k
b cos ( 2 π f c t )
2 E0 2 E0
Where I =
√ T
ak = A c cos ( θ )∧Q=
T k √
b =A c sin(θ)
Using the complex In the case of a QAM square constellation, the pairs of
coordinates from a square matrix as shown by:
{ a i , bi }=
Where L= √ M
[(−L+1 , L−3 ) (−L+3 , L−3 ) … ( L−1 , L−3 )
.. .
.. .
.. .
(−L+1 ,−L+1 ) (−L+3 ,−L+1 ) …(L−1,−L+1)
]
For 4-QAM, we have:
(−1,1 ) ( 1,1 )
{ a i , bi }= [ (−1 ,−1 )( 1,−1) ]
Using the complex envelope notation, a 4 level QAM constellation was used
to represent the combinational pairs of binary values.
5
Figure 3.1 4 level QAM constellation
First the flow of bits to be transmitted is split into two equal parts: this process
generates two independent signals to be transmitted. They are encoded separately just like
they were in an amplitude-shift keying (ASK) modulator. Then one channel (the one "in
phase") is multiplied by a cosine, while the other channel (in "Quadrature") is multiplied
by a sine. This way there is a phase of 90° between them. They are simply added one to
the other and sent through the real channel.
6
IV. 4-QAM Demodulation
clc;
clear all;
close all;
M=4;
%M=input(' enter the value of M array for QAM modulation : ');
fprintf('\n\n\n');
%XXXXXXXXXXXXXXXXXXXXXXXXXXX input chaking loop XXXXXXXXXXXXXXXXXXXXXXXXXX
Ld=log2(M);
ds=ceil(Ld);
dif=ds-Ld;
if(dif~=0)
error('the value of M is only acceptable if log2(M)is an integer');
end
7
x=msg;
bp=.000001; % bit period
bit=[];
for n=1:1:length(x)
if x(n)==1;
se=ones(1,100);
else x(n)==0;
se=zeros(1,100);
end
bit=[bit se];
end
t1=bp/100:bp/100:100*length(x)*(bp/100);
figure(1)
subplot(3,1,1);
plot(t1,bit,'lineWidth',2.5);grid on;
axis([ 0 bp*length(x) -.5 1.5]);
ylabel('amplitude(volt)');
xlabel(' time(sec)');
title('transmitting information as digital signal');
% binary information convert into symbolic form for 4-array QAM modulation
M=M; % order of QAM modulation
msg_reshape=reshape(msg,log2(M),nbit/log2(M))';
disp(' information are reshaped for convert symbolic form');
disp(msg_reshape);
fprintf('\n\n');
size(msg_reshape);
for(j=1:1:nbit/log2(M))
for(i=1:1:log2(M))
a(j,i)=num2str(msg_reshape(j,i));
end
end
as=bin2dec(a);
ass=as';
figure(1)
subplot(3,1,2);
stem(ass,'Linewidth',2.0);
title('serial symbol for 4-array QAM modulation at transmitter');
xlabel('n(discrete time)');
ylabel(' magnitude');
8
sr=1/sp; % symbol rate
f=sr*2;
t=sp/100:sp/100:sp;
ss=length(t);
m=[];
for(k=1:1:length(RR))
yr=RR(k)*cos(2*pi*f*t); % inphase or real component
yim=II(k)*sin(2*pi*f*t); % Quadrature or imagenary component
y=yr+yim;
m=[m y];
end
tt=sp/100:sp/100:sp*length(RR);
figure(1);
subplot(3,1,3);
plot(tt,m);
title('waveform for 4-array QAM modulation acording to symbolic information');
xlabel('time(sec)');
ylabel('amplitude(volt)');
ax=qamdemod(gt,M);
figure(3);
subplot(2,1,1);
stem(ax,'linewidth',2);
title(' re-obtain symbol after 4-array QAM demodulation ');
xlabel('n(discrete time)');
ylabel(' magnitude');
bi_in=dec2bin(ax);
[row col]=size(bi_in);
p=1;
for(i=1:1:row)
for(j=1:1:col)
re_bi_in(p)=str2num(bi_in(i,j));
9
p=p+1;
end
end
disp('re-obtain binary information after 4-array QAM demodulation');
disp(re_bi_in')
fprintf('\n\n');
10
Figure 5.2 4 level QAM Constellation
So
Ps =1−( 1−P sc ) 2
❑❑ E b
The bit-error rate depends on the bit to symbol mapping, but for ≫1 and
N0
a Gray-coded assignment—so that we can assume each symbol error causes only one
bit error- the bit-error rate is approximately
12
P sc 4 3 k Eb
Pbc ≈
1
k
= 1−
k √
1
(
M
Q ) (√ M −1 N 0 )
2
Since the carriers are independent, the overall bit error rate is the same as the
per-carrier error rate, just like BPSK and QPSK.
Pb=P bc
An exact and general closed-form expression of the Bit Error Rates (BER) for
rectangular type of Quadrature Amplitude Modulation (QAM) over AWGN and slow,
flat, Rician fading channels were derived analytically. Consider a (L×M)-QAM
system with 2. log 2 L levels and 2. log 2 M levels in the I-channel and Q-channel,
respectively and a two-dimensional grey code mapping employed. The generalized
expression for the conditional BER on SNR ρ ρ over AWGN channel is
log 2 L log 2 M
1
Pb ( E∨ ρ )=
log 2 ( L . M ) (∑i=1
L
Pb ( E ∨ρ ) + ∑ P b ( E i ∨ρ )
i
i=1
M
)
Where
i−1
j .2
2
(1−2−1 ) P−1
| |. 2 j ∙2i−1 1 6ρ
P
Pb ( E ∨ ρ )=
i
P
∑
j=0
(−1 ) P
( [ i−1
−
P
+
2 ]) [
∙ Q ( 2 j+1 )
√
( L + M 2−2 )
2
]
2. BER simulation using Matlab and comparing with theory
Matlab code
% Step 1. Generate message signal of length >= M^L.
M = 64; % Alphabet size of modulation
L = 1; % Length of impulse response of channel
msg = [0:M-1 0]; % M-ary message sequence of length > M^L
13
% Specify the receive filter as a pair of input arguments.
% In this case, num and den describe an ideal integrator.
num = ones(Nsamp,1)/Nsamp;
den = 1;
EbNo = 0:20; % Range of Eb/No values under study
ber = semianalytic(txsig,rxsig,'qam',M,Nsamp,num,den,EbNo);
Result
14
VII. Signal error rate
1. SER theory.
Es
The scaling factor of
√ 2
is for normalizing the average energy of the transmitted
symbols to 1, assuming that all the constellation points are equally likely.
Es Es
√ 2
(−1+ j)
√ 2
(1+ j)
Es Es
√ 2
(−1− j)
√ 2
(1− j)
Assuming that the additive noise follows the Gaussian probability distribution
function,
2
−( x− μ)
1 N0
with μ=0and σ 2=
2
σ
p ( x) = e
√2 π σ 2 2
Consider the symbol of s2, the conditional probability distribution function (PDF)
of y given s2 was transmitted is:
2
Es
(
− y−
2 )
1 N0
p ( y|s 2 ) = e
√π N 0
15
Figure 7.1 Probability density function for 4QAM modulation
As can be seen from the above figure, the symbol s2 is decoded correctly only if y
falls in the area in the hashed region i.e.
p¿
1
0
−(I y −
√ 2
)
1 Es
p ( I y>0|s2 )=1− ∫e
√ π N 0 −∞
N0
dy=1− erfc(
2 2 N0√)
∞
2 2
1
0
−(I y −
√ 2
)
1 Es
p ( Q y> 0|s 2 ) =1− ∫e
√ π N 0 −∞
N0
dy =1− erfc (
2 √
2 N0
)
p¿
[
= 1− erfc
2
2 (√ ) Es 1
+ erfc
2 N0 4
2
( √ )]
Es
2N0
16
Es Es
¿ 1−erfc (√ ) 1
+ erfc2
2 N0 4 (√ ) 2 N0
Hence, the total symbol error probability: the symbol will be in error, it at least one of the
symbol is decoded incorrectly. The probability of symbol error is,
Ps =1− p ¿
[ (√ )
= 1- 1−erfc
Es 1
+ erfc
2 N0 4
2
(√ ) ]
Es
2 N0
Es Es
= erfc (√ ) 1
− erfc2
2 N0 4 (√ )
2 N0
clear
N = 10^5; % number of symbols
Es_N0_dB = [-3:20]; % multiple Eb/N0 values
ipHat = zeros(1,N);
for ii = 1:length(Es_N0_dB)
ip = (2*(rand(1,N)>0.5)-1) + j*(2*(rand(1,N)>0.5)-1); %
s = (1/sqrt(2))*ip; % normalization of energy to 1
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white guassian noise, 0dB
variance
% demodulation
y_re = real(y); % real
y_im = imag(y); % imaginary
ipHat(find(y_re < 0 & y_im < 0)) = -1 + -1*j;
ipHat(find(y_re >= 0 & y_im > 0)) = 1 + 1*j;
ipHat(find(y_re < 0 & y_im >= 0)) = -1 + 1*j;
ipHat(find(y_re >= 0 & y_im < 0)) = 1 - 1*j;
17
end
simSer_4QAM = nErr/N;
theorySer_4QAM = erfc(sqrt(0.5*(10.^(Es_N0_dB/10)))) -
(1/4)*(erfc(sqrt(0.5*(10.^(Es_N0_dB/10))))).^2;
close all
figure
semilogy(Es_N0_dB,theorySer_4QAM,'b.-');
hold on
semilogy(Es_N0_dB,simSer_4QAM,'mx-');
axis([-3 15 10^-5 1])
grid on
legend('theory-4QAM', 'simulation-4QAM');
xlabel('Es/No, dB')
ylabel('Symbol Error Rate')
title('Symbol error probability curve for 4-QAM')
Result
18
From figure, we see that the simulation results and calculation theory are almost
same.
VIII. CONCLUSION
This report has detailed our implementation of the complete Four Level
Quadrature Amplitude Modulation. We simulated 4-QAM modulation/demodulation
techniques by using Matlab. Also, Matlab is used to evaluate the performance of 4- QAM
technique through plotting the Bit Error Rate (BER) vs Signal Error Rate (SER). Our
results match the theoretical values exactly.
19
REFERENCES
20