0% found this document useful (0 votes)
2 views

File

The document outlines experiments to simulate and analyze the Bit Error Rate (BER) performance of various modulation techniques, including BPSK, BFSK, NCBFSK, and DBPSK, in an Additive White Gaussian Noise (AWGN) channel, using MATLAB software. It details the theoretical underpinnings of each modulation method, the corresponding MATLAB code for simulation, and concludes that BPSK and BFSK perform better than NCBFSK and DBPSK. Additionally, it discusses QPSK modulation and M-ary Quadrature Amplitude Modulation (M-QAM), highlighting their efficiency and performance in noisy environments.

Uploaded by

pranayjn14
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

File

The document outlines experiments to simulate and analyze the Bit Error Rate (BER) performance of various modulation techniques, including BPSK, BFSK, NCBFSK, and DBPSK, in an Additive White Gaussian Noise (AWGN) channel, using MATLAB software. It details the theoretical underpinnings of each modulation method, the corresponding MATLAB code for simulation, and concludes that BPSK and BFSK perform better than NCBFSK and DBPSK. Additionally, it discusses QPSK modulation and M-ary Quadrature Amplitude Modulation (M-QAM), highlighting their efficiency and performance in noisy environments.

Uploaded by

pranayjn14
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

EXPERIMENT:

AIM:
To simulate and analyze the Bit Error Rate (BER) performance different modulation techniques in an
Additive White Gaussian Noise(AWGN) channel and compare the simulated BER results with theoretical
expectations, as a function of the Signal-to-Noise Ratio (SNR). Hence we will be plotting BER vs SNR for:
1. Binary Phase Shift Keying (BPSK)
2. Binary Frequency Shift Keying (BFSK)
3. Non-coherent Binary Frequency Shift Keying (NCBFSK)
4. Differential Binary Phase Shift Keying (DBPSK)

REQUIREMENTS:
MATLAB software

