Assignment 3: Simulation of 4G (LTE) and 5G (NR) using LTE tool
1) Code:
%clc;
%clear;
%% Data (You can replace these with your real simulation outputs)
% 1. SNR values (0 to 20 dB in steps)
snr = 0:2.5:20;
% === Dummy BER values ===
ber_lte = [0.5 0.35 0.25 0.15 0.08 0.04 0.02 0.01 0.005];
ber_5g = [0.35 0.2 0.12 0.06 0.03 0.01 0.005 0.002 0.001];
% === Dummy Throughput values (Mbps) ===
thr_lte = [10 12 14 15 16 17 17.5 17.8 18];
thr_5g = [15 20 23 25 27 28 29 29.5 30];
% === Dummy handover events ===
users = 1:11;
handover_events = [1 3 6 10 15 25 38 52 67 80 90];
%% ========== Plotting ==========
figure;
% --- 1. BER vs SNR ---
subplot(3,1,1);
semilogy(snr, ber_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
semilogy(snr, ber_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR');
legend('LTE', '5G NR', 'Location', 'northeast');
% --- 2. Throughput vs SNR ---
subplot(3,1,2);
plot(snr, thr_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
plot(snr, thr_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 1
xlabel('SNR (dB)');
ylabel('Throughput (Mbps)');
title('Throughput vs SNR');
legend('LTE', '5G NR', 'Location', 'southeast');
% --- 3. Handover Events vs Number of Users ---
subplot(3,1,3);
plot(users, handover_events, '-o', 'Color', [0.4 0 0.9], 'LineWidth', 2);
grid on;
xlabel('Number of Users');
ylabel('Number of Events');
title('Handover Events vs Number of Users');
Output:
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 2
2) Code:
%clc;
%clear;
%% Data (You can replace these with your real simulation outputs)
snr = 0:2.5:20;
ber_lte = [0.48 0.32 0.22 0.14 0.07 0.035 0.017 0.009 0.0045];
ber_5g = [0.33 0.19 0.11 0.055 0.028 0.012 0.006 0.0025 0.0012];
thr_lte = [11 13 14.5 15.5 16.2 17 17.3 17.5 18];
thr_5g = [14 18 22 24 26.5 27.5 28.5 29.2 30];
users = 1:11;
handover_events = [1 2 4 8 13 20 30 43 60 77 92];
%% ========== Plotting ==========
figure;
% --- 1. BER vs SNR ---
subplot(3,1,1);
semilogy(snr, ber_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
semilogy(snr, ber_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR');
legend('LTE', '5G NR', 'Location', 'northeast');
% --- 2. Throughput vs SNR ---
subplot(3,1,2);
plot(snr, thr_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
plot(snr, thr_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Throughput (Mbps)');
title('Throughput vs SNR');
legend('LTE', '5G NR', 'Location', 'southeast');
% --- 3. Handover Events vs Number of Users ---
subplot(3,1,3);
plot(users, handover_events, '-o', 'Color', [0.4 0 0.9], 'LineWidth', 2);
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 3
grid on;
xlabel('Number of Users');
ylabel('Number of Events');
title('Handover Events vs Number of Users');
Output:
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 4
3) Code:
%clc;
%clear;
%% Data (You can replace these with your real simulation outputs)
snr = 0:2.5:20;
ber_lte = [0.52 0.38 0.27 0.18 0.1 0.06 0.03 0.015 0.007];
ber_5g = [0.4 0.25 0.14 0.08 0.04 0.015 0.007 0.003 0.0015];
thr_lte = [8 10.5 12 13.5 15 16 16.5 17 17.2];
thr_5g = [17 22 25 27.5 28.5 29 29.5 30 30];
users = 1:11;
handover_events = [3 5 9 15 22 32 45 60 75 90 105];
figure;
% --- 1. BER vs SNR ---
subplot(3,1,1);
semilogy(snr, ber_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
semilogy(snr, ber_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR');
legend('LTE', '5G NR', 'Location', 'northeast');
% --- 2. Throughput vs SNR ---
subplot(3,1,2);
plot(snr, thr_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
plot(snr, thr_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Throughput (Mbps)');
title('Throughput vs SNR');
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 5
legend('LTE', '5G NR', 'Location', 'southeast');
% --- 3. Handover Events vs Number of Users ---
subplot(3,1,3);
plot(users, handover_events, '-o', 'Color', [0.4 0 0.9], 'LineWidth', 2);
grid on;
xlabel('Number of Users');
ylabel('Number of Events');
title('Handover Events vs Number of Users');
Output:
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 6
4) Code:
%clc;
%clear;
%% Data (You can replace these with your real simulation outputs)
snr = 0:2.5:20;
ber_lte = [0.4 0.28 0.18 0.11 0.06 0.03 0.015 0.008 0.003];
ber_5g = [0.28 0.15 0.09 0.045 0.02 0.008 0.0035 0.0015 0.0006];
thr_lte = [10 12.5 13.8 15 16 17 17.4 17.7 18];
thr_5g = [15.5 20.5 23.5 25.5 27.5 28.2 29 29.5 30];
users = 1:11;
handover_events = [2 5 8 13 20 30 42 55 69 83 97];
%% ========== Plotting ==========
figure;
% --- 1. BER vs SNR ---
subplot(3,1,1);
semilogy(snr, ber_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
semilogy(snr, ber_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR');
legend('LTE', '5G NR', 'Location', 'northeast');
% --- 2. Throughput vs SNR ---
subplot(3,1,2);
plot(snr, thr_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
plot(snr, thr_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 7
ylabel('Throughput (Mbps)');
title('Throughput vs SNR');
legend('LTE', '5G NR', 'Location', 'southeast');
% --- 3. Handover Events vs Number of Users ---
subplot(3,1,3);
plot(users, handover_events, '-o', 'Color', [0.4 0 0.9], 'LineWidth', 2);
grid on;
xlabel('Number of Users');
ylabel('Number of Events');
title('Handover Events vs Number of Users');
Output:
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 8
5) Code:
%clc;
%clear;
%% Data (You can replace these with your real simulation outputs)
snr = 0:2.5:20;
ber_lte = [0.43 0.29 0.19 0.1 0.05 0.025 0.012 0.006 0.003];
ber_5g = [0.31 0.17 0.095 0.05 0.023 0.009 0.004 0.0018 0.0009];
thr_lte = [9.5 11.5 13 14 15.8 16.8 17.2 17.6 17.9];
thr_5g = [16.5 21.5 24.5 26.5 28.5 29.2 29.8 30 30.2];
users = 1:11;
handover_events = [1 3 6 11 17 26 39 53 68 82 95];
%% ========== Plotting ==========
figure;
% --- 1. BER vs SNR ---
subplot(3,1,1);
semilogy(snr, ber_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
semilogy(snr, ber_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs SNR');
legend('LTE', '5G NR', 'Location', 'northeast');
% --- 2. Throughput vs SNR ---
subplot(3,1,2);
plot(snr, thr_lte, '-o', 'Color', [1, 0.5, 0], 'LineWidth', 2); hold on;
plot(snr, thr_5g, '-s', 'Color', [1, 0.2, 0], 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 9
ylabel('Throughput (Mbps)');
title('Throughput vs SNR');
legend('LTE', '5G NR', 'Location', 'southeast');
% --- 3. Handover Events vs Number of Users ---
subplot(3,1,3);
plot(users, handover_events, '-o', 'Color', [0.4 0 0.9], 'LineWidth', 2);
grid on;
xlabel('Number of Users');
ylabel('Number of Events');
title('Handover Events vs Number of Users');
Output:
RESHAV SHARMA – 2022BIT061 (BATCH – ‘D’) 10