0% found this document useful (0 votes)
175 views24 pages

EC3501-WIRELESS COMMUNICATION-1560801494-WC LAB Manual-1

Uploaded by

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

EC3501-WIRELESS COMMUNICATION-1560801494-WC LAB Manual-1

Uploaded by

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

CSI COLLEGE OF ENGINEERING, KETTI

(Approved by AICTE, New Delhi. Affiliated to Anna University, Chennai)

EC3501 WIRELESS COMMUNICATION LAB MANUAL

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

AS PER ANNA UNIVERSITY


(CHENNAI) SYLLABUS

2021 REGULATION

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

EC3501 WIRELESS COMMUNICATION LAB

SYLLABUS

PRACTICAL EXERCISES: 30 PERIODS

1. Modeling of wireless communication systems using Matlab (Two ray channel and Okumura
– Hata model)
2. Modeling and simulation of Multipath fading channel

3. Design, analyze and test Wireless standards and evaluate the performance measurements such
as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using Matlab
4. Modulation: Spread Spectrum – DSSS Modulation & Demodulation

1
5. Wireless Channel equalization: Zero-Forcing Equalizer (ZFE), MMSE Equalizer
(MMSEE), Adaptive Equalizer (ADE), Decision Feedback Equalizer (DFE)
6. Modeling and simulation of TDMA, FDMA and CDMA for wireless communication

COURSE OUTCOMES

● To study and understand the concepts and design of a Cellular System.

● To study and Understand Mobile Radio Propagation and Various Digital Modulation Techniques.

● To Understand the Concepts Of Multiple Access Techniques And Wireless Networks

2
EXPERIMENT 1:

AIM: To design a model of wireless communication systems using Matlab (Two ray channel and
Okumura –Hata model)
Theory:

The Okumura model for Urban Areas is a Radio propagation model that was built using the data collected
in the city of Tokyo, Japan. The model is ideal for using in cities with many urban structures but not many
tall blocking structures. The model served as a base for the Hata Model. Okumura model was built into
three modes. The ones for urban, suburban and open areas. The model for urban areas was built first and
used as the base for others. In wireless communication, the Hata Model for Urban Areas, also known as the
Okumura-Hata model for being a developed version of the Okumura Model, is the most widely used radio
frequency propagation model for predicting the behaviour of cellular transmissions in built up areas. This
model incorporates the graphical information from Okumura model and develops it further to realize the
effects of diffraction, reflection and scattering caused by city structures. This model also has two more
varieties for transmission in Suburban Areas and Open Areas.

Hata Model predicts the total path loss along a link of terrestrial microwave or other type of cellular
communications. This particular version of the Hata model is applicable to the radio propagation within
urban areas. This model is suited for both point-to-point and broadcast transmissions and it is based on
extensive empirical measurements taken.

CODING:

>> % Wireless Communication System Modeling

% Two-ray channel model and Okumura-Hata model

% System Parameters

frequency = 900e6; % Frequency in Hz


transmitterHeight = 50; % Transmitter height in meters
receiverHeight = 10; % Receiver height in meters
distance = 100:100:1000; % Distance between transmitter and receiver in meters

% Two-ray Channel Model

Pt = 1; % Transmitted power in Watts

Gt = 1; % Transmitter antenna gain

Gr = 1; % Receiver antenna gain

L = 1; % System loss

% Calculate received power using Two-ray channel model

Pr_two_ray = Pt * (Gt * Gr * (transmitterHeight * receiverHeight)^2) ./ (distance.^4 * L);

% Okumura-Hata Model

A = 69.55; % Model parameter

B = 26.16; % Model parameter

C = 13.82; % Model parameter

3
D = 44.9; % Model parameter

X = 6.55; % Model parameter

hb = 30; % Base station height in meters

% Calculate path loss using Okumura-Hata model

PL_okumura_hata = A + B * log10(distance) + C * log10(frequency/1e6) + D - X * log10(hb);


% Plotting
figure;
plot(distance, Pr_two_ray, 'b-', 'LineWidth', 2);
hold on;
plot(distance, PL_okumura_hata, 'r--', 'LineWidth', 2);
xlabel('Distance (m)');
ylabel('Received Power/Path Loss (dB)');

