0% found this document useful (0 votes)
20 views3 pages

Channelmodu 4 G 5 G

This document simulates the effects of three channel models - AWGN, Rayleigh fading, and Rician fading - on a 5G OFDM signal. It generates a random QPSK signal, passes it through each channel model, and visualizes the received signal amplitudes. It then calculates and compares the bit error rates for each channel model, finding lower error with AWGN, higher with Rayleigh fading, and intermediate with Rician fading.

Uploaded by

LOGESH .J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Channelmodu 4 G 5 G

This document simulates the effects of three channel models - AWGN, Rayleigh fading, and Rician fading - on a 5G OFDM signal. It generates a random QPSK signal, passes it through each channel model, and visualizes the received signal amplitudes. It then calculates and compares the bit error rates for each channel model, finding lower error with AWGN, higher with Rayleigh fading, and intermediate with Rician fading.

Uploaded by

LOGESH .J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Exp no: Channel modeling in 5G networks

Program:

clc;
clear all;
close all;
%%
% 5G Channel Modeling and Comparison
% This script:
% Generates a random QPSK-modulated 5G OFDM signal.
% Simulates the effects of AWGN, Rayleigh fading, and Rician fading
channels on the signal.
% Visualizes the amplitude of the received signals for the three channel
models.
% Compares the Bit Error Rate (BER) for the three models.
% Define 5G OFDM parameters
N = 2048; % Number of OFDM subcarriers
numSymbols = 10; % Number of OFDM symbols
OFDM_signal = (randi([0, 1], N, numSymbols) * 2 - 1) + 1i * (randi([0, 1], N,
numSymbols) * 2 - 1); % Random QPSK signal

% Parameters
SNR = 20; % Signal-to-Noise Ratio

% Initialize received signal matrices


rx_signal_awgn = zeros(size(OFDM_signal));
rx_signal_rayleigh = zeros(size(OFDM_signal));
rx_signal_rician = zeros(size(OFDM_signal));

% Rayleigh and Rician Channel objects


rayChan = comm.RayleighChannel('SampleRate',1e7, 'PathDelays',[0 2e-6],
'AveragePathGains',[0 -3]);
ricChan = comm.RicianChannel('SampleRate',1e7, 'PathDelays',[0 2e-6],
'AveragePathGains',[0 -3], 'KFactor', 4.0, 'DirectPathDopplerShift', 1e-6);

for i = 1:numSymbols
% AWGN Channel
rx_signal_awgn(:, i) = awgn(OFDM_signal(:, i), SNR, 'measured');

% Rayleigh Fading Channel


rx_signal_rayleigh(:, i) = rayChan(OFDM_signal(:, i));

% Rician Fading Channel


rx_signal_rician(:, i) = ricChan(OFDM_signal(:, i));
end

% Visualization
figure;

% AWGN
subplot(3, 1, 1);
plot(abs(rx_signal_awgn(:, 1)));
title('AWGN Channel');
xlabel('Subcarrier Index');
ylabel('Amplitude');

% Rayleigh
subplot(3, 1, 2);
plot(abs(rx_signal_rayleigh(:, 1)));
title('Rayleigh Fading Channel');
xlabel('Subcarrier Index');
ylabel('Amplitude');

% Rician
subplot(3, 1, 3);
plot(abs(rx_signal_rician(:, 1)));
title('Rician Fading Channel');
xlabel('Subcarrier Index');
ylabel('Amplitude');

% Comparative Analysis (BER as an example metric)


tx_bits = real(OFDM_signal(:)) > 0;
rx_bits_awgn = real(rx_signal_awgn(:)) > 0;
rx_bits_rayleigh = real(rx_signal_rayleigh(:)) > 0;
rx_bits_rician = real(rx_signal_rician(:)) > 0;

[~, ber_awgn] = biterr(tx_bits, rx_bits_awgn);


[~, ber_rayleigh] = biterr(tx_bits, rx_bits_rayleigh);
[~, ber_rician] = biterr(tx_bits, rx_bits_rician);

fprintf('BER with AWGN Channel = %e\n', ber_awgn);


fprintf('BER with Rayleigh Channel = %e\n', ber_rayleigh);
fprintf('BER with Rician Channel = %e\n', ber_rician);

output:

BER with AWGN Channel = 0.000000e+00

BER with Rayleigh Channel = 4.983887e-01

BER with Rician Channel = 1.253418e-01


Output waveform:

You might also like