THEORY:
Modulation Techniques:
In digital modulation, binary data is transmitted by altering a carrier signal’s phase or frequency. This
experiment focuses on:
1. BPSK (Binary Phase Shift Keying):
BPSK modulates data by shifting the phase of a carrier signal between 0 and π to represent
binary 0 and 1. It is robust in noisy environments and performs well with coherent detection.
Theoretical BER in an AWGN channel is given by:
2
𝐵𝐸𝑅 = 𝑄( √2. 𝑆𝑁𝑅 )
2. BFSK (Binary Frequency Shift Keying):
BFSK transmits data using two distinct frequencies to represent bits. It performs similarly to BPSK
under coherent detection.
3. NCBFSK (Non-Coherent BFSK):
NCBFSK avoids phase synchronization at the receiver, making it simpler but slightly less efficient
than coherent BFSK. Theoretical BER:
1 −𝑆𝑁𝑅
𝐵𝐸𝑅 = 𝑒 2
2
4. DBPSK (Differential BPSK):
DBPSK encodes data as phase differences between successive symbols, eliminating the need for
phase coherence. Theoretical BER:
1 −𝑆𝑁𝑅
𝐵𝐸𝑅 = 𝑒
2
CODES:
For BFSK:
clear all; for i = 1:length(SNR_dB)
clc; bits = randi([0 1], 1, N);
N = 1e6; % Reduced for faster computation freq_0_symbol = 1; % Symbol for bit 0
SNR_dB = 0:1:15; freq_1_symbol = -1; % Symbol for bit 1
SNR_linear = 10.^(SNR_dB/10); tx_signal = freq_0_symbol * (bits == 0) + freq_1_symbol *
BER = zeros(1, length(SNR_dB)); (bits == 1);
for i = 1:length(SNR_dB) noise = sqrt(1/(2*SNR_linear(i))) * randn(1, N);
bits = randi([0 1], 1, N); rx_signal = tx_signal + noise;
freq_0_symbol = 1; % Symbol for bit 0 bits_received = rx_signal < 0; % If signal < 0, it was bit 1
freq_1_symbol = -1; % Symbol for bit 1 errors = sum(bits ~= bits_received);
tx_signal = freq_0_symbol * (bits == 0) + freq_1_symbol * BER(i) = errors/N;
(bits == 1); end
noise = sqrt(1/(2*SNR_linear(i))) * randn(1, N); BER_theoretical = 0.5 * erfc(sqrt(SNR_linear / 2));
rx_signal = tx_signal + noise; figure;
bits_received = rx_signal < 0; % If signal < 0, it was bit 1 semilogy(SNR_dB, BER, 'b-o', 'LineWidth', 2);
errors = sum(bits ~= bits_received); hold on;
BER(i) = errors/N; semilogy(SNR_dB, BER_theoretical, 'r--', 'LineWidth', 2);
end grid on;
BER_theoretical = 0.5 * erfc(sqrt(SNR_linear / 2)); xlabel('SNR (dB)');
figure; ylabel('Bit Error Rate (BER)');
semilogy(SNR_dB, BER, 'b-o', 'LineWidth', 2); title('BER vs SNR for BFSK (Efficient)');
hold on; legend('Simulated BER', 'Theoretical BER');
semilogy(SNR_dB, BER_theoretical, 'r--', 'LineWidth', 2); hold off;
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR for BFSK (Efficient)');
legend('Simulated BER', 'Theoretical BER');
hold off;
clear all;
clc;
N = 1e6; % Reduced for faster computation
SNR_dB = 0:1:15;
SNR_linear = 10.^(SNR_dB/10);
BER = zeros(1, length(SNR_dB));
For BPSK:
clear all; % Theoretical BER for BPSK in AWGN
clc; BER_theoretical = 0.5 * erfc(sqrt(SNR_linear));
% Number of bits to transmit % Plot BER vs SNR
N = 1e6; figure;
% SNR values in dB semilogy(SNR_dB, BER, 'b-o', 'LineWidth', 2);
SNR_dB = 0:1:15; hold on;
% Convert SNR from dB to linear scale semilogy(SNR_dB, BER_theoretical, 'r--', 'LineWidth', 2);
SNR_linear = 10.^(SNR_dB/10); grid on;
% Initialize BER array xlabel('SNR (dB)');
BER = zeros(1, length(SNR_dB)); ylabel('Bit Error Rate (BER)');
% Loop over each SNR value title('BER vs SNR for BPSK');
for i = 1:length(SNR_dB) legend('Simulated BER', 'Theoretical BER');
% Generate random bits (0 and 1) hold off;
bits = randi([0 1], 1, N);
% BPSK Modulation (0 -> -1, 1 -> 1)
tx_signal = 2*bits - 1;
% Generate AWGN noise
noise = sqrt(1/(2*SNR_linear(i))) * randn(1, N);
% Received signal
rx_signal = tx_signal + noise;
% BPSK Demodulation (Decide if bit is 1 or 0)
bits_received = rx_signal > 0;
% Calculate the number of errors
errors = sum(bits ~= bits_received);
% Estimate the Bit Error Rate
BER(i) = errors/N;
end
For NC-BFSK:
% Clear workspace and command window % Theoretical BER for Non-Coherent BFSK in AWGN
clear all; BER_theoretical = 0.5 * exp(-SNR_linear / 2);
clc; % Plot BER vs SNR
% Number of bits to transmit figure;
N = 1e6; % Reduced for faster computation semilogy(SNR_dB, BER, 'b-o', 'LineWidth', 2);
% SNR values in dB hold on;
SNR_dB = 0:1:15; semilogy(SNR_dB, BER_theoretical, 'r--', 'LineWidth', 2);
% Convert SNR from dB to linear scale grid on;
SNR_linear = 10.^(SNR_dB/10); xlabel('SNR (dB)');
% Initialize BER array ylabel('Bit Error Rate (BER)');
BER = zeros(1, length(SNR_dB)); title('BER vs SNR for Non-Coherent BFSK (Efficient)');
% Loop over each SNR value legend('Simulated BER', 'Theoretical BER');
for i = 1:length(SNR_dB) hold off;
% Generate random bits (0 and 1)
bits = randi([0 1], 1, N);
% NCBFSK Modulation (Non-coherent):
% Symbols representing different frequencies (use energy
concept)
% Using +1 and -1 as simple BFSK symbols
symbol_0 = sqrt(2) * ones(1, N); % Symbol for bit 0 (constant
energy)
symbol_1 = sqrt(2) * -ones(1, N); % Symbol for bit 1 (constant
energy)
% Modulate the bits
tx_signal = symbol_0 .* (bits == 0) + symbol_1 .* (bits == 1);
% Add AWGN noise
noise = sqrt(1/(2*SNR_linear(i))) * randn(1, N);
rx_signal = tx_signal + noise;
% NCBFSK Demodulation:
% Energy detection (approximation)
energy_0 = rx_signal.^2; % Received energy for both symbols
% Decide bit based on received energy
bits_received = rx_signal < 0; % If signal < 0, it was bit 1
% Calculate the number of errors
errors = sum(bits ~= bits_received);
% Estimate the Bit Error Rate
BER(i) = errors / N;
end
For D-BPSK:
% Clear workspace and command window % DBPSK Demodulation:
clear all; % Decode by comparing consecutive symbols (non-
clc; coherent detection)
% Number of bits to transmit demodulated_bits = zeros(1, N); % Initialize
N = 1e6; % Number of bits demodulated bits
% SNR values in dB for k = 2:N
SNR_dB = 0:1:15; demodulated_bits(k) = real(rx_signal(k) *
% Convert SNR from dB to linear scale conj(rx_signal(k-1))) > 0; % Compare phases
SNR_linear = 10.^(SNR_dB/10); end
% Initialize BER array % First bit is demodulated directly based on sign of
BER = zeros(1, length(SNR_dB)); received signal
% Loop over each SNR value demodulated_bits(1) = real(rx_signal(1)) > 0;
for i = 1:length(SNR_dB) % Calculate the number of errors
% Generate random bits (0 and 1) errors = sum(bits ~= demodulated_bits);
bits = randi([0 1], 1, N); % Estimate the Bit Error Rate (BER)
% DBPSK Modulation: BER(i) = errors / N;
% Differential encoding of bits end
symbols = 2 * bits - 1; % BPSK symbols (+1 or -1)
dbpsk_tx = zeros(1, N); % Initialize modulated signal % Theoretical BER for DBPSK in AWGN (approximated
dbpsk_tx(1) = symbols(1); % The first symbol is transmitted as by BPSK in noise)
is BER_theoretical = 0.5 * exp(-SNR_linear);
% Differential encoding: multiply consecutive symbols % Plot BER vs SNR
for k = 2:N figure;
dbpsk_tx(k) = dbpsk_tx(k-1) * symbols(k); semilogy(SNR_dB, BER, 'b-o', 'LineWidth', 2);
end hold on;
% Add AWGN noise semilogy(SNR_dB, BER_theoretical, 'r--', 'LineWidth',
noise = sqrt(1/(2 * SNR_linear(i))) * (randn(1, N) + 1j * randn(1, 2);
N)); % Complex noise grid on;
rx_signal = dbpsk_tx + noise; % Received signal with noise xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR for DBPSK (Corrected Final Version)');
legend('Simulated BER', 'Theoretical BER');
hold off;