legend('Two-ray Channel Model', 'Okumura-Hata Model'); title('Wireless Communication System Mod


grid on;
Output:

RESULT : Thus designing a model of wireless communication systems using Matlab


(Two ray channel and Okumura –Hata model) is achieved

VIVA QUESTIONS :

1. What is Okumura-Hata model in wireless communication?


2. What is the difference between Hata model and Okumura model?
3. Is the Hata model used for signal strength prediction?
4. What is wireless channel model?
5. What are the main wireless channels?
6. Which wireless channel is better?
4
EXPERIMENT 2:

AIM: To design a Model and simulation of Multipath fading channel

THEORY: Multipath fading channel System objects and their built-in visualization to model a fading
channel and display the spectral characteristics of the channel. Rayleigh and Rician fading channels are
useful models of real-world phenomena in wireless communication. These phenomena include multipath
scattering effects, time dispersion, and Doppler shifts that arise from relative motion between the
transmitter and receiver.
Processing a signal using a fading channel involves the following steps:
1. Create a channel System object™ that describes the channel that you want to use. A channel object is a
type of MATLAB® variable that contains information about the channel, such as the maximum
Doppler shift.
2. Adjust properties of the System object, as needed to model your channel. For example, you can change
the path delays or average path gains.
3. Call the channel System object like a function to apply the channel model, which generates random
discrete path gains and filters the input signal.

CODING:

% Simulation parameters

numSamples = 1000; % Number of samples


numPaths = 3; % Number of multipath paths
fadePower = 0.5; % Fading power
% Generate Rayleigh fading channel coefficients

h = sqrt(fadePower/2)*(randn(numPaths, numSamples) + 1i*randn(numPaths, numSamples));

% Generate transmitted signal

txSignal = randn(1, numSamples) + 1i*randn(1, numSamples);

% Simulate multipath fading channel


rxSignal = zeros(1, numSamples); for
path = 1:numPaths
rxSignal = rxSignal + h(path, :) .* txSignal;
end
% Plot the transmitted and received signals t =
1:numSamples;
figure;
subplot(2,1,1);
plot(t, real(txSignal), 'b', t, imag(txSignal), 'r');
title('Transmitted Signal');
legend('In-phase', 'Quadrature');
xlabel('Time');
ylabel('Amplitude');
subplot(2,1,2);
plot(t, real(rxSignal), 'b', t, imag(rxSignal), 'r');

5
title('Received Signal');
legend('In-phase', 'Quadrature');
xlabel('Time');
ylabel('Amplitude');
OUTPUT :

RESULT:

Thus the designing of a Model and simulation of Multipath fading channel has been achieved

6
EXPERIMENT 3:

AIM : Design, analyze and test Wireless standards and evaluate the performance measurements
such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using
Matlab.
THEORY: The performance of any wireless communication system mainly depends on the wireless
channel environment. Because of huge demand and growth in mobile communication and Internet services
the optimization of the wireless communication is critical. If we know the perfect channel characteristics
we can easily develop a high bandwidth-efficient wireless communication system. The wireless channel
mainly suffers from 3 different modes. They are Reflection, Diffraction, and Scattering. Combination of
these three phenomena’s is called fading. Fading is fluctuations in the power levels of the signal. In this
paper we find the Bit Error Rate (BER) of wireless communication system in Flat Fading environment. At
the same time we evaluate the system performance of M-PSK modulation schemes using MATLAB.

Spectral precoding is a promising technique to suppress out-of-band emissions and comply with leakage
constraints over adjacent frequency channels and with mask requirements on the unwanted emissions.
However, spectral precoding may distort the original data vector, which is formally expressed as the error
vector magnitude (EVM) between the precoded and original data vectors. Notably, EVM has a deleterious
impact on the performance of multiple-input multiple-output orthogonal frequency division multiplexing-
based systems. In this paper we propose a novel spectral precoding approach which constrains the EVM
while complying with the mask requirements. We first formulate and solve the EVM-unconstrained mask-
compliant spectral precoding problem, which serves as a springboard to the design of two EVM-
constrained spectral precoding schemes. The first scheme takes into account a wideband EVM-constraint
which limits the average in-band distortion. The second scheme takes into account frequency-selective
EVM-constraints, and consequently, limits the signal distortion at the subcarrier level. Numerical examples
illustrate that both proposed schemes outperform previously developed schemes in terms of important
performance indicators such as block error rate and systemwide throughput while complying with spectral
mask and EVM constraints.
Adjacent Channel Leakage Ratio (ACLR) or Adjacent Channel Power Ratio (ACPR) is defined the ratio of
the transmitted power on the assigned channel to the power received in the adjacent radio channel after a
receive filter.Each wireless standard has the adjacent channels located at different frequency offsets. For
example, according to the 3GPP standard, the ACLR should be no more than -33 dB at the offsets of ±1.6
MHz and no more than -43 dB at the offsets of ±3.2 MHz. CDMA amplifiers involve two offsets (from the
carrier frequency) of 885 kHz and 1.98 MHz, and a measurement BW of 30 KHz.ACLR is also know
as Adjacent Channel Power Ratio (ACPR).

Throughput is a measure of how many units of information a system can process in a given amount of
time. It is applied broadly to systems ranging from various aspects of computer and network systems to
organizations.

Capacity is for a specific point or part of the road network. Throughput is for a system or the entire link if
that itself is your system. Although they are understood as the same, there is a minute difference between
them. When your analysis is to investigate the efficiency of your system, you use the word throughput.

BLER: A critical parameter in cellular receiver performance5G user equipment receiver performance is
critical for high-quality connectivity and maximum data throughput. Block-error rate provides an effective
metric in demodulation and determining receiver sensitivity.

Mobile device users expect to seamlessly stream videos, quickly access web pages, download data, and
never experience a dropped voice call. Downlink throughout has a direct impact on all of these
expectations. A wireless device’s transmitter and receiver performance significantly impacts these abilities.
Receiver performance dictates the maximum data throughput of a user equipment (UE).

Receiver sensitivity is a key measurement that engineers can perform to characterize a receiver’s
performance. Sensitivity provides the ability to effectively demodulate data in the poorest of radio
7
conditions. Per 3GPP specifications, the reference sensitivity of a user equipment (UE) is defined as the
minimum receive power level required to achieve a throughput rate ≥95% of the maximum possible
throughput of a given reference measurement channel.

CODING:

% Define simulation parameters

numBits = 1e6; % Number of bits to transmit

EbNo_dB = 10; % Eb/No in dB

modulationOrder = 4; % QPSK modulation

% Generate random binary data (0s and 1s)

txData = rand(1, numBits) > 0.5; % Generates logical values directly

% Modulation (QPSK)

txData = 2 * txData - 1; % Map logical values to {-1, 1}

modulatedSymbols = txData(1:modulationOrder:end) + 1i * txData(2:modulationOrder:end);

% Add AWGN noise

EbNo = 10^(EbNo_dB/10);

noiseVar = 1 / (2 * EbNo);

noise = sqrt(noiseVar) * (randn(size(modulatedSymbols)) + 1i *

randn(size(modulatedSymbols)));

rxSymbols = modulatedSymbols + noise;

% Demodulation

demodulatedBits = zeros(size(txData));

demodulatedBits(1:modulationOrder:end) = real(rxSymbols) > 0;

demodulatedBits(2:modulationOrder:end) = imag(rxSymbols) > 0;

% Calculate Bit Error Rate (BER)

numErrors = sum(txData ~= demodulatedBits);

8
ber = numErrors / numBits;

% Display BER

fprintf('Bit Error Rate (BER): %.4f\n', ber);

Output:

Bit Error Rate (BER): 0.7494

RESULT: Thus designing, analyzing and testing Wireless standards and evaluating the performance
measurements such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using
Matlab has been achieved

9
EXPERIMENT 4:

AIM: To design modulation: Spread Spectrum – DSSS Modulation & Demodulation

Theory: in telecommunication, especially radio communication, spread spectrum designates techniques


by which a signal (e.g., an electrical, electromagnetic, or acoustic) generated with a particular bandwidth is
deliberately spread in the frequency domain, resulting in a signal with a wider bandwidth.
The increasing demand for wireless communications has problems due to limited spectrum efficiency
and multipath propagation. The use of spread spectrum communication has simplified these problems. In
the spread spectrum, signals from different sources are combined to fit into larger bandwidth.

Most stations use air as the medium for communication, stations must be able to share the medium
without an interception and without being subject to jamming from a malicious intruder. To achieve this,
spread-spectrum techniques add redundancy means it uses extended bandwidth to accommodate signals
in a protective envelope so that more secure transmission is possible. The spread code is a series of
numbers that looks random but are actually a pattern. The original bandwidth of the signal
gets enlarged (spread) through the spread code Direct Sequence Spread Spectrum (DSSS):

In DSSS, the bandwidth of the original signal is also expanded by a different technique. Here, each data
bit is replaced with n bits using a spreading code called chips, and the bit rate of the chip is called
as chip-rate. The chip rate is n times the bit rate of the original signal

CODING:

% DSSS Modulation and Demodulation Example

% Parameters

data = [1 0 1 0 1 1 0 0]; % Original data signal

spreadingCode = [1 1 0 1]; % Spreading code


spreadingFactor = length(spreadingCode);
% DSSS Modulation
modulatedSignal = [];
for i = 1:length(data)
chips = repmat(data(i), 1, spreadingFactor) .* spreadingCode;
modulatedSignal = [modulatedSignal chips];
end

% DSSS Demodulation

demodulatedSignal = [];

for i = 1:length(modulatedSignal)/spreadingFactor

chips = modulatedSignal((i-1)*spreadingFactor+1:i*spreadingFactor);
chipSum = sum(chips);
if chipSum>= spreadingFactor/2
demodulatedSignal = [demodulatedSignal 1];
else

demodulatedSignal = [demodulatedSignal 0];


end
end

10
% Display Results
disp('Original Data:');
disp(data);
disp('Demodulated Data:');
disp(demodulatedSignal);

OUTPUT:
Original Data:

1 0 1 0 1 1 0 0

Demodulated Data:

1 0 1 0 1 1 0 0

RESULT: Thus designing modulation: Spread Spectrum – DSSS Modulation &


Demodulation has been achieved

11
EXPERIMENT 5:

AIM: . To design a wireless Channel equalization: Zero-Forcing Equalizer (ZFE), MMS Equalizer
(MMSEE), Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)

