0% found this document useful (0 votes)
38 views20 pages

WC Lab Manual

The document outlines a series of experiments aimed at modeling and simulating various wireless communication systems using MATLAB, including Two Ray Channel, Okumura-Hata Model, Multipath Fading Channel, DSSS Modulation, and performance evaluation of 4G and 5G standards. Each experiment includes a clear aim, required apparatus, and detailed procedures along with MATLAB code for implementation. The document also discusses performance metrics such as Bit Error Rate (BER), Packet Error Rate (PER), and Block Error Rate (BLER) among others.
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)
38 views20 pages

WC Lab Manual

The document outlines a series of experiments aimed at modeling and simulating various wireless communication systems using MATLAB, including Two Ray Channel, Okumura-Hata Model, Multipath Fading Channel, DSSS Modulation, and performance evaluation of 4G and 5G standards. Each experiment includes a clear aim, required apparatus, and detailed procedures along with MATLAB code for implementation. The document also discusses performance metrics such as Bit Error Rate (BER), Packet Error Rate (PER), and Block Error Rate (BLER) among others.
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/ 20

EXPERIMENT 1: MODELING OF WIRELESS COMMUNICATION SYSTEMS

USING MATLAB (TWO RAY CHANNEL AND OKUMURA –


HATA MODEL)

AIM:

To simulate Two Ray Channel and Okumura – Hata Model using MATLab.

APPARATUS REQUIRED:

1. Personal Computer

2. Matlab software R2018 or later

PROCEDURE:

1. Open Matlab software

2. Open new file and enter the program and save it.

3. Add the path to the location of the file in the system.

4. Compile the program and check for any error and debug it.

5. Note down the output.

PROGRAM:

>> % 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

Page 1 of 20
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 Modeling');

grid on;

OUTPUT WAVEFORM:

Page 2 of 20
EXPERIMENT 2: MODELING AND SIMULATION OF MULTIPATH FADING
CHANNEL

AIM:

To simulate Multipath Fading Channel using MATLab.

APPARATUS REQUIRED:

1. Personal Computer

2. Matlab software R2018 or later

PROCEDURE:

1. Open Matlab software

2. Open new file and enter the program and save it.

3. Add the path to the location of the file in the system.

4. Compile the program and check for any error and debug it.

5. Note down the output.

PROGRAM:

% 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);

Page 3 of 20
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');
title('received signal');
legend('In-phase','quadrature');
xlabel('time');
ylabel('amplitude');

OUTPUT WAVEFORM:

Page 4 of 20
EXPERIMENT 3: MODULATION: SPREAD SPECTRUM – DSSS MODULATION
AND DEMODULATION

AIM:

To simulate Spread Spectrum – DSSS Modulation and Demodulation using MATLab.

APPARATUS REQUIRED:

1. Personal Computer

2. Matlab software R2018 or later

PROCEDURE:

1. Open Matlab software

2. Open new file and enter the program and save it.

3. Add the path to the location of the file in the system.

4. Compile the program and check for any error and debug it.

5. Note down the output.

PROGRAM:

clc;
b=[1 0 1 0 1 0 1 0];
ln=length(b);
% Converting bit 0 to -1
for i=1:ln
if b(i)==0
b(i)=-1;
end
end
% Generating the bit sequence with each bit 8 samples long
k=1;
for i=1:ln
for j=1:8
bb(k)=b(i);
j=j+1;
k=k+1;
end
i=i+1;
end
len=length(bb);

Page 5 of 20
subplot(2,1,1);
stairs(bb); %stairs(bb,'linewidth',2);
axis([0 len -2 3]);
title('ORIGINAL BIT SEQUENCE b(t)');
% Generating the pseudo random bit pattern for spreading
pr_sig=round(rand(1,len));
for i=1:len
if pr_sig(i)==0
pr_sig(i)=-1;
end
end
subplot(2,1,2);
stairs(pr_sig); %stairs(pr_sig,'linewidth',2);
axis([0 len -2 3]);
title('PSEUDORANDOM BIT SEQUENCE pr_sig(t)');
% Multiplying bit sequence with Pseudorandom Sequence
for i=1:len
bbs(i)=bb(i).*pr_sig(i);
end
% Modulating the hopped signal
dsss=[];
t=0:1/10:2*pi;
c1=cos(t);
c2=cos(t+pi);
for k=1:len
if bbs(1,k)==-1
dsss=[dsss c1];
else
dsss=[dsss c2];
end
end
figure,
subplot(2,1,1);
stairs(bbs); %stairs(bbs,'linewidth',2);
axis([0 len -2 3]);
title('MULTIPLIER OUTPUT SEQUENCE b(t)*pr_sig(t)');
subplot(2,1,2);
plot(dsss);