CONCLUSION:
The simulation shows that BPSK and BFSK offer better BER performance, while NCBFSK and DBPSK perform slightly worse.
Simulated BER aligns well with theoretical predictions in an AWGN channel.
EXPERIMENT:

AIM:
To simulate QPSK modulation over an AWGN channel, analyze its Bit Error Rate (BER) performance at a
given SNR, and visualize the noisy QPSK constellation.

REQUIREMENTS:
MATLAB software

THEORY:
Quadrature Phase Shift Keying (QPSK) is a digital modulation scheme where two bits are represented by
one symbol, allowing for efficient data transmission. Each symbol is mapped to one of four possible
phases: 45°, 135°, 225°, and 315°. This ensures that both in-phase (I) and quadrature (Q) components of
the signal are used for data transmission, effectively doubling the bandwidth efficiency compared to
BPSK.
In this experiment, random binary data is generated and mapped to QPSK symbols. The transmitted
symbols pass through an Additive White Gaussian Noise (AWGN) channel, which introduces noise. At the
receiver, the noisy QPSK symbols are demodulated by detecting the real and imaginary parts of the
received signal. By comparing the transmitted and received bits, the Bit Error Rate (BER) is calculated,
indicating the performance of QPSK in the noisy environment. A scatter plot of the noisy received
symbols is also generated to visualize the impact of noise on the QPSK constellation.

CODES:
% Parameters % Step 5: Calculate Bit Error Rate (BER)
num_bits = 1000; % Number of bits to transmit num_errors = sum(data_bits ~= demodulated_bits);
Eb_No_dB = 10; % Energy per bit to noise power spectral BER = num_errors / num_bits;
density ratio in dB % Display Results
% Step 1: Generate random binary data fprintf('Eb/No (dB): %d\n', Eb_No_dB);
data_bits = randi([0 1], 1, num_bits); fprintf('Number of Errors: %d\n', num_errors);
% Step 2: QPSK Modulation fprintf('Bit Error Rate (BER): %f\n', BER);
% Map the binary data to QPSK symbols % Custom Scatter Plot (Without Communications Toolbox)
data_symbols = 1/sqrt(2) * (2*data_bits(1:2:end) - 1 + figure;
1i*(2*data_bits(2:2:end) - 1)); plot(real(received_symbols), imag(received_symbols), 'o');
% Step 3: Add AWGN Noise title('QPSK Constellation with AWGN');
Eb_No = 10^(Eb_No_dB/10); % Convert Eb/No from dB to xlabel('In-phase Component');
linear scale ylabel('Quadrature Component');
noise_variance = 1/(2*Eb_No); % Noise variance calculation grid on;
noise = sqrt(noise_variance) * (randn(1, num_bits/2) + axis([-2 2 -2 2]);
1i*randn(1, num_bits/2));
received_symbols = data_symbols + noise;
% Step 4: QPSK Demodulation
demodulated_bits = zeros(1, num_bits);
demodulated_bits(1:2:end) = real(received_symbols) > 0;
demodulated_bits(2:2:end) = imag(received_symbols) > 0;
CONCLUSION:
The simulation demonstrated QPSK modulation over an AWGN channel, showing that BER decreases
with increasing SNR. The noisy constellation plot illustrated the effect of noise, confirming QPSK's
efficiency and its alignment with theoretical expectations.
EXPERIMENT:

