You are on page 1of 8

Assignment - 1

ECN - 519 Wireless Communication Systems

Amitesh Magar
19122002
14 August 2022

Assignment - 1 1

Question - 1
Code:
clc;
clear all;
close all;

%SNR variable
SNR_dB = -10:2:40;
SNR = 10.^(SNR_dB .* 0.1);

SISO_Cap = log2(SNR + 1);

figure();
plot(SNR_dB, SISO_Cap, 'r');
hold on;
plot(SNR_dB(1), SISO_Cap(1), 'r*');
hold on;
plot(SNR_dB(11), SISO_Cap(11), 'r*');
hold on;
plot(SNR_dB(21), SISO_Cap(21), 'r*');
xlabel("SNR in dB");
ylabel("Capacity")
title("Capacity plot for AWGN in SISO channel”);

Plot:

From the Plot it is evident that the applied formula works correctly.

Assignment - 1 2

Question - 2
Code:
clc;
clear all;
close all;

%variables
mu = 0;
sigma = 1;

L = 5000;

G_Noise = sigma * randn(1, L) + mu;

figure();

subplot(2,1,1);
plot(G_Noise);
title(["White Noise with mu = ", mu, " and sigma =", sigma]);
xlabel("Sample");
ylabel("Noise");
grid on;
hold on;

subplot(2,1,2);
%histogram plot
bins=50;
[f, x] = hist(G_Noise, bins);
data = (1/(sqrt(2*pi)*sigma))*exp(-((x-mu).^2)/(2*sigma^2));
plot(x, data);
grid on;
title("Histogram plot of the noise");
xlabel("Bins");
ylabel("PDF of Noise”);

Plots:

Assignment - 1 3

Assignment - 1 4

Question - 3
Code:
clc;
clear all;
close all;

%SNR variable
SNR_dB = -10:2:40;
SNR = 10.^(SNR_dB .* 0.1);
Nr = 5;

%h is distributed as complex normal with mean 0 and sigma 1


h = 1/sqrt(2)*(rand(Nr, 1) +1i*rand(Nr,1));

SIMO_Cap = log2(sum(h.* conj(h))*SNR + 1);

figure();
plot(SNR_dB, SIMO_Cap, 'r');
xlabel("SNR in dB");
ylabel("Capacity")
title("Capacity plot for fixed SIMO channel”);

Plot:

Assignment - 1 5

Question - 4

Assignment - 1 6

Question - 5

Assignment - 1 7

Question - 6

Assignment - 1 8

You might also like