title(' DS-SS SIGNAL...');

Page 6 of 20
OUTPUT WAVEFORM:

ORIGINAL BIT SEQUENCE b(t)


3

-1

-2
0 10 20 30 40 50 60

PSEUDORANDOM BIT SEQUENCE prsig(t)


3

-1

-2
0 10 20 30 40 50 60

MULTIPLIER OUTPUT SEQUENCE b(t)*prsig(t)


3

-1

-2
0 10 20 30 40 50 60

DS-SS SIGNAL...
1

0.5

-0.5

-1
0 500 1000 1500 2000 2500 3000 3500 4000 4500

Page 7 of 20
EXPERIMENT 4: DESIGN, ANALYSE AND TEST WIRELESS STANDARDS AND
EVALUATE THE PERFORMANCE MEASUREMENTS SUCH
AS BER, PER, BLER, THROUGHPUT, CAPACITY, ACLR, EVM
FOR 4G AND 5G USING MATLAB

AIM:

To design, analyse and test Wireless Standards and evaluate the performance
measurements such as BER, PER, BLER, Throughput, Capacity, ACLR, EVM for 4G & 5G
using MATLab.

APPARATUS REQUIRED:

1. Personal Computer

2. Matlab software R2018 or later

PROCEDURE:

1. Open Matlab software

2. Open new file and enter the program and save it.

3. Add the path to the location of the file in the system.

4. Compile the program and check for any error and debug it.

5. Note down the output.

BIT ERROR RATE (BER):

PROGRAM:

clc;
num_bits = 10000;

snr_dB = 0:2:20;
data = randi([0, 1], 1, num_bits);
modulated_data = 2 * data - 1;
ber_simulated = zeros(size(snr_dB));
ber_theoretical = zeros(size(snr_dB));
for i = 1:length(snr_dB)
snr_linear = 10^(snr_dB(i) / 10);
noise_std = sqrt(1 / (2 * snr_linear));
noise = noise_std * randn(1, num_bits);
received_signal = modulated_data + noise;
demodulated_data = sign(received_signal);

Page 8 of 20
num_errors = sum(demodulated_data ~= data);
ber_simulated(i) = num_errors / num_bits;
ber_theoretical(i) = 0.5 * erfc(sqrt(snr_linear));
end

figure;
semilogy(snr_dB,ber_simulated,'bo-','LineWidth',2,
'MarkerSize',8);
hold on;
semilogy(snr_dB,ber_theoretical,'r^-','LineWidth',2, 'MarkerSize', 8);
hold off;
grid on;
legend('Simulated BER', 'Theoretical BER');
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
title('Bit Error Rate (BER) for BPSK Modulation in AWGN Channel');

OUTPUT WAVEFORM:

Page 9 of 20
PACKET ERROR RATE (PER):

PROGRAM:

clc;
num_packets = 1000;
packet_length = 100;
snr_dB = 10;
snr_linear = 10^(snr_dB / 10);
noise_std = sqrt(1 / (2 * snr_linear));
num_errors = 0;
for i = 1:num_packets
packet_data = randi([0, 1], 1, packet_length);
modulated_data = 2 * packet_data - 1;
noise = noise_std * randn(1, packet_length);
received_signal = modulated_data + noise;
demodulated_data = sign(received_signal);
if any(demodulated_data ~= packet_data)
num_errors = num_errors + 1;
end
end
perr = num_errors / num_packets;
disp(['Number of packets: ' num2str(num_packets)]);
disp(['Packet length: ' num2str(packet_length)]);
disp(['SNR (dB): ' num2str(snr_dB)]);
disp(['Simulated Packet Error Rate (PER): ' num2str(perr)]);
figure;
for i = 1:min(num_packets, 5)
subplot(5, 1, i);
t = 1:packet_length;
plot(t,real(received_signal),'b',t,imag(received_signal), 'r');
title(['Received Signal for Packet ' num2str(i)]);
xlabel('Time');
ylabel('Amplitude');
legend('I-channel', 'Q-channel');
end

OUTPUT:

Number of packets: 1000

Packet length: 100

SNR (dB): 10

Simulated Packet Error Rate (PER): 1

Page 10 of 20
OUTPUT WAVEFORM:

BLOCK ERROR RATE (BLER):

PROGRAM:

