BHARATIYA VIDYA BHAVAN’S
SARDAR PATEL INSTITUTE OF TECHNOLOGY
MUNSHI NAGAR, ANDHERI(W), MUMBAI 400058
Electronics and Telecommunication Department,
Academic Year- 2024-2025
Name: - Shubham Pramod Mundada
UID No: - 2024201014
EXTC: -B3
Subject: - ADC (Analog and Digital Communication)
Guided By: - Dr.N.A. Bhagat and Dr. Inderkumar Kochar.
Aim:
To analyze the Bit Error Rate (BER) performance of the Quadrature Phase Shift Keying (QPSK)
modulation scheme over an Additive White Gaussian Noise (AWGN) channel using MATLAB.
Objectives/Problem statement:
1. To simulate QPSK modulation and demodulation using MATLAB.
2. To evaluate and compare the BER performance of QPSK over AWGN for various
SNR values.
3. To compare the simulated BER with the theoretical BER for validation.
4. To observe and analyze the histogram of the received noisy QPSK signal
Brief Theory:
QPSK (Quadrature Phase Shift Keying) is a digital modulation technique that encodes two
bits per symbol using four distinct phase shifts. It is bandwidth-efficient and widely used in wireless
communication systems. In a real-world channel, signals are affected by AWGN (Additive White
Gaussian Noise), which introduces random noise to the transmitted signal. BER (Bit Error Rate) is
used to measure how many bits were received incorrectly due to noise. The performance of QPSK in
such an environment is evaluated by calculating the BER for different SNR (Signal-to-Noise Ratio)
levels. The theoretical BER for QPSK in AWGN is given by:
Where Q(.) is the Q-function, and Eb/N0 is the energy per bit to noise power spectral density
ratio.
Matlab Code for QPSK : -
clc;
clear;
% User Inputs
N = 1e6; % Number of bits
EbN0_dB = 0:1:10; % SNR in dB
Eb = 1; % Bit energy
M = 4; % QPSK => 4 symbols
k = log2(M); % Bits per symbol
% Bit Generation
bits = randi([0 1], 1, N);
% QPSK Symbol Mapping (Gray coding)
bit_pairs = reshape(bits, 2, []).';
symbols = (1/sqrt(2)) * ((2*bit_pairs(:,1)-1) + 1j*(2*bit_pairs(:,2)-1));
BER_sim = zeros(size(EbN0_dB));
BER_theory = zeros(size(EbN0_dB));
for i = 1:length(EbN0_dB)
EbN0 = 10^(EbN0_dB(i)/10);
N0 = Eb/EbN0;
noise = sqrt(N0/2)*(randn(size(symbols)) + 1j*randn(size(symbols)));
% Transmit over AWGN channel
r = symbols + noise;
% Receiver - Coherent Detection
rx_bits = zeros(size(bit_pairs));
rx_bits(:,1) = real(r) > 0;
rx_bits(:,2) = imag(r) > 0;
% Bit error count
rx_bitstream = reshape(rx_bits.', 1, []);
BER_sim(i) = sum(bits ~= rx_bitstream)/N;
% Theoretical BER for QPSK
BER_theory(i) = qfunc(sqrt(2*EbN0));
end
% Display BER Results Table
fprintf('\nSNR (dB) | Simulated BER | Theoretical BER\n');
fprintf('-------------------------------------------\n');
for i = 1:length(EbN0_dB)
fprintf(' %2d | %e | %e\n', EbN0_dB(i), BER_sim(i),
BER_theory(i));
end
% Plot BER curve
figure;
semilogy(EbN0_dB, BER_sim, 'bo-', 'LineWidth', 1.5);
hold on;
semilogy(EbN0_dB, BER_theory, 'r--', 'LineWidth', 1.5);
grid on;
xlabel('Eb/N0 (dB)');
ylabel('Bit Error Rate (BER)');
legend('Simulated BER', 'Theoretical BER');
title('BER Performance of QPSK over AWGN');
% Histogram of received signal at mid SNR
mid_idx = round(length(EbN0_dB)/2);
EbN0 = 10^(EbN0_dB(mid_idx)/10);
N0 = Eb/EbN0;
noise = sqrt(N0/2)*(randn(size(symbols)) + 1j*randn(size(symbols)));
r = symbols + noise;
figure;
histogram(real(r), 50);
hold on;
histogram(imag(r), 50);
xlabel('Amplitude');
ylabel('Frequency');
legend('In-phase', 'Quadrature');
title(['Histogram of Received QPSK Signal at Eb/N0 = ',
num2str(EbN0_dB(mid_idx)), ' dB']);
Performing on matlab in LAB: -
Outputs: -
Table: -
SNR (dB) Simulated BER Theoretical BER
0 7.435720e-02 7.865655e-02
1 5.574300e-02 5.952532e-02
2 4.008100e-02 4.391158e-02
3 2.775800e-02 3.095818e-02
4 1.876800e-02 2.048243e-02
5 1.200300e-02 1.233280e-02
6 7.119000e-03 6.704256e-03
7 3.856000e-03 3.100635e-03
8 1.775000e-03 1.234643e-03
9 6.890000e-04 4.051335e-04
10 2.240000e-04 1.266416e-04
Conclusion: -