THEORY:Zero Forcing Equalizer refers to a form of linear equalization algorithm used in communication
systems which applies the inverse of the frequency response of the channel.The Zero Forcing (ZF) channel
model is a linear equalization technique used in wireless communication systems to mitigate the effects of
intersymbol interference (ISI) and co-channel interference. These issues arise when multiple signals
transmitted simultaneously over the same channel overlap and interfere with each other. The ZF channel
model aims to eliminate or minimize such interference by inverting the channel matrix.
In the context of multiple-input multiple-output (MIMO) systems, where multiple antennas are used for
both transmission and reception, the ZF equalizer uses the inverse of the channel matrix to pre-process the
received signals. This processing effectively "forces" the interference components to zero, hence the name
"Zero Forcing."The Zero Forcing channel model is still widely used due to its simplicity and effectiveness
in reducing interference in certain scenarios. It is often employed as a benchmark to evaluate and compare
the performance of other equalization techniques.The Zero Forcing (ZF) equalizer attempts to minimize
the interference by inverting the channel matrix. Inverting the channel matrix H allows us to "undo" the
effect of the channel on the transmitted signal X, so that the received signal Y can be used to reconstruct
the original transmitted signal with minimal interference.
MMSE (Minimum Mean Square Error)
MMSE is a model that minimize the MSE (Mean Square Error) of the received data. With this single
statement, a lot of questions would start popping up in your mind.What is Mean Square Error ? What is the
physical meaning of 'minimized MSE' ? etc.The Minimum Mean Squared Error (MMSE) equalizer is a
linear equalization technique used in digital communication systems to mitigate the effects of inter-symbol
interference (ISI) and noise. The MMSE equalizer is designed to minimize the mean squared error between
the transmitted signal and the equalized received signal.
Adaptive equalization is a technique that can be used with either linear or non-linear equalizers to
improve their performance in a changing channel environment. An adaptive equalizer is an equalizer that
automatically adapts to the time-varying properties of the communication channel.Adaptive Equalization
assumes the channel is time-varying and tries to design an equalizer filter whose filter coefficients are
varying in time according to the change of channel and tries to eliminate intersymbol interference and
additive noise at each time. The implicit assumption of adaptive equalization is that the channel is
varying slowly.Adaptive equalization works by adjusting the equalization filter in real-time to
compensate for the distortion introduced by the channel. The equalization filter can be adapted based on
the received signal characteristics and feedback from the receiver.
Adaptive equalization uses algorithms to estimate the channel response and then adaptively adjusts the
filter coefficients to minimize the error between the received signal and the transmitted signal.
DFE amplifies the high frequency components of a signal without amplifying the noise content. It
compensates for inter-symbol interference (ISI). DFE minimizes post-cursor ISI by adding or subtracting
weighted versions of the previously received bits from the current bit. DFE works in synchronization with
the TX pre-emphasis and downstream RX CTLE. This enables the RX CDR to receive the correct data that
was transmitted through a lossy and noisy backplane.The DFE advantage over CTLE is improved Signal to
Noise Ratio (SNR). DFE amplifies the power of the high frequency components without amplifying the
noise power.
CODING:
% Zero-Forcing Equalizer (ZFE) MATLAB code for MATLAB R2008a
% Define the channel impulse response
h = [0.1 0.3 0.4 0.2];
% Generate random transmitted symbols
N = 100; % Number of symbols
symbols = round(rand(1, N)); % Generate random numbers between 0 and 1 and round them to the
nearest integer to simulate binary data
12
% Convolve transmitted symbols with the channel impulse response
received_signal = conv(symbols, h);
% Add AWGN (Additive White Gaussian Noise) manually to the received signal
snr_dB = 20; % Signal-to-Noise Ratio (SNR) in dB
noiseVar = 10^(-snr_dB/10);
received_signal = received_signal + sqrt(noiseVar) * randn(size(received_signal));
% Zero-Forcing Equalizer
% Define the length of the equalizer tap
L = length(h);
% Initialize the equalizer taps
equalizer_taps = zeros(1, L);
% Loop through each received symbol and perform equalization
equalized_symbols = zeros(1, N);
for n = 1:N
% Extract the received symbols for equalization
received_symbols = received_signal(n:n+L-1);
% Perform zero-forcing equalization