clc;
num_blocks = 1000;
block_length = 100;
snr_dB = 10;
snr_linear = 10^(snr_dB / 10);
noise_std = sqrt(1 / (2 * snr_linear));
num_errors = 0;
block_error_vector = zeros(1, num_blocks);
for i = 1:num_blocks
block_data = randi([0, 1], 1, block_length);
modulated_data = 2 * block_data - 1;
noise = noise_std * randn(1, block_length);
received_signal = modulated_data + noise;
demodulated_data = sign(received_signal);
if any(demodulated_data ~= block_data)
num_errors = num_errors + 1;
block_error_vector(i) = 1;
end
end
bler = num_errors / num_blocks;
disp(['Number of blocks: ' num2str(num_blocks)]);

Page 11 of 20
disp(['Block length: ' num2str(block_length)]);
disp(['SNR (dB): ' num2str(snr_dB)]);
disp(['Simulated Block Error Rate (BLER): ' num2str(bler)]);
figure;
stem(block_error_vector, 'r', 'LineWidth', 2);
title('Block Error Vector');
xlabel('Block Index');
ylabel('Block Error');
axis([0 num_blocks+1 -0.5 1.5]);

OUTPUT:

Number of blocks: 1000

Block length: 100

SNR (dB): 10

Simulated Block Error Rate (BLER): 1

OUTPUT WAVEFORM:

Page 12 of 20
ADJACENT CHANNEL LEAKAGE RATIO (ACLR):

PROGRAM:

clc;
fs = 30.72e6;
t = 0:1/fs:1;
freq_4g = 2.5e6;
freq_5g = 3.5e6;
signal_4g = cos(2*pi*freq_4g*t);
signal_5g = cos(2*pi*freq_5g*t);
[Pxx_4g, f_4g] = pwelch(signal_4g, [], [], [], fs);
[Pxx_5g, f_5g] = pwelch(signal_5g, [], [], [], fs);
center_freq_4g = freq_4g;
adjacent_freq_4g = freq_4g + 5e6;
index_center_4g = find(f_4g == center_freq_4g);
index_adjacent_4g = find(f_4g == adjacent_freq_4g);
aclr_4g = 10*log10(Pxx_4g(index_adjacent_4g) / Pxx_4g(index_center_4g));
center_freq_5g = freq_5g;
adjacent_freq_5g = freq_5g + 5e6;
index_center_5g = find(f_5g == center_freq_5g);
index_adjacent_5g = find(f_5g == adjacent_freq_5g);
aclr_5g = 10*log10(Pxx_5g(index_adjacent_5g) / Pxx_5g(index_center_5g));
disp(['4G ACLR: ' num2str(aclr_4g) ' dB']);
disp(['5G ACLR: ' num2str(aclr_5g) ' dB']);
figure;
subplot(2, 1, 1);
semilogy(f_4g, Pxx_4g);
title('4G Signal Power Spectrum');
xlabel('Frequency (Hz)');
ylabel('Power/Frequency (dB/Hz)');
grid on;
subplot(2, 1, 2);
semilogy(f_5g, Pxx_5g);
title('5G Signal Power Spectrum');
xlabel('Frequency (Hz)');
ylabel('Power/Frequency (dB/Hz)');
grid on;

Page 13 of 20
OUTPUT WAVEFORM:

Page 14 of 20
EXPERIMENT 5: WIRELESS CHANNEL EQUALIZATION: ZERO-FORCING
EQUALIZER (ZFE), MMSE EQUALIZER (MMSEE),
ADAPTIVE EQUALIZER (ADE), DECISION FEEDBACK
EQUALIZER (DFE)

AIM:

To conduct the performance analysis of various Wireless Channel Equalizers such as


Zero-Forcing Equalizer (ZFE), MMSE Equalizer (MMSEE), Adaptive Equalizer (ADE) and
Decision Feedback Equalizer (DFE) using MATLab.

APPARATUS REQUIRED:

1. Personal Computer

2. Matlab software R2018 or later

PROCEDURE:

1. Open Matlab software

2. Open new file and enter the program and save it.

3. Add the path to the location of the file in the system.

4. Compile the program and check for any error and debug it.

5. Note down the output.

ZERO-FORCING EQUALIZER (ZFE) :

% Zero Forcing Equalizer Parameters


