Sie sind auf Seite 1von 9

DIGITAL COMMUNICATION LAB REPORT

Experiment Number 7

QUADRATURE AMPLITUDE MODULATION


SOFTWARE IMPLEMENTATION

Submitted by:
R. Saketh B140540EC

R. M. Alagappan B140490EC

R.V.V. Ashish B140614EC

Venkatesh. U B140709EC

S.V.Krishna Naik B120820EC


AIM:
To perform QAM for different constellations (rectangular, 1 circular (1 circle),
2 circular (2 circles)) and to compare the measured error rate with the theoretical
error probabilities and to compare the error probabilities for each constellation to
find which one has the highest performance.

THEORY:

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 (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 of the same frequency,
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 final waveform is a combination of both
phase-shift keying (PSK) and amplitude-shift keying (ASK), or, in the analog case, of
phase modulation (PM) and amplitude modulation.

Rectangular QAM constellations are, in general, sub-optimal in the sense that they
do not maximally space the constellation points for a given energy. However, they
have the considerable advantage that they may be easily transmitted as two pulse
amplitude modulation (PAM) signals on quadrature carriers, and can be easily
demodulated.

The circular QAM constellations highlights the relationship between QAM and PSK.
Although, in general, there is a non-rectangular constellation that is optimal for a
particular M, they are not often used since the rectangular QAMs are much easier to
modulate and demodulate.

Rectangular QAM Circular QAM


CODE:
clc
clear
close all

nbits=3e5;
M=8;
nBitsPerSym = log2(M);

map_1=[-1+1j,-3+1j,-1-1j,-3-1j,1+1j,3+1j,1-1j,3-1j];
map_2=[2,-2,2j,-2j,(1+j)*sqrt(2),(1-j)*sqrt(2),(-
1+j)*sqrt(2),(-1-j)*sqrt(2)];
map_3=[1+1j,1-1j,-1+1j,-1-1j,3,3j,-3,-3j];
array=[map_1;map_2;map_3];

EsN0dB=0:18;
EbN0dB=EsN0dB-10*log10(nBitsPerSym);
symbErrors = zeros(3,length(EbN0dB));
for h=1:3
map=array(h,:);
figure
plot(real(map),imag(map),'r*');
title('Constellation diagram for Transmitted Symbols');
xlabel('Inphase component');
ylabel('Quadrature component');
axis([-5 5 -5 5]);
sym_map =sqrt(1/6)*map;
refI = real(sym_map);
refQ = imag(sym_map);

simulatedBER(h,:)= zeros(1,length(EbN0dB));
theoreticalBER(h,:) = zeros(1,length(EbN0dB));
theoreticalSER(h,:) = zeros(1,length(EbN0dB));

count=1;

for i=EbN0dB

data_bits=double(rand(1,nbits)>=0.5);
inputSymBin=reshape(data_bits,nBitsPerSym,[])';
b = inputSymBin*(2.^((nBitsPerSym-1):-1:0)).';
s=sym_map(b+1).';
EbN0 = 10.^(i/10);
EsN0 = 10.^(EsN0dB(count)/10);
noiseSigma = sqrt(1./(2*nBitsPerSym*EbN0));

n =
noiseSigma*(randn(1,length(s))+1i*randn(1,length(s)))';
y = s + n;
demodSymbols = zeros(1,length(y));
for j=1:length(y)
[minVal,minindex]=min(sqrt((real(y(j))-
refI(1,:)).^2+...
(imag(y(j))-refQ(1,:)).^2));
demodSymbols(j)=minindex-1;
end

symbErrors_t=b.'-demodSymbols;

symbErrors(h,count)=sum(symbErrors_t(:)~=0)/(nbits/nBitsPerSym
);

demodBits=dec2bin(demodSymbols)-'0';
outputSymBin=reshape(demodBits.',1,[])';

bitErrors=sum(sum(xor(outputSymBin.',data_bits)));
simulatedBER(h,count) = bitErrors/nbits;

theoreticalBER(1,count)= 2*erfc(sqrt((9/14)*EbN0));
theoreticalBER(2,count)= erfc(sqrt(3*EbN0/14))*sin(pi/8);
theoreticalBER(3,count)= 3.5*erfc(sqrt(EbN0));
count=count+1;
end
end
theoreticalSER=(theoreticalBER)*(nBitsPerSym);
figure;
semilogy(EbN0dB,simulatedBER(1,:),'k-o');hold on;
semilogy(EbN0dB,simulatedBER(2,:),'r-*');hold on;
semilogy(EbN0dB,simulatedBER(3,:),'g-+');hold off;
title('BER Vs Eb/N0 (dB) for 8-QAM Modulation-simulated');
legend('rectangular','circular(1)','circular(2)','theoretical'
);
axis('tight');
grid on;
xlabel('Eb/N0 dB');
ylabel('BER - Bit Error Rate');
grid on;
figure;
semilogy(EbN0dB,theoreticalBER(1,:),'k-o');hold on;
semilogy(EbN0dB,theoreticalBER(2,:),'r-*');hold on;
semilogy(EbN0dB,theoreticalBER(3,:),'g-+');hold off;

title('BER Vs Eb/N0 (dB) for 8-QAM Modulation-theoretical');


legend('rectangular','circular(1)','circular(2)','theoretical'
);
axis('tight');
grid on;
xlabel('Eb/N0 dB');
ylabel('BER - Bit Error Rate');
grid on;
figure;
semilogy(EbN0dB,simulatedBER(1,:),'k-o');hold on;
semilogy(EbN0dB,theoreticalBER(1,:),'b-');

title('BER Vs Eb/N0 (dB) for 8-QAM Modulation');


legend('rectangular','theoretical');
xlabel('Eb/N0 dB');
ylabel('BER - Bit Error Rate');
grid on;
figure;
semilogy(EbN0dB,simulatedBER(2,:),'r-*');hold on;
semilogy(EbN0dB,theoreticalBER(2,:),'b-');
title('BER Vs Eb/N0 (dB) for 8-QAM Modulation');
legend('circular(2)','theoretical');
xlabel('Eb/N0 dB');
ylabel('BER - Bit Error Rate');
grid on;
figure;
semilogy(EbN0dB,simulatedBER(3,:),'g-+');hold on;
semilogy(EbN0dB,theoreticalBER(3,:),'b-');
title('BER Vs Eb/N0 (dB) for 8-QAM Modulation');
legend('circular(1)','theoretical');
xlabel('Eb/N0 dB');
ylabel('BER - Bit Error Rate');
grid on;
semilogy(EsN0dB,symbErrors,'k-o');hold on;
title('SER Vs Es/N0 (dB) for 8-Ary Modulation');
xlabel('Es/N0 dB');
ylabel('SER - Symbol Error Rate');
grid on;
figure;
semilogy(EsN0dB,symbErrors(1,:),'k-o');hold on;
semilogy(EsN0dB,symbErrors(2,:),'b-o');hold on;
semilogy(EsN0dB,symbErrors(3,:),'r-o');hold on;
semilogy(EsN0dB,theoreticalSER(1,:),'k-*');hold on;
semilogy(EsN0dB,theoreticalSER(2,:),'b-*');hold on;
semilogy(EsN0dB,theoreticalSER(3,:),'r-*');hold off;
title('SER Vs Es/N0 (dB) for 8-Ary Modulation');
legend('Rect','Circ2','Circ1','TheoreticalRect','Theoreticalci
rc2','Theoreticalcirc1');
grid on;
xlabel('Es/N0 dB');
ylabel('SER - Symbol Error Rate');
grid on;
PLOTS:
1. Constellation diagrams without noise.

1. Rectangular

2. Circular (1 Circle)

3. Circular (2 Circles)
2. Constellation diagrams with noise(AWGN).

1. Rectangular

2. Circular (1 Circle)

3. Circular (2 Circles)
3. BER Comparison with theoretical values.

Here it can be seen that the circular 2 constellation has the best BER
performance among the three. This is because the constellation points are the
farthest away from each other in comparison, giving the best performance.
4. Comparison of each scheme with theoretical and simulated.

RESULT:
QAM modulation schemes were implemented as a simulation and their
error performance is evaluated on the basis of BER.

Das könnte Ihnen auch gefallen