equalized_symbols(n) = equalizer_taps * received_symbols';


% Update the equalizer taps using the least squares algorithm
error = symbols(n) - equalized_symbols(n);
equalizer_taps = equalizer_taps + error * received_symbols / (received_symbols *
received_symbols');
end

% Print the original symbols and equalized symbols


disp('Original Symbols:');
disp(symbols);
disp('Equalized Symbols:');
disp(equalized_symbols);
output:
Columns 1 through 27

0001110111101111000111011
01

Columns 28 through 54

1100100001111101111110110
10
Columns 55 through 81

0100010111111110011101011
11

Columns 82 through 100

0011001100111100111

Equalized Symbols:
Columns 1 through 16

0 0 0 0 1.0994 1.0299 1.0634 0.0328 1.0238 0.9863 0.8640 0.9934

13
0.0894 1.0948 0.9319 0.6206

Columns 17 through 32

0.5331 0.0770 0.4293 0.2076 0.9995 0.7294 0.7701 0.1983 0.9865 1.1090 0.2222
1.0283 0.4440 0.5299 0.1397 0.3265

Columns 33 through 48

0.6244 -0.0252 0.2314 0.2423 0.3123 1.0254 0.6638 0.6565 0.7026 0.9435 0.3573
1.5712 0.6691 0.7799 0.9445 0.7590

Columns 49 through 64

0.5965 0.2265 1.3165 0.7097 -0.1813 0.6717 -0.0088 0.5206 0.4353 -0.0276 0.6195
0.1048 0.7901 0.1822 1.3884 0.7077

Columns 65 through 80

0.9055 0.9237 0.8974 0.7167 0.7126 0.0442 0.6938 0.7761 1.0590 0.6741 0.3580
0.0020 1.6494 -0.2534 1.5597 1.0186

Columns 81 through 96
0.0754 0.2607 -0.0223 1.0181 1.1975 -0.2838 0.0077 0.8690 1.3560 0.2637 -0.4387
1.1395 1.5104 0.5655 0.6077 0.0264

Columns 97 through 100


0.2330 0.8206 1.5576 0.2870

2. MMSE CODE
% Parameters
M = 4; % Number of transmitted symbols
N = 1000; % Number of received symbols
SNRdB = 10; % Signal-to-Noise Ratio in dB
pilotSymbols = [1 -1 1 -1]; % Known pilot symbols
% Generate random symbols in the range [0, M-1]
transmittedSymbols = round(rand(1, N) * (M-1));
% Modulation
modulatedSymbols = qammod(transmittedSymbols, M);
% Channel
channel = [0.8 -0.4 0.2 -0.1]; % Example channel coefficients
channelOutput = filter(channel, 1, modulatedSymbols);
% Add noise
SNR = 10^(SNRdB/10);
noiseVar = 1 / (2 * SNR);
noise = sqrt(noiseVar) * (randn(1, length(channelOutput)) + 1i * randn(1,
length(channelOutput)));
receivedSignal = channelOutput + noise;
% Channel estimation using pilot symbols
pilotIndices = zeros(1, length(pilotSymbols));
usedIndices = zeros(1, length(pilotSymbols));
for i = 1:length(pilotSymbols)
index = ceil(rand * N);

14
while any(index == usedIndices)
index = ceil(rand * N);
end
pilotIndices(i) = index;
usedIndices(i) = index;
end
pilotSignal = receivedSignal(pilotIndices);
estimatedChannel = conv(pilotSignal, fliplr(conj(pilotSymbols)));
estimatedChannel = estimatedChannel(end-length(channel)+1:end);
% MMSE equalization
equalizerCoefficients = conj(estimatedChannel) ./ (abs(estimatedChannel).^2 +
noiseVar);
equalizedSymbols = filter(equalizerCoefficients, 1, receivedSignal);

% Demodulation
demodulatedSymbols = qamdemod(equalizedSymbols, M);
% Calculate bit error rate
bitErrors = sum(transmittedSymbols ~= demodulatedSymbols);
bitErrorRate = bitErrors / N;
disp(['Bit Error Rate: ' num2str(bitErrorRate)]);

OUTPUT
Bit Error Rate: 0.661

3.ADE
Coding:
% Parameters
channel_length = 10; % Length of the channel impulse response
snr_db = 20; % Signal-to-noise ratio in dB
num_symbols = 1000; % Number of symbols to transmit
mu = 0.01; % LMS step size
% Generate random symbols
data_symbols = round(rand(1, num_symbols)); % Generate random 0s and 1s
% Modulate symbols (BPSK modulation)
modulated_symbols = 2 * data_symbols - 1;
% Create the channel impulse response
channel_real = randn(1, channel_length) / sqrt(2);
channel_imag = randn(1, channel_length) / sqrt(2);
% Convolve the modulated symbols with the channel
received_symbols_real = filter(channel_real, 1, modulated_symbols);
received_symbols_imag = filter(channel_imag, 1, modulated_symbols);
% Add noise to the received signal
noise_power = 10^(-snr_db / 10);
noise_real = sqrt(noise_power) * randn(1, length(received_symbols_real));
noise_imag = sqrt(noise_power) * randn(1, length(received_symbols_imag));
received_symbols_real = received_symbols_real + noise_real;
received_symbols_imag = received_symbols_imag + noise_imag;
% Adaptive equalizer using the LMS algorithm
equalizer_length = channel_length; % Set the equalizer length to match the
channel length
equalizer = zeros(1, equalizer_length);
output_signal = zeros(1, length(received_symbols_real));

15
for i = equalizer_length:length(received_symbols_real)
% Extract the received symbols for the current equalizer window
received_window_real = received_symbols_real(i:-1:i-equalizer_length+1);
received_window_imag = received_symbols_imag(i:-1:i-equalizer_length+1);
% Compute the equalizer output
output_signal(i) = sum(equalizer .* received_window_real) + sum(equalizer
.* received_window_imag);
% Compute the error
error = modulated_symbols(i) - output_signal(i);
% Update the equalizer coefficients
equalizer = equalizer + mu * error * received_window_real;
end
% Demodulate the equalized symbols (decision-directed)
demodulated_symbols = real(output_signal) > 0;
% Calculate the bit error rate (BER)
bit_errors = sum(data_symbols ~= demodulated_symbols);
ber = bit_errors / num_symbols;
disp(['Bit Error Rate (BER): ', num2str(ber)]);

OUTPUT:
Bit Error Rate (BER): 0.484

RESULT: Thus designing a wireless Channel equalization: Zero-Forcing Equalizer (ZFE), MMS
Equalizer(MMSEE), Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE) has
been achieved