channel_length = 10; % Length of the channel impulse response
channel_coefficients = [0.2, 0.5, 0.7, 0.3, 0.1, 0.4, 0.8, 0.6, 0.9, 0.5]; % Channel coefficients
num_symbols = 1000; % Number of transmitted symbols
SNR_dB = 20; % Signal-to-Noise Ratio in dB
% Generate random data symbols (QPSK modulation)
data_symbols = 2 * randi([0, 1], 1, num_symbols) - 1;
% Apply channel distortion
channel_output = filter(channel_coefficients, 1, data_symbols);
% Add AWGN (Channel Modeling)
noise_power = 10^(-SNR_dB/10);
received_symbols = channel_output + sqrt(noise_power/2)*randn(size(channel_output));
% Zero Forcing Equalization
equalizer_tap = 1 / channel_coefficients(1); % One-tap Zero Forcing Equalizer
% Apply Zero Forcing Equalization
equalized_symbols = received_symbols * equalizer_tap;
% Calculate Bit Error Rate (BER)
equalized_bits = sign(equalized_symbols);

Page 15 of 20
num_bit_errors = sum(data_symbols ~= equalized_bits);
bit_error_rate = num_bit_errors / num_symbols;
% Display results
disp(['Bit Error Rate (BER): ', num2str(bit_error_rate)]);
disp(['SNR (dB):', num2str(SNR_dB)]);

OUTPUT:

Bit Error Rate (BER): 0.476

SNR (dB):20

ADAPTIVE EQUALIZER (AE) :

% Adaptive Equalization Parameters


channel_length = 10; % Length of the channel impulse response
channel_coefficients = [0.2, 0.5, 0.7, 0.3, 0.1, 0.4, 0.8, 0.6,0.9, 0.5]; % Channel coefficients
num_symbols = 1000; % Number of transmitted symbols
SNR_dB = 20; % Signal-to-Noise Ratio in dB
% Generate random data symbols (QPSK modulation)
data_symbols = 2 * randi([0, 1], 1, num_symbols) - 1;
% Apply channel distortion
channel_output = filter(channel_coefficients, 1, data_symbols);
% Add AWGN (Channel Modeling)
noise_power = 10^(-SNR_dB/10);
received_symbols = channel_output + sqrt(noise_power/2) *randn(size(channel_output));
% Adaptive Equalization using Recursive Least Squares (RLS)algorithm
equalizer_length = channel_length; % Choose equalizer length to be the same as the channel
length
delta = 0.01; % Small positive constant to ensure numerical stability
forgetting_factor = 0.99; % Forgetting factor for RLS algorithm
equalizer = zeros(1, equalizer_length); % Initialize equalizer weights
P = (1/delta) * eye(equalizer_length); % Initialize inverse correlation matrix
equalized_symbols = zeros(1, num_symbols); % Store equalized symbols
for i = equalizer_length+1:num_symbols
% Extract current observation window
observation = received_symbols(i:-1:i-equalizer_length+1);
equalized_output = equalizer * observation.'; % Apply equalizer to the observation
% Calculate error
error = data_symbols(i) - equalized_output;
% Calculate filter gain
K = P * observation.' / (forgetting_factor + observation * P* observation.');
equalizer = equalizer + K.' * error; % Update equalizer weights
% Update inverse correlation matrix
P = (1/forgetting_factor) * (P - K * observation * P);
equalized_symbols(i) = equalized_output; % Store equalized symbol
end

% Calculate Bit Error Rate (BER)


equalized_bits = sign(equalized_symbols);

Page 16 of 20
num_bit_errors = sum(data_symbols ~= equalized_bits);
bit_error_rate = num_bit_errors / num_symbols;
% Display results
disp(['Bit Error Rate (BER): ', num2str(bit_error_rate)]);
disp(['SNR (dB): ', num2str(SNR_dB)]);

OUTPUT:

Bit Error Rate (BER): 0.449

SNR (dB): 20

DECISION FEEDBACK EQUALIZER (DFE) :

% Decision Feedback Equalization Parameters


