0% found this document useful (0 votes)
53 views71 pages

Ec3501 WC Lab Manual

Uploaded by

22ecb25
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)
53 views71 pages

Ec3501 WC Lab Manual

Uploaded by

22ecb25
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/ 71

KARPAGAM INSTITUTE OF TECHNOLOGY,

COIMBATORE – 641 105.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Course Code&Name:EC3501- Wireless Communication Laboratory


Year/Branch:III/ECE
Academic Year: 2024 - 2025 (ODD SEMESTER)

OBSERVATION NOTE BOOK

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

 Establishing state-of–the-art infrastructure, effective procedures for recruitment of competent


faculty and innovative teaching practices.
 Creating a conducive environment for nurturing innovative ideas and encouraging research
skills.
 Inculcating social and ethical values through co-curricular and extra- curricular activities.

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.

PROGRAM EDUCATIONAL OBJECTIVES (PEOS)


1. Graduates will exhibit conceptual, practical and analytical knowledge in the field of Electronics
and Communication Engineering.
2. Graduates will excel in their chosen technical profession in Electronics and Communication
Engineering or interdisciplinary areas.
3. Graduates will engage in life-long learning and team work with ethical values.

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)

2. Modelling 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 Scalar

4. Modulation: Spread Spectrum – DSSS Modulation; Demodulation

5. Wireless Channel equalization: Zero-Forcing Equalizer (ZFE), MMSE Equalizer (MMSEE),

Adaptive Equalizer (ADE), Decision Feedback Equalizer (DFE)

6. Modelling and simulation of TDMA, FDMA and CDMA for wireless communication

Experiment Beyond the syllabus:

7. Implementation of Destination Sequence Distance Vector protocol

Total:30Periods

6
Formulated Course Outcome (CO)

CO No. Course Outcomes (COs) Learning Level

CO1 Explain the concept and design of a cellular system K2


Interpret mobile radio propagation and various digital modulation
CO2 K2
techniques.
Infer the concepts of multiple access techniques and wireless
CO3 K2
networks.
CO4 Identify a wireless channel with system design specifications K3
Apply the concepts of a cellular system based on resource
CO5 K3
availability and traffic demands

Experiment wise CO Mapping:

CO/ Exp. No. 1 2 3 4 5 6 7


CO1  

CO2 

CO3  

CO4 

CO5 

CO-PO & CO-PSO MAPPING:

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.

Modeling of wireless communication systems


1. using Scilab (Two ray channel and 10
Okumura –Hata model)

Modeling and simulation of Multipath fading 22


2
channel
Design, analyze and test Wireless standards and
evaluate the performance measurements 30
3
such as BER, PER, BLER, throughput, capacity,
ACLR, EVM for 4G and 5G using Scilab

Modulation: Spread Spectrum – DSSS 34


4
Modulation &Demodulation

Wireless Channel equalization: Zero-Forcing


Equalizer (ZFE),MMSE 44
5
Equalizer(MMSEE),Adaptive Equalizer
(ADE),Decision Feedback Equalizer (DFE)

Modeling and simulation of TDMA, FDMA and 64


6
CDMA for wireless communication.

Implementation of Destination Sequence


7 Distance Vector protocol 70

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

The Okumura model is formally expressed as:

L = LFSL + AMU – HMG – HBG – ∑ KCORRECTION

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:

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', 'suburban', or 'open'

// Calculate path loss for each distance


L = okumura_hata(fc, d, ht, hr, environment);

// Plotting the path loss as a function of distance

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:

// Clear console and variables


clc;
clear;

// Define the function for Hata model


function L = hata_model(fc, d, ht, hr, environment)
// fc: frequency in MHz
// d: distance in km
// ht: height of transmitting antenna in meters
// hr: height of receiving antenna in meters
// environment: 'urban' or 'suburban'

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

L = 46.3 + 33.9*log10(fc) - 13.82*log10(ht) + (44.9 - 6.55*log10(ht))*log10(d) + C -


(13.83*log10(hr));
endfunction

// 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'

// Calculate path loss for each distance using Hata model

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.

Effect of Multipath on the performance of DS-CDMA

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.

Maximum Ratio Combining (MRC)


Here the signal from different paths is weighted according to their individual signal voltage to
noise power ratios and then summed. Hence maximum ratio combining produces an output
SNR equal to the sum of the individual SNRs which is the acceptable SNR even when none
of the individual signals are themselves acceptable. In MRC, the receiver corrects the phase
rotation caused by a fading channel and then combines the received signals of different paths
proportionally to the strength of each path. Since each path undergoes different attenuations,
combining them with different weights yield an optimum solution under an AWGN channel.

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)

Equal Gain Combining (EGC)

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.

 Generate waveforms for simulations or over-the-air testing using command-line


functions or the Wireless Waveform Generator app
 Implement performance measurements such as BER, PER, BLER, throughput,
capacity, ACLR, EVM

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:

DSBSC WITH A PULSE TRAIN FOR THE CARRIER

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.

DSSS and deliberate interference ( Jamming)

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)

// Generate a pseudo-random chip sequence (PN sequence)


// Here, a simple pseudo-random sequence is generated
rand('seed', 0); // Set seed for reproducibility
chip_sequence = 2 * (rand(1, chip_length) > 0.5) - 1; // Generate random chips: +1 or -1

// Modulate the binary data with the chip sequence


modulated_signal = [];
for i = 1:length(data)
if data(i) == 0 then
modulated_signal = [modulated_signal, chip_sequence]; // Positive amplitude for 0
else
modulated_signal = [modulated_signal, -chip_sequence]; // Negative amplitude for 1
end
end

disp(modulated_signal); // Display modulated signal

plot(modulated_signal);

DEMODULATION

// Parameters (should match modulation parameters)


chip_length = 8; // Length of each chip in bits
integration_time = chip_length; // Integration time for energy detection

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

// Calculate accumulated energy (simulated as sum of chips)


accumulated_energy = sum(received_chips);

// Determine recovered data bit based on energy threshold


ifaccumulated_energy> 0 then
recovered_data = [recovered_data, 0]; // Energy threshold check for 0
else
recovered_data = [recovered_data, 1]; // Energy threshold check for 1
end
end

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: .

To design a wireless Channel equalization: Zero-Forcing Equalizer (ZFE), MMS Equalizer


(MMSEE), Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE).

THEORY:

Adaptive equalizer structures provide suboptimal equalization of time variations in the


propagation channel characteristics. However, these equalizers are appealing because their
computational complexity is lower than MLSE Equalizers.
These features output the estimate of the signal by using an estimate of the channel modeled
as a finite input response (FIR) filter.
To decode a received signal, the adaptive equalizer:
1. Applies the FIR filter to the symbols in the input signal. The FIR filter tap weights
correspond to the channel estimate.
2. Outputs the signal estimate and uses the signal estimate to update the tap weights for the
next symbol. The signal estimate and updating of weights depends on the adaptive
equalizer structure and algorithm.
Adaptive equalizer structure options are linear or decision-feedback. Adaptive algorithm
options are least mean square (LMS), recursive mean square (RMS), or constant modulus
algorithm (CMA).

CODING:

I) SCILAB CODE FOR ZERO FORCING EQUALIZER (ZFE)

// Define parameters

N = 1000; // Number of symbols

SNR_dB = 20; // Signal to Noise Ratio in dB

SNR = 10^(SNR_dB/10); // Linear SNR

41
42
// Generate random BPSK symbols

symbols = 2 * (rand(1, N) > 0.5) - 1;

// Channel (example: simple multipath channel)

h = [0.9, 0.4]; // Channel impulse response

// Convolve symbols with channel

received_signal = conv2(symbols, h);

// Add noise

noise = (1/sqrt(2*SNR)) * (rand(1, length(received_signal)) + %i * rand(1,


length(received_signal)));

received_signal = received_signal + noise;

// Zero Forcing Equalizer

h_inv = 1 ./ h;

equalized_signal = conv2(received_signal, h_inv);

// Plotting

clf;

subplot(2,1,1);

plot(real(received_signal));

title('Received Signal');

subplot(2,1,2);

plot(real(equalized_signal));

title('Equalized Signal (Zero Forcing)');

43
OUTPUT:

44
II) MMSE Equalizer

clc;

clear;

close;

// MMSE Equalizer Example

// Initialize parameters

N = 1000; // Number of data symbols

M = 10; // Number of taps (length of equalizer)

// Generate transmitted signal (for demonstration purposes, can be replaced)

s = 2*rand(1, N) - 1; // Random binary data symbols (-1 or +1)

// Simulate channel (for demonstration purposes, can be replaced)

channel = 0.8 + 0.1*rand(1, N); // Channel response, can be a real channel response

// Received signal (including channel distortion and noise)

n_var = 0.1; // Noise variance

r = s .* channel + sqrt(n_var)*rand(1, N); // Received signal

// MMSE Equalizer Calculation

Rsr = xcorr(r, s); // Cross-correlation between received signal and transmitted signal

Rss = xcorr(s, s); // Autocorrelation of transmitted signal

// Compute MMSE equalizer coefficients

h_mmse = Rsr(M:M+M-1) / (Rss(M:M+M-1) + n_var); // MMSE equalizer coefficients

45
46
// Equalize the received signal

y_mmse = filter(h_mmse, 1, r);

// Plot the original signal, received signal, and equalized 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)

plot(1:N, y_mmse, 'g')

title('MMSE Equalized Signal')

// Display MMSE equalizer coefficients

disp('MMSE Equalizer Coefficients:')

disp(h_mmse)

47
OUTPUT:

"MMSE Equalizer Coefficients:"

0.4757842

48
iii) ADAPTIVE EQUALISER

clc;

clear;

close;

// Adaptive Equalizer using LMS Algorithm

// Initialize parameters

N = 1000; // Number of data symbols

M = 10; // Number of taps (length of equalizer)

mu = 0.01; // Step size of the LMS algorithm

// Generate transmitted signal (for demonstration purposes, can be replaced)

s = 2*rand(1, N) - 1; // Random binary data symbols (-1 or +1)

// Simulate channel (for demonstration purposes, can be replaced)

channel = 0.8 + 0.1*rand(1, N); // Channel response, can be a real channel response

// Received signal (including channel distortion)

r = s .* channel; // Received signal

// Adaptive Equalizer using LMS Algorithm

h = zeros(1, M); // Initial equalizer coefficients

for n = M:N

//Compute output of equalizer

y = h * r(n:-1:n-M+1)';

49
OUTPUT:

ADAPTIVE EQUALISER

50
// Compute error

e = s(n) - y;

// Update equalizer coefficients using LMS algorithm

h = h + mu * e * r(n:-1:n-M+1);

end

// Plot the original signal, received signal, and equalized signal

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)

y_eq = filter(h, 1, r);

plot(1:N, y_eq, 'g')

title('Equalized Signal')

// Display equalizer coefficients

disp('Equalizer Coefficients:')

disp(h)

51
52
IV) DECISION FEEDBACK EQUALIZER (DFE)

code:

clc;

clear all;

close all;

// Parameters

N = 1000; // Number of transmitted symbols

M = 5; // Memory length of the equalizer

SNR_dB = 20; // Signal-to-noise ratio in dB

mu = 0.01; // Step size for adaptive filter

// Generate transmitted symbols (QPSK modulation)

symbols_real = 2*rand(1, N, 'uniform') - 1;

symbols_imag = 2*rand(1, N, 'uniform') - 1;

symbols = symbols_real + %i*symbols_imag;

// Channel (example: simple FIR filter)

h = [0.9, 0.5, 0.2, 0.1, 0.05]; // Channel coefficients

// Add noise to the received signal

noise_var = 10^(-SNR_dB/10);

noise = sqrt(noise_var/2)*(rand(1, N) + %i*rand(1, N));

rx_signal = filter(h, 1, real(symbols)) + %i*filter(h, 1, imag(symbols)) + noise;

// Initialize variables for DFE

dfe_out = zeros(1, N);

53
OUTPUT:

DECISION FEEDBACK EQUALIZER (DFE)

1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

column 1 to 8

-0.4957968 0.02761 -0.7895364 -0.8829925 0.495781 -0.5219554 -0.5014629


0.2620221

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

// Decision device (slicer)

decision = sign(real(feedforward_out)) + %i*sign(imag(feedforward_out));

// Feedback filter

feedback_out = conj(decision) * delay_elements';

// DFE output

//dfe_out(k) = feedforward_out - feedback_out;

// Update delay line (shift and insert current symbol)

delay_elements = [symbols(k), delay_elements(1:M-1)];

end

// Plot results

55
56
subplot(2, 1, 1);

plot(1:N, real(symbols), 'b', 1:N, real(dfe_out), 'r');

disp(1:N, real(symbols), 'b', 1:N, real(dfe_out), 'r');

xlabel('Symbol Index');

ylabel('Amplitude');

title('Transmitted Symbols vs DFE Output (Real part)');

legend('Transmitted Symbols', 'DFE Output');

subplot(2, 1, 2);

plot(1:N, imag(symbols), 'b', 1:N, imag(dfe_out), 'r');

xlabel('Symbol Index');

ylabel('Amplitude');

title('Transmitted Symbols vs DFE Output (Imaginary part)');

legend('Transmitted Symbols', 'DFE Output');

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

// Generate random BPSK symbols for each user


symbols = 2 * (rand(num_users, N) > 0.5) - 1;

// Channel (example: simple multipath channel)


h = [0.9, 0.4]; // Channel impulse response

// Allocate time slots (equal duration for simplicity)


slot_duration = 1; // Example: 1 symbol duration per time slot

// Initialize received signal matrix


received_signal = zeros(num_users, N);

// Simulate transmission and reception


for u = 1:num_users
// Convolve symbols with channel
temp_signal = conv2(symbols(u, :), h);

// 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;

// Place into received signal matrix


received_signal(u, :) = temp_signal(1:N);
end

// Plotting (example: plot for one user)


clf;
subplot(2,1,1);
plot(real(received_signal(1, :)));
title('Received Signal for User 1');
subplot(2,1,2);
plot(imag(received_signal(1, :)));
title('Imaginary Part');

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

// Generate random BPSK symbols for each user


symbols = 2 * (rand(num_users, N) > 0.5) - 1;

// Channel (example: simple multipath channel)


h = [0.9, 0.4]; // Channel impulse response

// Allocate frequency bands (example: different frequencies)


freq_bands = [1, 2, 3, 4]; // Example: 4 different frequency bands

// Initialize received signal matrix


received_signal = zeros(num_users, N);

// Simulate transmission and reception


for u = 1:num_users
// Convolve symbols with channel
temp_signal = conv2(symbols(u, :), h);

// Add noise
noise = (1/sqrt(2*SNR)) * (rand(1, length(temp_signal)) + %i * rand(1,
length(temp_signal)));
temp_signal = temp_signal + noise;

// Place into received signal matrix


received_signal(u, :) = temp_signal(1:N);
end

// Plotting (example: plot for one user)


clf;
subplot(2,1,1);
plot(real(received_signal(1, :)));
disp(real(received_signal(1, :)));
title('Received Signal for User 1');
subplot(2,1,2);
plot(imag(received_signal(1, :)));
disp(imag(received_signal(1, :)));
title('Imaginary Part');

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

// Generate random BPSK symbols for each user


symbols = 2 * (rand(num_users, N) > 0.5) - 1;

// Channel (example: simple multipath channel)


h = [0.9, 0.4]; // Channel impulse response

// Generate random spreading codes (example: using PN sequences)


spread_codes = 2 * (rand(num_users, N) > 0.5) - 1;

// Initialize received signal matrix


received_signal = zeros(num_users, N);

// Simulate transmission and reception


for u = 1:num_users
// Spread symbols with spreading code
spread_signal = symbols(u, :) .* spread_codes(u, :);

// Convolve with channel


temp_signal = conv2(spread_signal, h);

// Add noise
noise = (1/sqrt(2*SNR)) * (rand(1, length(temp_signal)) + %i * rand(1,
length(temp_signal)));
temp_signal = temp_signal + noise;

// Place into received signal matrix


received_signal(u, :) = temp_signal(1:N);
end

// Plotting (example: plot for one user)


clf;
subplot(2,1,1);
plot(real(received_signal(1, :)));
disp(real(received_signal(1, :)));
title('Received Signal for User 1');
subplot(2,1,2);
plot(imag(received_signal(1, :)));
disp(real(received_signal(1, :)));
title('Imaginary Part');

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:

To write a ns2 program for implementing destination sequence distance vector


protocol.

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&lt;stdio.h&gt;struct node
{
unsigneddist[20]; unsigned from[20];
}rt[10];
int main()
{
intdmat[20][20]; intn,i,j,k,count=0;
printf(&quot;\nEnter the number of nodes : &quot;);
scanf(&quot;%d&quot;,&amp;n);
printf(&quot;\nEnter the cost matrix :\n&quot;); for(i=0;i&lt;n;i++)
for(j=0;j&lt;n;j++)
{
scanf(&quot;%d&quot;,&amp;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&lt;n;i++) for(j=0;j&lt;n;j++) for(k=0;k&lt;n;k++)
if(rt[i].dist[j]&gt;dmat[i][k]+rt[k].dist[j])
}while(count!=0); for(i=0;i&lt;n;i++)
{
rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j]; rt[i].from[j]=k;
count++;
printf(&quot;\n\nState value for router %d is \n&quot;,i+1); for(j=0;j&lt;n;j++)
{

69
70
printf(&quot;\t\nnode %d via %d Distance%d&quot;,j+1,rt[i].from[j]+1,rt[i].dist[j]);
}
}
printf(&quot;\n\n&quot;);
}

RESULT:

Thus the ns2 program for implementing destination sequence distance vector
protocol.was executed and verified successfully.

71

You might also like