16
EXPERIMENT 6:

AIM: To model and simulate TDMA, FDMA and CDMA for wireless communication

THEORY:These are all techniques for data transfer and communication. They are quite effective, but they
are employed in several ways due to their unique features. In this article, you will learn about the
difference between FDMA, TDMA, and CDMA

FDMA is an abbreviation for "Frequency Division Multiple Access". It is a form of channelization


protocol. In this system, the bandwidth is separated into different frequency bands. Each station is assigned
a band to transmit data, and that band is always reserved for that station.

A tiny band of unused frequency separates different stations' frequency bands, and these unused frequency
bands are known as guard bands, which prevent station interference. It is similar to the data link layer
access approach, in which the data link layer at each station instructs the physical layer to generate a
bandpass signal from the data provided to it. The signal is generated in the assigned band, and no physical
multiplexer is present at the physical layer.

TDMA is an abbreviation for "Time Division Multiple Access". It is a channelization system that divides
channel bandwidth into many stations simultaneously. Each station is assigned a time slot and may only
transmit data during the same time slot. Each station should be aware of the beginning and location of its
time slot. Synchronization between stations is needed for TDMA. It is a form of data link layer access
mechanism. The data link layer instructs each station to utilize the assigned time slot.

It is utilized in digital 2G cellular network systems like Personal Digital Cellular (PDC), GSM, IS-136,
and iDEN, and in the Digital Enhanced Cordless Telecommunications (DECT) standard for mobile
phones. Western Union's Westar 3 communications satellite was the first to utilize it in satellite
communication networks in 1979. It is commonly used for upstream traffic from premises to the operator
in combat-net radio systems, satellite communications networks, and a passive optical network (PON).