channel_length = 10; % Length of the channel impulse response
channel_coefficients = [0.2, 0.5, 0.7, 0.3, 0.1, 0.4, 0.8, 0.6,0.9, 0.5]; % Channel coefficients
num_symbols = 1000; % Number of transmitted symbols
SNR_dB = 20; % Signal-to-Noise Ratio in dB
% Generate random data symbols (QPSK modulation)
data_symbols = 2 * randi([0, 1], 1, num_symbols) - 1;
% Apply channel distortion
channel_output = filter(channel_coefficients, 1, data_symbols);
% Add AWGN (Channel Modeling)
noise_power = 10^(-SNR_dB/10);
received_symbols = channel_output + sqrt(noise_power/2) *randn(size(channel_output));
% Decision Feedback Equalization
equalizer_length = channel_length; % Choose equalizer length to be the same as the channel
length
equalizer = zeros(1, equalizer_length); % Initialize equalizer weights
feedback = zeros(1, equalizer_length); % Initialize feedback coefficients
equalized_symbols = zeros(1, num_symbols); % Store equalized symbols
for i = equalizer_length+1:num_symbols
% Extract current observation window
observation = received_symbols(i:-1:i-equalizer_length+1);
% Apply equalizer to the observation
equalized_output = equalizer * observation.' - feedback *equalized_symbols(i-
equalizer_length:i-1).';
% Make decision on the equalized output (Hard decision)
equalized_symbols(i) = sign(equalized_output);
% Calculate error
error = data_symbols(i) - equalized_symbols(i);
% Update equalizer weights
equalizer = equalizer + 2 * error * conj(observation);
% Update feedback coefficients
feedback = feedback + 2 * error * conj(equalized_symbols(i-equalizer_length:i-1));
end
% Calculate Bit Error Rate (BER)
num_bit_errors = sum(data_symbols ~= equalized_symbols);
bit_error_rate = num_bit_errors / num_symbols;

Page 17 of 20
% Display results
disp(['Bit Error Rate (BER): ', num2str(bit_error_rate)]);
disp(['SNR (dB): ', num2str(SNR_dB)]);

OUTPUT:

Bit Error Rate (BER): 0.498

SNR (dB): 20

MMSE EQUALIZER:

% 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
transmittedSymbols = randi([0 M-1], 1, N);
% 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));
receivedSignal = channelOutput + noise;
% Channel estimation using pilot symbols
pilotIndices = randperm(N, length(pilotSymbols));
pilotSignal = receivedSignal(pilotIndices);
estimatedChannel = conv(pilotSignal, conj(pilotSymbols(end:-1:1)));
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.787

Page 18 of 20
EXPERIMENT 6: MODELING AND SIMULATION OF TDMA, FDMA AND
CDMA FOR WIRELESS COMMUNICATION

AIM:

To simulate the multiple access techniques for Wireless Communication such as


TDMA, FDMA and CDMA using MATLab.

APPARATUS REQUIRED:

1. Personal Computer

2. Matlab software R2018 or later

PROCEDURE:

1. Open Matlab software

2. Open new file and enter the program and save it.

3. Add the path to the location of the file in the system.

4. Compile the program and check for any error and debug it.

5. Note down the output.

% Parameters
num_users = 4; % Number of users
num_symbols = 100; % Number of symbols
% Generate random data bits for each user
data_bits = randi([0, 1], num_users, num_symbols);
% TDMA - Time Division Multiple Access
tdma_symbols = zeros(num_users, num_symbols);
for user = 1:num_users
tdma_symbols(user, :) = data_bits(user, :) * 2 - 1; % Convert 0s to -1s and 1s to 1s
end
% FDMA - Frequency Division Multiple Access
fdma_symbols = zeros(num_users, num_symbols);
for user = 1:num_users
fdma_symbols(user, :) = data_bits(user, :) * 2 - 1; % Convert 0s to -1s and 1s to 1s
end
% CDMA - Code Division Multiple Access
% Generating random spreading codes
spreading_codes = randi([0, 1], num_users, num_symbols);
cdma_symbols = zeros(num_users, num_symbols);
for user = 1:num_users
cdma_symbols(user, :) = (data_bits(user, :) * 2 - 1) .* spreading_codes(user, :);
end

Page 19 of 20
% Plot TDMA, FDMA, and CDMA results
t = 1:num_symbols;
figure;
subplot(3, 1, 1);
plot(t, tdma_symbols', 'LineWidth', 1.5);
title('TDMA - Time Division Multiple Access');
xlabel('Symbol Index');
ylabel('Amplitude');
legend('User 1', 'User 2', 'User 3', 'User 4');
subplot(3, 1, 2);
plot(t, fdma_symbols', 'LineWidth', 1.5);
title('FDMA - Frequency Division Multiple Access');
xlabel('Symbol Index');
ylabel('Amplitude');
legend('User 1', 'User 2', 'User 3', 'User 4');
subplot(3, 1, 3);
plot(t, cdma_symbols', 'LineWidth', 1.5);
title('CDMA - Code Division Multiple Access');
xlabel('Symbol Index');
ylabel('Amplitude');
legend('User 1', 'User 2', 'User 3', 'User 4');
sgtitle('Modeling and Simulation of TDMA, FDMA, and CDMA for Wireless
Communication');

OUTPUT :

Page 20 of 20

You might also like