Ec3501 WC Lab Manual
Ec3501 WC Lab Manual
Prepared by Approved by
Dr.S.Gopinath,Professor/ECE Dr.D.Baskar
HoD/ECE.
Mrs.N.Menakadevi,AP/ECE
Mrs.R.Kiruthikaa, AP/ECE
1
KARPAGAM INSTITUTE OF TECHNOLOGY
COIMBATORE – 641 105
Institution Vision
To impart quality technical education emphasizing innovations and research with social and
ethical values
Institution Mission
2
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
Vision
To produce technically competent and socially responsible Electronics and Communication Engineers
to meet industry needs.
Mission
1. Establishing state of art technology in the field of Electronics and Communication
Engineeringand enriching the knowledge of faculty through continuous improvement process.
2. Adopting innovative teaching learning practices and facilitating industry institute partnership
for professional development.
3. Inculcating ethical and social values through extension activities.
3
PROGRAM OUTCOMES
PO1 - Engineering Knowledge: Apply the knowledge of Mathematics, Science, Engineering
fundamentals, and an Engineering specialization to the solution of complex engineering problems.
PO2 - Problem analysis: Identify, formulate, review research literature, and analyze complex
Engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and Engineering sciences.
PO3 - Design/development of solutions: Design solutions for complex Engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for the
public health and safety, and the cultural, societal, and environmental considerations.
PO4 - Conduct investigations of complex problems: Use research based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO5 - Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex Engineering activities with an
understanding of the limitations.
PO6 - The Engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional Engineering practice.
PO7 - Environment and sustainability: Understand the impact of the professional Engineering solutions
in societal and environmental contexts, and demonstrate the knowledge of, and the need for sustainable
developments.
PO8 - Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the Engineering practice.
PO9 - Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10 - Communication: Communicate effectively on complex Engineering activities with the
Engineering Community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
PO11 - Project management and finance: Demonstrate knowledge and understanding of the
Engineering and management principles and apply these to one’s own work, as a member and leader in a
team, to manage projects and in multi-disciplinary environments.
PO12 - Life -long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life- long learning in the broadest context of technological change.
4
PROGRAM SPECIFIC OUTCOMES
1. Analyze, Design, Simulate and Integrate Electronic Circuits and Systems for given specifications.
2.Apply the technical knowledge to solve issues in the areas like signal processing, Communication, VLSI
design and Embedded Systems
5
SYLLABUS
EC3501 WIRELESS COMMUNICATION LABORATORY
LISTOFEXPERIMENTS
1. Modelling of wireless communication systems using Scilab (Two ray channel and Okumura –Hata model)
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 Scalar
6. Modelling and simulation of TDMA, FDMA and CDMA for wireless communication
Total:30Periods
6
Formulated Course Outcome (CO)
CO2
CO3
CO4
CO5
PO PO PO PO PO
CO PO1 PO 2 PO 5 PO 6 PO 7 PO 8 PO 9 PSO1 PSO2
3 4 10 11 12
CO1 3 3 3 - - - - 1 - - - 3 3 -
CO2 3 3 3 - - - - 1 - - - 3 3 -
CO3 3 3 3 - - - - 1 - - - 2 3 -
CO4 3 3 3 - - - - 1 - - - 2 3 -
CO5 3 3 3 - - - - 1 - - - 1 3 -
7
INDEX
Page
S.No. Name of the Experiment
No.
8
9
EX. NO:1.a MODELING OF WIRELESS COMMUNICATION SYSTEMS
USING SCILAB (OKUMURA –HATA MODEL)
AIM:
To write a SCILAB program to calculate the median path loss for Okumura model for
outdoor propagation.
THEORY:
The Okumura model for Urban Areas is a Radio propagation model that was built
using the datacollected in the city of Tokyo, Japan. The model is ideal for using in
cities with many
urbanstructuresbutnotmanytallblockingstructures.ThemodelservedasabasefortheHat
aModel. Okumura model was built into three modes. The ones for urban, suburban
and open areas.Themodel for urban areas was built firstandusedasthebaseforothers.
Coverage
Frequency = 150 MHz to 1920 MHz
Mobile Station Antenna Height: between 1 m and 10 m Base station Antenna
Height: between 30 m and 1000 m Link distance: between 1 km and 100 km
Mathematical formulation
where,
L = The median path loss. Unit: Decibel (dB) LFSL = The Free Space Loss. Unit:
Decibel(dB) AMU = Median attenuation.Unit: Decibel(dB) HMG = Mobile station
antenna height gain factor. HBG = Base station antenna height gain factor.
Kcorrection = Correction factor gain (such as type of environment, water surfaces,
isolated obstacle etc.)
Okumura model does not provide a mean to measure the Free space loss. However,
any standard method for calculating the free space loss can be used.
PROGRAM:
10
plot(d, L, 'b-', 'LineWidth', 2);
xlabel('Distance (km)');
ylabel('Path Loss (dB)');
title('Okumura-Hata Path Loss Model');
11
OUTPUT:
12
EX. NO:1.b MODELING OF WIRELESS COMMUNICATION SYSTEMS
USING SCILAB (HATA MODEL)
AIM:
To write a SCILAB program to calculate the median path loss for Hata model for
outdoor propagation.
THEORY:
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.
PCS is another extension of the Hata model. The Walfisch and Bertoni Model is further
advanced.
Coverage
Frequency: 150 MHz to 1500 MHz
Mobile Station Antenna Height: between 1 m and 10 m Base station Antenna Height:
between 30 m and 200 m Link distance: between 1 km and 20 km.
Mathematical formulation
Hata Model for Urban Areas is formulated as:
LU = 69.55 + 26.16 log f – 13.82 log hB – CH + [ 44.9 – 6.55 log hB] log d.
For small or medium sized city,
CH = 0.8 + (1.1 log f – 0.7 )hM – 1.56 log f.
and for large cities,
CH = 8.29 (log (1.54 hM))2 – 1.1 , if 150 ≤ f ≤ 200
CH = 3.2 (log (11.75 hM))2 – 4.97 , if 200 ≤ f ≤ 1500
13
Where,
OUTPUT:
14
LU = Path loss in Urban Areas (dB)
hB= Height of base station Antenna. (m)
hM = Height of mobile station Antenna. (m) f= Frequency of Transmission (MHz).
CH = Antenna height correction factor
d= Distance between the base and mobile stations (km).
The term "small city" means a city where the mobile antenna height not more than 10 meters.
i.e. 1 ≤ hM ≤ 10m
PROGRAM:
ifstrcmp(environment, 'urban')
C = 0;
elseifstrcmp(environment, 'suburban')
C = -2*(log10(fc/28))^2 - 5.4;
else
error('Unsupported environment. Use ''urban'' or ''suburban''.');
end
// Example usage
fc = 900; // Frequency in MHz
d = 0:0.1:20; // Distance range from 0 to 20 km
ht = 50; // Height of transmitting antenna in meters
hr = 2; // Height of receiving antenna in meters
environment = 'urban'; // 'urban' or 'suburban'
15
16
L = hata_model(fc, d, ht, hr, environment);
// Plotting the path loss as a function of distance
plot(d, L, 'b-', 'LineWidth', 2);
xlabel('Distance (km)');
ylabel('Path Loss (dB)');
title('Hata Path Loss Model');
grid on;
RESULT:
The program for Okumura - Hata Model Outdoor Propagation was simulated
successfully.
17
18
EX. NO:2 MODELING AND SIMULATION OF MULTIPATH FADING
CHANNEL
AIM:
To write a SCILAB program to measure performance of DS-CDMA using mixed
codes in multipath channel using RAKE receiver for single user case.
THEORY:
Multipath occurs when a radio signal is split into two or more signals causing the receiving
antenna to receive multiple copies of the same signal. The radio signal can be split by
obstacles such as walls, chairs, tables and other objects. As the signal bounces off an object it
causes a longer path to the receiver. Some signals may bounce off several objects before
reaching the receiver. The longer the path, the greater the amount of delay. As radio signals
are delayed, they reach the receiving antenna at different times sometimes overlapping. The
receiver becomes confused by the signals and is unable to interpret them correctly which
causes data errors requiring retransmission of the signal. Performance can be significantly
reduced by the delayed signals and retransmissions.
CDMA is inherently tolerant to multipath delay spreading signals as any signal that is
delayed by more than one chip time becomes uncorrelated to the PN code used to decode the
signal. This results in the multipath simply appearing as noise. This noise leads to an increase
in the amount of interference seen by each user subjected to the multipath and thus increases
the received BER. The BER is essentially flat for delay spreadings of greater than one chip
time (0.8 ms), which is to be expected as the reflected signal becomes uncorrelated. Also the
multipath delay spreading leads to an increase in the equivalent number of users in the cell, as
it increases the amount of interference seen by the receiver.
RAKE Receiver
A RAKE receiver is a radio receiver designed to nullify the effect of multipath fading. It uses
number of sub-receivers called fingers. Each finger is a correlator and is designed to a
different multipath component. Each finger independently decodes a single multipath
component. The output of all the correlators is combined to increase the SNR in a multipath
environment. The multipath channel through which a radio wave transmits can be viewed as
transmitting the line of sight wave plus a number of multipath components. Multipath
components are delayed copies of the original transmitted wave traveling through a different
echo path, each with a different magnitude and time of arrival at the receiver. Since each
component contains the original information, if the magnitude and phase of each component
is computed at the receiver through a method called channel estimation then all the
19
IMPLEMENTATION:
TRANSMITTER :
20
21
IMPLEMENTATION:
RECEIVER:
22
components can be added coherently to improve the information reliability. The RAKE
receiver is so named because it looks like a garden rake, each finger collecting the symbol
energy similar to how the fingers in a garden rake collects leaves. To minimize the distortions
introduced in the DS-CDMA systems, RAKE receiver uses a technique called diversity.
RAKE Receiver
In our case, RAKE receiver has 2 fingers. Each finger of the receiver process one path of the
composite multipath signal. All the processing in the RAKE fingers should be done at chip
level. Here c(k)indicates the spreading code used for that particular user. h0 and hL are the
multipath channel coefficients. LTc is the delay that is used in the multipath channel model.
MRC is the optimum way (in the sense of the least BER) to use information from different
paths to achieve decoding in an additive white Gaussian channel (AWGN)
In certain cases, it is not convenient to provide for the variable weighting capability required
for true maximal ratio combining. In such cases, the branch weights are all set to unity, but
the signals from each branch are co-phased to provide equal gain combining diversity. This
allows the receiver to exploit signals that are simultaneously received on each branch. The
possibility of producing an acceptable signal from a number of unacceptable inputs is still
retained, and performance is only marginally inferior to MRC The receiver corrects the phase
rotation of the received signals caused by the fading channel and combines the received
signals of different paths with equal weight. In a Rayleigh fading channel, the MRC
performance is the best, followed by EGC. The performance of MRC is the same as that of
EGC if signals from each path are of equal strength.
23
OUTPUT:
24
LU = Path loss in Urban Areas (dB)
hB= Height of base station Antenna. (m)
hM = Height of mobile station Antenna. (m) f= Frequency of Transmission (MHz).
CH = Antenna height correction factor
d= Distance between the base and mobile stations (km).
The term "small city" means a city where the mobile antenna height not more than 10 meters.
i.e. 1 ≤ hM ≤ 10m
RESULT:
The program to measure performance of multipath channel for single user case was
simulated successfully.
25
26
EX. NO: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 SCILAB
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 Scilab.
THEORY:
SCILAB enables you to meet performance requirements with end-to-end link-level and
system-level modeling and simulations.
CODING:
clc
clear all
ns=100;
nbit=52;
snr=-10:18;
for k=1:length(snr)
ber=0;
for i=1:ns
data=rand(1,nbit)>0.5;
mdata=2*data- 1 ;
ofdmin=[mdata zeros(1,12)];
ofdmsym=ifft(ofdmin);
sigpow=ofdmsym*ofdmsym';
noisepow(k)=sigpow/(10^(snr(k)/10));
noise=sqrt(noisepow(k))*(rand(1,64,"normal")+sqrt(-1)*rand(1,64,"normal"));
ofdmsym_rx=ofdmsym+noise;
rxdata=fft(ofdmsym_rx);
rxmdata=rxdata(1:52);
outdata=real(rxmdata)>0;
27
OUTPUT:
28
err(i)=sum(outdata~=data);
end
ber=mean(err)/52;
ber1(k)=ber;
end
figure(1)
plot(snr,ber1)
xlabel('SNR')
ylabel('BER')
title('BER cureve for OFDM system over AWGN channel')
RESULT:
The program for 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 Scilab was simulated successfully.
29
30
EX. NO: 4 MODULATION: SPREAD SPECTRUM – DSSS MODULATION &
DEMODULATION
AIM:
To write a SCILAB program to modulate and demodulate Direct Sequence Spread
Spectrum techniques.
THEORY:
.
DSBSC signal is demodulated using product detection, both sidebands re multiplied
with a local carrier that must be synchronized to the transmitter’s carrier that is , it has the
same frequency and phase. Doing so produces two messages that are in phase with each other
and so add to form a single bigger message.
Direct sequence spread spectrum is a variation of DSBSC modulation scheme with a pulse
train for the carrier instead of a simple sinewave. This may sound radical until you remember
that pulse trans are actually made up of a theoretically infinite number of sinewaves. That
being the cse, spread spectrum is really the DSBSC modulation of a theoretically infinite
number of sinusoidal carrier signals. The result is a theoretically infinite number of pairs of
tiny sidebands about a suppressed carrier.
The only way to obtain the right number of sinewaves at the right frequency and
phase at the receiver is to use a pulse train with an identical sequence to that used by the
transmitter. Moreover, it must be synchronized. This issue gives spread spectrum another of
its advantages over other modulation schemes. The transmitted signal is effectively
encrypted.
Of course, with trial and error its possible for an unauthorized person to guess the correct PN
sequence to use for their receiver. However, this can be made difficult by making the
sequence longer before it repeats itself. Longer sequences can produce more combinations of
unique codes which would take longer to guess using a trial and error approach. To illustrate
this point , an 8 bit code has 256 combinations while a 20 bit code has 1048575
combinations. A 256 bit code has 1.1579*1077 combinations.
Increasing the sequence’s chip-length has another advantage. To explain, the total
energy in a spread spectrum signal is distributed between all of the tiny DSBSC that make it
up. A mathematical technique called Fourier Analysis shows that the greater the number of
chips in a sequence before repeating, the greater the number of sinewaves of significance
needed to make it.
That being the case, using more chips in the transmitter’s PN sequence products more
DSBSC signals and so the signal’s total energy is distributed more thinly between them. This
in turn means that the individual signals are many and extremely small. Infact , if the PN
sequence is long enough, all of these DSBSC signals are smaller than the background
electrical noise that’s always present in free space. This fact gives spread spectrum yet
another important advantage. The signal is difficult to detect.
Spread spectrum finds use in several digital applications including: CDMA mobile phone
technology, cordless phones. The global positioning system and two of the 805.11 Wi-fi
standards
31
IMPLEMENTATION:
32
The Spread Spectrum technique can be divided into Direct Sequence Spread Spectrum
(DSSS) and Frequency Hopping Spread Spectrum (FHSS). In DSSS the Pseudo Random
sequence is applied directly to baseband data entering the carrier modulator. The modulator
therefore sees a much larger bit rate, which corresponds to the chip rate of the PN sequence.
This code sequence is typically Pseudo random binary code or PN specially chosen for
desirable statistical properties. In effect, we are transmitting a wideband noise like signal
which contains embedded message data. The time period of a single bit in the PN code is
termed as chip and the bit rate of the PN code is termed Chip rate
Spreading codes
The spreading code or the PN sequence should be ideally balanced with equal number of
ones and zeros over the length of the sequence as well as cryptographically secure. Some of
the most popular PN sequences are Barker, M – Sequence, Gold and Walsh. More complex
sequences provide a more robust link but the implementation becomes very expensive. We
have Orthogonal spreading codes, Non-Orthogonal spreading codes and Mixed spreading
codes. Orthogonal codes are generated using Walsh-Hadamard series and the Non-orthogonal
codes are generated using Linear Feedback Shift Register (LFSR). The mixed codes are
generated by multiplying the orthogonal and non-orthogonal codes. The orthogonality
property of the orthogonal codes is very important for any communication system. Because
of the orthogonality property, two orthogonal signals can be transmitted at the same time and
will not interfere with each other. But the auto correlation function of the Walsh – Hadamard
matrix can have more than one peak and therefore it is not possible for the receiver to detect
the beginning of code word without an external synchronization scheme. Also the cross
correlation can also be non- zero for a number of time shifts and un-synchronous users can
interfere with each other. The spreading is not over the entire bandwidth instead it is over a
number of discrete frequency component. Orthogonality is affected by multi-path effect.
Gold sequences are popular for Non-orthogonal codes. Here the transmission can be
asynchronous. The receiver can synchronize using the auto correlation property of the Gold
Sequence.
33
IMPLEMENTATION:
GENERATING A DSSS SIGNAL USING SPEECH:
34
As DSSS is basically just DSBSC with a pulse train for the carrier instead of a simple
sinusoid, it can be generated by implementing the mathematical model for DSBSC.
1. Gather a set of the equipment listed on the previous page.
2. Set up the scope per the instructions in experiment 1.
a. The Trigger source control is set to the CHI position
b. The Moe control is set to the CHI position.
3. Set the scope’s Trigger source coupling control the t he HF REJ position.
4. Locate the sequence Generator module and set its dip-switches to 00
a. To do this, push both switches up.
5. Connect the set-up shown in Figure 1 below.
a. Note : Insert the black plugs of the oscilloscope leads into a ground (GND) socket.
6. Adjust the scope’s Time base control to view two or more cycles of the Master signals
modules 2 kHz sine output.
7. Set the scope’s Mode control to the DUAL position to view the DSSS signal out of
the Multiplier Module as well as the message signal.
8. Adjust the scope’s Vertical Attenuations controls to the appropriate settings for the
signals.
9. Draw the two waveforms to scale in the space provided on the next page leaving room
to draw a third waveform.
a. Tip: Draw the message signal in the upper third of the graph and DSSS signal in the
middle third.
10. Use the scope’s channel 1 Vertical position control to overlay the message with the
DSSS signal’s envelope’s and compare them.
Interferences occurs when an unwanted electrical signal gets added to the transmitted signal
and changes it enough to change the recovered message. Electrical noise is a significant
source of unintentional interference.
However, sometimes noise is deliberately added to the transmitted signal for the purpose of
interfering or Jamming it. The next part of the experiment models deliberate interference to
show how spread spectrum signals are highly resistant to it.
35
36
CODING:
Modulation:
// Parameters
chip_length = 8; // Length of each chip in bits
data = [1 0 1 1 0]; // Example binary data (0s and 1s)
plot(modulated_signal);
DEMODULATION
// Received modulated signal (use the same as modulated_signal from modulation example)
received_signal = modulated_signal; // Example received signal
recovered_data = [];
for i = 1:length(data)
// Extract chips corresponding to the current data bit
received_chips = received_signal((i-1)*chip_length + 1:i*chip_length);
37
OUTPUT:
MODULATION
column 1 to 15
1. -1. 1. 1. -1. -1. -1. -1. -1. 1. -1. -1. 1. 1. 1.
column 16 to 30
1. 1. -1. 1. 1. -1. -1. -1. -1. 1. -1. 1. 1. -1. -1.
column 31 to 40
-1. -1. -1. 1. -1. -1. 1. 1. 1. 1.
DEMODULATION
1. 0. 1. 1. 0.
38
disp(recovered_data); // Display recovered data
plot(recovered_data);
RESULT:
The program to modulate and demodulate Direct Sequence Spread Spectrum techniques was
simulated successfully.
39
40
EX. NO: 5 TO DESIGN A WIRELESS CHANNEL EQUALIZATION: ZERO
FORCING EQUALIZER (ZFE), MMS EQUALIZER (MMSEE),ADAPTIVE
EQUALIZER (ADE),DECISION FEEDBACK EQUALIZER (DFE)
AIM: .
THEORY:
CODING:
// Define parameters
41
42
// Generate random BPSK symbols
// Add noise
h_inv = 1 ./ h;
// Plotting
clf;
subplot(2,1,1);
plot(real(received_signal));
title('Received Signal');
subplot(2,1,2);
plot(real(equalized_signal));
43
OUTPUT:
44
II) MMSE Equalizer
clc;
clear;
close;
// Initialize parameters
channel = 0.8 + 0.1*rand(1, N); // Channel response, can be a real channel response
Rsr = xcorr(r, s); // Cross-correlation between received signal and transmitted signal
45
46
// Equalize the received signal
clf
subplot(3,1,1)
plot(1:N, s, 'b')
title('Original Signal')
subplot(3,1,2)
plot(1:N, r, 'r')
title('Received Signal')
subplot(3,1,3)
disp(h_mmse)
47
OUTPUT:
0.4757842
48
iii) ADAPTIVE EQUALISER
clc;
clear;
close;
// Initialize parameters
channel = 0.8 + 0.1*rand(1, N); // Channel response, can be a real channel response
for n = M:N
y = h * r(n:-1:n-M+1)';
49
OUTPUT:
ADAPTIVE EQUALISER
50
// Compute error
e = s(n) - y;
h = h + mu * e * r(n:-1:n-M+1);
end
subplot(3,1,1)
plot(1:N, s, 'b')
title('Original Signal')
subplot(3,1,2)
plot(1:N, r, 'r')
title('Received Signal')
subplot(3,1,3)
title('Equalized Signal')
disp('Equalizer Coefficients:')
disp(h)
51
52
IV) DECISION FEEDBACK EQUALIZER (DFE)
code:
clc;
clear all;
close all;
// Parameters
noise_var = 10^(-SNR_dB/10);
53
OUTPUT:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
column 1 to 8
column 9 to 10
0.1575012 -0.1544413
"b"
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
54
delay_elements = zeros(1, M);
// DFE processing
for k = 1:N
// Feedforward filter
if k <= length(h)
feedforward_out = 0;
else
feedforward_out = h * delay_elements';
end
// Feedback filter
// DFE output
end
// Plot results
55
56
subplot(2, 1, 1);
xlabel('Symbol Index');
ylabel('Amplitude');
subplot(2, 1, 2);
xlabel('Symbol Index');
ylabel('Amplitude');
RESULT:
The program to Design a Wireless Channel Equalization: Zero Forcing Equalizer (ZFE),
Mms Equalizer (MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)
was simulated successfully.
57
58
EX. NO: 6 MODELING AND SIMULATION OF TDMA, FDMA AND CDMA
FOR WIRELESS COMMUNICATION
AIM:
To write a SCILAB program to basic aspects of TDMA,FDMA,CDMA in single user
case and two user case.
THEORY:
Each user is allocated a time slot in which to transmit data. In FDMA, the time slots are
assigned to the users in a sequential fashion. In TDMA, the time slots are assigned to the
users in a random fashion. In CDMA, the time slots are assigned to the users based on their
code sequences. In OFDMA, the time slots are assigned to the users based on their frequency
offsets. In SDMA, the time slots are assigned to the users based on their location. Users can
then transmit data in their assigned time slots. The data is then demultiplexed at the receive
end and sent to the appropriate user.
CODING:TDMA
// Parameters
N = 1000; // Number of symbols
num_users = 4; // Number of users
SNR_dB = 20; // Signal to Noise Ratio in dB
SNR = 10^(SNR_dB/10); // Linear SNR
// Add noise
59
OUTPUT:TDMA
column 1 to 6
-0.8634177 0.5340123 1.3065601 -0.4406288 0.5499452 1.3519774
column 7 to 10
1.3202679 -0.4683466 -1.2747579 -1.294293
column 1 to 6
0.0665268 0.0106645 0.0054727 0.0658135 0.0060694 0.0697138
column 7 to 10
0.0328304 0.0202109 0.0032497 0.0659879
60
noise = (1/sqrt(2*SNR)) * (rand(1, length(temp_signal)) + %i * rand(1,
length(temp_signal)));
temp_signal = temp_signal + noise;
61
OUTPUT:FDMA
column 1 to 6
-0.8568041 -1.2901468 -1.2926966 0.5351205 1.3299251 1.3057227
column 7 to 10
-0.4572291 -1.261771 -1.2463123 0.5506935
column 1 to 6
0.0051157 0.0458269 0.0055938 0.0583133 0.0159233 0.0401245
column 7 to 10
0.0120741 0.0434126 0.0004602 0.0611663
62
FDMA
// Parameters
N = 10; // Number of symbols
num_users = 4; // Number of users
SNR_dB = 20; // Signal to Noise Ratio in dB
SNR = 10^(SNR_dB/10); // Linear SNR
// Add noise
noise = (1/sqrt(2*SNR)) * (rand(1, length(temp_signal)) + %i * rand(1,
length(temp_signal)));
temp_signal = temp_signal + noise;
63
OUTPUT:CDMA
64
CDMA:
// Parameters
N = 10; // Number of symbols
num_users = 4; // Number of users
SNR_dB = 20; // Signal to Noise Ratio in dB
SNR = 10^(SNR_dB/10); // Linear SNR
// Add noise
noise = (1/sqrt(2*SNR)) * (rand(1, length(temp_signal)) + %i * rand(1,
length(temp_signal)));
temp_signal = temp_signal + noise;
65
66
RESULT:
The program to SCILAB program to basic aspects TDMA, FDMA AND CDMA in
single user case and two user case was simulated successfully.
67
68
EX.NO:7 IMPLEMENTATION OF DESTINATION SEQUENCE DISTANCE
VECTOR PROTOCOL
AIM:
SOFTWARE REQUIRED:
Turbo C, C++
ALGORITHM:
1: Start the program.
2: Write the program
3: Enter the number of nodes.
4: Enter the cost matrix..
5: Stop the program.
PROGRAM:
#include<stdio.h>struct node
{
unsigneddist[20]; unsigned from[20];
}rt[10];
int main()
{
intdmat[20][20]; intn,i,j,k,count=0;
printf("\nEnter the number of nodes : ");
scanf("%d",&n);
printf("\nEnter the cost matrix :\n"); for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
scanf("%d",&dmat[i][j]); dmat[i][i]=0; rt[i].dist[j]=dmat[i][j];
rt[i].from[j]=j;
}
do
{
count=0;
for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++)
if(rt[i].dist[j]>dmat[i][k]+rt[k].dist[j])
}while(count!=0); for(i=0;i<n;i++)
{
rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j]; rt[i].from[j]=k;
count++;
printf("\n\nState value for router %d is \n",i+1); for(j=0;j<n;j++)
{
69
70
printf("\t\nnode %d via %d Distance%d",j+1,rt[i].from[j]+1,rt[i].dist[j]);
}
}
printf("\n\n");
}
RESULT:
Thus the ns2 program for implementing destination sequence distance vector
protocol.was executed and verified successfully.
71