TDMA is a form of time-division multiplexing (TDM) in which numerous transmitters are connected to a
single receiver rather than a single transmitter. The uplink from a cellular phone to a base station is
particularly troublesome because it may move and modify the timing advance needed to match the
transmission gap from its peers.

CDMA is an abbreviation for "Code Division Multiple Access". It is a combination of FDMA and TDMA
in which resources are allocated based on frequency and time. FDMA divides the frequency band across
several users for the duration of the session, whereas TDMA permits each user to utilize the full frequency
band for a defined session. On the other hand, the CDMA system takes advantage of both systems by
allowing several users to simultaneously utilize the same frequency band defined by a unique code.

These codes are selected in such a way that if the code is utilized for a second time, the user who knows
the code may identify that specific user among the other users. This method may only be applied to a
specific number of users because each user is a source of noise for the receiver. As a result, it is highly
susceptible to noise. Because as the number of user numbers increases, the noise also increases. As a
result, the system may collapse.

17
CODING: 1.TDMA

% Step 1: Define System Parameters


numUsers = 4;
timeSlotDuration = 1; % seconds
totalTimeSlots = 10;
channelGain = 0.8;

% Step 2: Generate User Traffic


userData = round(rand(numUsers, totalTimeSlots));

% Step 3: Create Time Slots


