Report04
Report04
Experiment No: 3
Experiment Name: Channel Models for Wireless Communication
Systems
clc;
clear all;
close all;
f = 1.5e9;
Gt = 1;
Gr = 1;
d0 = 100;
c = 3e8;
lamda = c/f;
d = 1: 2000;
PL_free = -10*log10(Gt*Gr*(lamda^2)./(16*pi*pi*d.*d));
figure(1)
subplot(211)
plot(d,PL_free)
ylabel('Path Loss')
subplot(212)
d_dB = 10*log10(d);
plot(d_dB,PL_free)
xlabel('Distance in dB')
ylabel('Path Loss')
P_transmitted = 10*log10(4000);
figure(2)
subplot(211)
plot(d,P_received)
ylabel('Received Power')
subplot(212)
d_dB = 10*log10(d);
plot(d_dB,P_received)
xlabel('Distance in dB')
ylabel('Received Power')
n_values = [2 3 6];
for i = 1: length(n_values)
n = n_values(i);
figure(3)
subplot(211)
plot(d,PL_log_distance)
hold on
title('Distance vs Log Distance Path Loss')
legend('n=2','n=3','n=6')
subplot(212)
plot(d_dB,PL_log_distance)
hold on
xlabel('Distance in dB')
legend('n=2','n=3','n=6')
figure(4)
subplot(211)
plot(d,P_received)
hold on
ylabel('Received Power')
legend('n=2','n=3','n=6')
subplot(212)
d_dB = 10*log10(d);
plot(d_dB,P_received)
hold on
xlabel('Distance in dB')
ylabel('Received Power')
legend('n=2','n=3','n=6')
end
n = 2;
sigma = 3;
X_sigma_dB = 10*log10(X_sigma);
figure(5)
subplot(211)
plot(d,PL_Log_normal)
subplot(212)
plot(d_dB,PL_Log_normal)
xlabel('Distance in dB')
figure(6)
subplot(211)
plot(d,P_received)
ylabel('Received Power')
subplot(212)
d_dB = 10*log10(d);
plot(d_dB,P_received)
xlabel('Distance in dB')
ylabel('Received Power')
Task 2:
Code:
clc;
clear all;
close all;
N = 1e5;
level = 30;
figure(1)
% Plotting PDF
subplot(211)
plot(x, PDF)
title('Rayleigh Distribution');
xlabel('Value')
ylabel('PDF');
legend('1/sqrt(2)', '1');
hold on;
% Plotting CDF
subplot(212)
plot(x, cumsum(PDF))
xlabel('Value')
ylabel('CDF');
legend('1/sqrt(2)', '1');
hold on;
end
N = 1e5;
level = 30;
figure(2);
for i = 1:length(K_dB_values)
K = 10^(K_dB_values(i)/10);
sigma = 1/sqrt(2);
s = sqrt(K*2*sigma^2);
X = s + sigma*randn(1, N);
Y = 0 + sigma*randn(1, N);
H = X + 1i*Y;
% Plotting PDF
subplot(211)
plot(x, PDF);
xlabel('Value')
ylabel('PDF');
hold on;
title('Rician Distribution');
% Plotting CDF
subplot(212)
plot(x, cumsum(PDF))
xlabel('Value');
ylabel('CDF');
hold on;
end
N = 300;
sigma_rayleigh = 1;
sigma_rician_dB = 15;
% Rayleigh
rcv_signal_rayleigh = abs(H_rayleigh).*signal_rayleigh;
% Rician
K_rician = 10^(sigma_rician_dB/10);
sigma_rician = 1/sqrt(2);
s_rician = sqrt(K_rician*2*sigma_rician^2);
rcv_signal_rician = abs(H_rician).*signal_rician;
figure(3)
subplot(211)
plot(signal_rayleigh);
hold on;
plot(rcv_signal_rayleigh);
subplot(212)
plot(signal_rician);
hold on;
plot(rcv_signal_rician);
Code:
clc;
clear all;
close all;
%% Indoor Model
num_channels = 10000;
Ts = 50e-9;
sigma_tau = 25e-9;
N = 256;
x = 1:0.01:1000;
for i = 0:p_max
end
for k = 1:length(PDP)
end
channel_tap_index = 0:length(PDP) - 1;
figure(1)
subplot(211)
hold on,
title('IEEE Model: Channel Tap Index (p) vs Average Channel Power ');
axis([-1 7 0 1]);
subplot(212)
plot([-N/2 + 1:N/2] / N / Ts / 1e6, 10 * log10(H .* conj(H)));
xlabel('Frequency [MHz]')
Task 4:
Code:
clc;
clear all;
close all;
% Parameters
fc = 0;
fm = 100;
Nos = 1;
Nfft = 2^10;
delf = 2 * fm / Nfft;
f = zeros(1, Nfft);
Sd = zeros(1, Nfft);
for n = 1:Nfft/2
f(n) = n * delf;
end
f(n) = n * delf;
end
% Folding removal
g = -Nfft/2 + 1:1:Nfft;
figure;
subplot(211);
plot(g(1:1024), Sd_z);
title('Doppler Spectrum');
xlabel('Frequency (Hz)');
subplot(212);
plot(f, Sd);
title('Doppler Spectrum');
xlabel('Frequency (Hz)');
end
FNI = NI .* sqrt(Sd);
FNQ = NQ .* sqrt(Sd);
% Over sampling
% Normalization
FNI_env = abs(FNIt);
FNQ_env = abs(FNQt);
FNIt_sq = (abs(FNIt)).^2;
FNQt_sq = (abs(FNQt)).^2;
h = sqrt(FNIt_sq + FNQt_sq);
% Plot of channel h
figure;
subplot(211);
xlabel('Time');
ylabel('Magnitude (dB)');
subplot(212);
hist(h, 50);
title('Histogram of Magnitude');
xlabel('Magnitude');
ylabel('Count');
Task 5:
Code:
clear all;
close all;
% Parameters
transmit_power = 5;
frequency = 2e9;
channel_bandwidth = 180e3;
area_length = 4e3;
area_width = 6e3;
psd_awgn = -174;
distance_range = 200:200:5000;
received_power_large_scale = zeros(size(distance_range));
received_power_small_scale = zeros(size(distance_range));
for i = 1:length(distance_range)
distance = distance_range(i);
path_loss_small_scale = 10 * log10(abs(small_scale_fading)^2);
received_power_small_scale(i) = received_power_total;
end
figure;
hold on;
legend('Location', 'Best');
grid on;
frequency = 2e9;
channel_bandwidth = 180e3;
distance = 500;
noise_bandwidth = 180e3;
transmit_power_range = 5:5:40;
ber_large_scale = zeros(size(transmit_power_range));
ber_small_scale = zeros(size(transmit_power_range));
for i = 1:length(transmit_power_range)
transmit_power = transmit_power_range(i);
end
figure;
hold on;
legend('Location', 'Best');
grid on;
ber_large_scale_indoor = zeros(size(transmit_power_range));
ber_large_scale_outdoor = zeros(size(transmit_power_range));
ber_small_scale = zeros(size(transmit_power_range));
for i = 1:length(transmit_power_range)
transmit_power = transmit_power_range(i);
end
figure;
hold on;
legend('Location', 'Best');
grid on;
Ques no 1:
The path loss exponent n in a wireless communication system is a parameter that characterizes the rate
at which the signal strength decreases with distance. The path loss model is often represented as:
where:
The effect of the path loss exponent n before and after the reference distance (\(d_0\)) is as follows:
- For (d < d_0 ), the path loss increases logarithmically with distance but at a slower rate compared to
after the reference distance.
- A lower path loss exponent (n) indicates a slower decay in signal strength, meaning the signal retains
more power over distance.
- For (d > d_0 ), the path loss increases logarithmically with distance at a faster rate.
- A higher path loss exponent n indicates a faster decay in signal strength, meaning the signal weakens
more quickly as the distance increases.
In summary, the path loss exponent n influences the rate at which the signal strength diminishes with
distance. A lower n results in slower decay (favorable for longer-range communication in certain
scenarios), while a higher n results in faster decay, which may be suitable for modeling environments
with significant obstacles and absorption.
Selecting an appropriate path loss exponent is crucial in designing wireless communication systems and
networks to accurately model signal propagation characteristics in a given environment. The choice of n
depends on factors such as the type of environment, frequency, and the presence of obstacles.
Ques no 2:
When k is much less than 0, the primary signal component is relatively feeble in comparison to the
scattered components. In this scenario, the Rician distribution tends toward the Rayleigh distribution as
k diminishes. For instance, when (K = -40 {dB}), a notably negative value, the distribution closely
resembles a Rayleigh distribution.
Conversely, when k is much greater than 0, it implies a robust dominant component in relation to the
scattered components. With increasing k the Rician distribution approaches a Gaussian (normal)
distribution. For example, when (K = -40 {dB}), a considerably positive value, the distribution exhibits
characteristics more akin to a Gaussian distribution.
Ques no 3:
Ques no 4:
Ques no 5: