Name: Muhammad Shahab Reg#no: 16bnele0772 Assignment: 02 Submitted To: Engr Fawad Assignment Title: QPSK and QAM16 Implementation in Matlab
Name: Muhammad Shahab Reg#no: 16bnele0772 Assignment: 02 Submitted To: Engr Fawad Assignment Title: QPSK and QAM16 Implementation in Matlab
Name: Muhammad Shahab Reg#no: 16bnele0772 Assignment: 02 Submitted To: Engr Fawad Assignment Title: QPSK and QAM16 Implementation in Matlab
Reg#no : 16bnele0772
Assignment : 02
Submitted to : Engr Fawad
Assignment Title :
QPSK and QAM16 implementation in matlab
Fowlling Steps
First generate Random bits and
Convert bits into QPSK symbols
Then generate QPSK waveform by means of
modulation.
Then add AWGN noise to QPSK waveform and transmit the resulted QPSK
signal to the other station
And demodulate the received signal to recover
original bits then calculate the Bit Error
Rate(BER)
At last Plot waterfall curve for BER vs
Eb/No.
Same procedure should apply for QAM-16 modulation.
Curve explanation:
In this program calculate the Bit Error Rate (BER) of QPSK in an Additive
White Gaussian Noise (AWGN) channel.
This modulation and demodulation is done at baseband. The (BER) curve illustrates the
relationship between power in the transmitted signal in terms of signal to noise ratio (SNR) and
the resulting BER for the system.
2-Matlab code of 16-QAM for a given task.
clear all;
close all;
N = 2*10^5; % number of symbols
alpha16qam = [-3 -1 1 3]; % 16-QAM alphabets
Es_N0_dB = [0:20];
ipHat = zeros(1,N);
for ii = 1:length(Es_N0_dB)
ip = randsrc(1,N,alpha16qam) + j*randsrc(1,N,alpha16qam);
s = (1/sqrt(10))*ip;
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)];
y = s + 10^(-Es_N0_dB(ii)/20)*n;
y_re = real(y);
y_im = imag(y);
ipHat_re(find(y_re< -2/sqrt(10))) = -3;
ipHat_re(find(y_re > 2/sqrt(10))) = 3;
ipHat_re(find(y_re>-2/sqrt(10) & y_re<=0)) = -1;
ipHat_re(find(y_re>0 & y_re<=2/sqrt(10))) = 1;
ipHat_im(find(y_im< -2/sqrt(10))) = -3;
ipHat_im(find(y_im > 2/sqrt(10))) = 3;
ipHat_im(find(y_im>-2/sqrt(10) & y_im<=0)) = -1;
ipHat_im(find(y_im>0 & y_im<=2/sqrt(10))) = 1;
ipHat = ipHat_re + j*ipHat_im;
nErr(ii) = size(find([ip- ipHat]),2); % couting the number of errors
end
simBer = nErr/N;
theoryBer = 3/2*erfc(sqrt(0.1*(10.^(Es_N0_dB/10))));
close all
figure
semilogy(Es_N0_dB,theoryBer,'b.-','LineWidth',2);
hold on
semilogy(Es_N0_dB,simBer,'mx-','Linewidth',2);
axis([0 20 10^-5 1])
grid on
legend('theory', 'simulation');
xlabel('Es/No, dB')
ylabel('Symbol Error Rate')
title('Symbol error probability curve for 16-QAM modulation')
Plot waterfall curve for BER vs Eb/No.
Curve Explanation:
To assess the performance of a higher order modulation system is to measure
the (SER) or (BER) over a range of background noise (loading) conditions.
Applying (AWGN), which has well defined mathematical properties, comparative analysis of
different types of higher order modulation systems can be reliably performed.