AIM:
To simulate and analyze the Symbol Error Rate (SER) performance of M-ary Quadrature Amplitude
Modulation (M-QAM) over an Additive White Gaussian Noise (AWGN) channel for various values of
MMM and both square and cross constellations, and to compare the SER vs SNR performance for
different modulation orders.

REQUIREMENTS:
MATLAB software

THEORY:
M-ary Quadrature Amplitude Modulation (M-QAM) transmits data by varying both amplitude and phase,
with MMM representing the number of symbols. Each symbol carries log⁡2(M)\log_2(M)log2(M) bits.
Square constellations arrange symbols in a grid, while cross constellations use a cross-like pattern.
When transmitted over an AWGN channel, noise can cause symbol detection errors, measured as the
Symbol Error Rate (SER). The SER for M-QAM depends on the signal-to-noise ratio (SNR) and modulation
order MMM. Higher modulation orders increase data rates but make the system more susceptible to
noise. This experiment compares the SER performance of different modulation orders and constellation
structures (square vs cross) by plotting SER vs SNR.
The theoretical SER for M-QAM in an AWGN channel depends on the signal-to-noise ratio (SNR) and the
modulation order M, and for square constellations, it is approximated by:

1 3 𝑙𝑜𝑔2(𝑀) ⋅ 𝐸𝑏
𝑆𝐸𝑅𝑆𝑄∪𝐴𝑅𝐸 ≈ 4 (1 − ) 𝑄 (√ )
√𝑀 (𝑀 − 1) ⋅ 𝑁0

Where:
• Q(x) is the Q-function, representing the tail probability of a Gaussian distribution.
• 𝐸𝑏 is the energy per bit.
• 𝑁0 is the noise power spectral density.
For cross constellations, the calculation of SER is more complex, but follows a similar principle with a
different arrangement of constellation points.
By varying M (e.g., 16-QAM, 64-QAM) and comparing square and cross constellations, we can analyze
the trade-offs between higher modulation orders (which increase data rates but are more susceptible to
noise) and the choice of constellation structure. Plotting SER vs SNR helps to evaluate the performance
of M-QAM under different noise conditions and modulation configurations.
CODE:
% MATLAB code to plot SER vs SNR for M-ary QAM (Square % Square Constellation SER
and Cross Constellations) for i = 1:length(m_values_square)
clc; M = m_values_square(i);
clear; ser = ser_mary_qam(M, snr_linear);
close all; plot(snr_db, ser, 'LineWidth', 2, 'DisplayName', ['Square
% SER calculation function for M-ary QAM QAM, M=', num2str(M)]);
ser_mary_qam = @(M, snr_linear) 4 * (1 - 1 ./ sqrt(M)) .* end
0.5 .* erfc(sqrt(3 * log2(M) .* snr_linear ./ (M - 1)) / sqrt(2)); % Cross Constellation SER (for simplicity, using same
% SNR values in dB and converting them to linear scale formula as QAM)
snr_db = linspace(0, 30, 100); for i = 1:length(m_values_cross)
snr_linear = 10.^(snr_db / 10); M = m_values_cross(i);
% M values for square and cross constellations ser = ser_mary_qam(M, snr_linear);
m_values_square = [4, 16, 64]; % Square constellations plot(snr_db, ser, '--', 'LineWidth', 2, 'DisplayName', ['Cross
m_values_cross = [32, 128]; % Cross constellations QAM, M=', num2str(M)]);
% Plotting end
figure; % Formatting the plot
hold on; set(gca, 'YScale', 'log');
xlabel('SNR (dB)');
ylabel('Symbol Error Rate (SER)');
title('SER vs SNR for M-ary QAM (Square and Cross
Constellations)');
legend show;
grid on;
hold off;

CONCLUSION:
The simulation showed that increasing the modulation order MMM in M-ary QAM results in a higher Symbol Error Rate (SER)
at a given SNR, illustrating the trade-off between data rates and noise susceptibility. Square constellations outperformed cross
constellations, indicating that higher-order QAM requires a higher SNR for acceptable error rates.

You might also like