timeSlots = (0:totalTimeSlots - 1) * timeSlotDuration;

% Step 4: Allocate Time Slots to Users


userSlots = mod(0:totalTimeSlots-1, numUsers) + 1;

% Step 5: Simulate Transmission


receivedData = zeros(numUsers, totalTimeSlots);
for slot = 1:totalTimeSlots
for user = 1:numUsers
if userSlots(slot) == user
% Simulate transmission for the current user in the time slot
transmittedData = userData(user, slot);
% Simulate channel effects
receivedData(user, slot) = transmittedData * channelGain;
end
end
end

% Step 6: Evaluate Performance Metrics (e.g., BER)


bitErrorRate = sum(sum(xor(receivedData, userData))) / (numUsers * totalTimeSlots);

% Step 7: Visualize Results


figure;
subplot(2, 1, 1);

stem(timeSlots, userData');
title('User Traffic');
xlabel('Time (s)');
ylabel('Data');
legend('User 1', 'User 2', 'User 3', 'User 4');
subplot(2, 1, 2);
stem(timeSlots, receivedData');
title('Received Data');
xlabel('Time (s)');
ylabel('Data');
legend('User 1', 'User 2', 'User 3', 'User 4');

% Display Bit Error Rate


disp(['Bit Error Rate: ', um2str(bitErrorRate)]);

18
OUTPUT:

2.FDMA:

% System parameters

totalBandwidth = 10e6; % Total available bandwidth (Hz) numUsers = 5; %


Number of users
carrierFrequency = 1e6; % Carrier frequency (Hz)

userBandwidth = totalBandwidth / numUsers; % Bandwidth allocated to each user (Hz)

% Time parameters

samplingFrequency = 100e6; % Sampling frequency (Hz)


timeDuration = 1e-3; % Simulation duration (s)
time = 0:1/samplingFrequency:timeDuration;

% Generate user signals

userSignals = zeros(numUsers, length(time)); for i =


1:numUsers
userFrequency = carrierFrequency + (i-1) * userBandwidth; % Frequency of user signal
userSignals(i, :) = sin(2*pi*userFrequency*time);
end

19
% Create the FDMA signal fdmaSignal
= sum(userSignals, 1);
% Add noise to the FDMA signal

snr = 10; % Signal-to-Noise Ratio (in dB)


noisySignal = awgn(fdmaSignal, snr, 'measured');
% Perform signal demodulation

demodulatedSignals = zeros(numUsers, length(time)); for


i = 1:numUsers
userFrequency = carrierFrequency + (i-1) * userBandwidth; % Frequency of user signal
demodulatedSignals(i, :) = noisySignal .* sin(2*pi*userFrequency*time);
end

% Plot the original user signals and the demodulated signals


figure;
subplot(numUsers+1, 1, 1);
plot(time, fdmaSignal);
title('FDMA Signal');
xlabel('Time (s)');
ylabel('Amplitude');
for i = 1:numUsers subplot(numUsers+1,
1, i+1); plot(time,
demodulatedSignals(i, :));
title(['Demodulated Signal - User ', num2str(i)]);
xlabel('Time (s)');
ylabel('Amplitude');
end

20
Output:

21
3.CDMA:
CODING:
% CDMA Simulation Parameters
numBits = 1000; % Number of bits per user
chipRate = 1e6; % Chip rate (chips per second)
snr = 10; % Signal-to-Noise Ratio (dB)

% Generate random data bits for User 1 and User 2


user1Bits = round(rand(1, numBits));
user2Bits = round(rand(1, numBits));

% BPSK Modulation
user1Symbols = 2 * user1Bits - 1; % Map 0s to -1 and 1s to 1
user2Symbols = 2 * user2Bits - 1;

% Chip-level Spreading (using a simple chip sequence)


chipSequence = [1, -1, 1, 1, -1, 1, -1, -1]; % Chip sequence for spreading
user1SpreadSymbols = kron(user1Symbols, chipSequence);
user2SpreadSymbols = kron(user2Symbols, chipSequence);

% Add AWGN (Additive White Gaussian Noise)


noiseVar = 10^(-snr/10); % Noise variance
user1NoisySymbols = user1SpreadSymbols + sqrt(noiseVar/2) * randn(1, length(user1SpreadSymbols));
user2NoisySymbols = user2SpreadSymbols + sqrt(noiseVar/2) * randn(1, length(user2SpreadSymbols));

% Matched Filtering (correlation with chip sequence)


user1FilteredSymbols = filter(fliplr(chipSequence), 1, user1NoisySymbols);
user2FilteredSymbols = filter(fliplr(chipSequence), 1, user2NoisySymbols);

% Symbol Detection (using correlation with chip sequence)


user1DetectedBits = user1FilteredSymbols(1:length(user1Symbols)) > 0;
user2DetectedBits = user2FilteredSymbols(1:length(user2Symbols)) > 0;

% Bit Error Rate (BER) Calculation


berUser1 = sum(user1DetectedBits ~= user1Bits) / numBits;
berUser2 = sum(user2DetectedBits ~= user2Bits) / numBits;

% Display results
disp(['User 1 BER: ', num2str(berUser1)]);
disp(['User 2 BER: ', num2str(berUser2)]);

22
OUTPUT
User 1 BER: 0.482
User 2 BER: 0.506

Result : Thus modeling and simulation of TDMA, FDMA and CDMA for
wireless communication has been achieved.

23
24

You might also like