Ketu WC-1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Enrollment No:210160116005(IT-A1)

A Laboratory Manual for

Wireless Communication
(3171608)

B.E. Semester 7 (I.T.)

Government Engineering College, Modasa

Directorate of Technical Education, Gandhinagar,


Gujarat
Enrollment No:210160116005(IT-A1)

Certificate

This is to certify that Mr. Patel Ketu Shaileshkumar Enrollment No.


210160116005 of B.E. Semester 7 Information Technology of Government
Engineering College, Modasa (016) has satisfactorily completed the Practical
/ Tutorial work for the subject Wireless Communication (3171608) for the
academic year 2024-25.

Place: GEC Modasa


Date:

Name and Sign of Faculty member

Prof. V. R. Patel / Prof. U. R. Bhoi

Head of the Department


Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Preface

Wireless communication has revolutionized the way we communicate with each other, enabling
us to stay connected at all times and from any location. With the rapid advancement in wireless
technology, it has become essential for students of communication engineering to have a
practical understanding of the concepts, techniques, and tools used in wireless communication.
This lab manual is designed to provide a hands-on learning experience to students in wireless
communication. It covers various topics related to wireless communication, such as wireless
channel characterization, modulation, demodulation, error detection, and correction. The
experiments in this manual are intended to reinforce the theoretical concepts taught in the
classroom and to provide practical experience in using wireless communication tools.
The experiments in this lab manual are carefully designed to provide a step-by-step guide to
performing each experiment. The manual includes a detailed explanation of the experiment, the
equipment required, the experimental setup, the procedure, and the expected outcomes. Each
experiment is followed by a set of questions to reinforce the student's understanding of the
concepts learned in the experiment.
This lab manual is a valuable resource for students of Computer engineering, Electrical
Engineering, and Information Technology. It is also useful for professionals working in the
field of wireless communication. We hope that this manual will serve as a valuable tool for
students to gain practical knowledge and understanding of wireless communication.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Practical – Course Outcome matrix

Course Outcomes (COs):


CO 1: Understand the basics of wireless communication and propagation of radio signals.
CO 2: Understand the basic concepts of cellular system and design requirements.
CO 3: Design mobile radio propagation model.
CO 4: Differentiate multiple access techniques.
CO 5: Compare various wireless communication systems and networks.

Sr.
Objective(s) of Experiment CO1 CO2 CO3 CO4 CO5
No.
Analyze the network performance using MATLAB to
1. observe the effect of network topology and √
communication protocols on the network.
Generate a binary sequence and simulate its
2. √
transmission over an AWGN channel using MATLAB.

3. Simulate the line coding techniques using MATLAB. √

Simulate the Binary amplitude shift keying using


4. √
MATLAB and simulink.
Simulate the Binary phase shift keying using MATLAB
5. √
and simulink.
Simulate the Delta Modulation using MATLAB and
6. √
simulink.
Simulate the Direct sequence spread spectrum using
7. √
MATLAB and simulink.
Simulate WSN node to determine position on node and
8. √
blink LED using cupcarbon simulator and senscript.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Industry Relevant Skills

The following industry relevant competency are expected to be developed in the student by
undertaking the practical work of this laboratory.
1. Select the electronic component of proper value as per the requirement.
2. Interpret waveforms of different digital communication.
3. Select the proper communication system as per the requirement.
4. Compare the observed output with the expected output.
5. Use relevant EDA tool for simulating Wireless and Mobile Network.

Guidelines for Faculty members


1. Teacher shall explain prior concepts to the students before starting each experiment.
2. For practical’s requiring tools to be used, teacher should provide the demonstration
of the cpractical emphasizing the skills, which the student should achieve.
3. Involve students in the activities during the conduct of each experiment.
4. Teachers should give opportunity to students for hands-on after the demonstration.
5. Assess the skill achievement of the students and COs of each unit.
6. Teacher is expected to share the skills and competencies to be developed in the
students.
7. Teacher should ensure that the respective skills and competencies are developed in
the students after the completion of the practical exercise.
8. Teacher may provide additional knowledge and skills to the students even though
that may not be covered in the manual but are expected from the students by the
industries.
9. Teacher may suggest the students to refer additional related literature of the reference
books/websites/seminar proceedings etc.
10. During assessment teacher is expected to ask questions to the students to tap their
knowledge and skill related to that practical. Curriculum of the course and follow the
guidelines for implementation.

Instructions for Students


1. Students shall listen carefully the lecture given by teacher about importance of subject,
learning structure, course outcomes.
2. Students shall organize the work in the group of two or three members and make a record
of all observations.
3. Students shall understand the purpose of experiment and its practical implementation.
4. Students shall write the answers of the questions during practical.
5. Student should feel free to discuss any difficulty faced during the conduct of practical.
6. Students shall develop maintenance skills as expected by the industries.
7. Student shall attempt to develop related hands on skills and gain confidence.
8. Students shall refer technical magazines; websites related to the scope of the subjects and
update their knowledge and skills.
9. Students shall develop self-learning techniques.
10. Students should develop habit to submit the write-ups on the scheduled dates and time.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Index

(Progressive Assessment Sheet)

Sr. Objective(s) of Experiment Sign. of


Page Assessment
No. Date Teacher with
No. Marks
date
Analyze the network performance using
MATLAB to observe the effect of network
1.
topology and communication protocols on
the network.
Generate a binary sequence and simulate its
2. transmission over an AWGN channel using
MATLAB.
Simulate the line coding techniques using
3.
MATLAB.
Simulate the Binary amplitude shift keying
4.
using MATLAB and simulink.
Simulate the Binary phase shift keying
5.
using MATLAB and simulink.
Simulate the Delta Modulation using
6.
MATLAB and simulink.
Simulate the Direct sequence spread
7.
spectrum using MATLAB and simulink.
Simulate WSN node to determine position
8. on node and blink LED using cupcarbon
simulator and senscript.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 1
Analyze the network performance using MATLAB to observe the effect of
network topology and communication protocols on the network.

Date:

Competency and Practical Skills:


1. Analyzing network performance using MATLAB requires a fundamental
understanding of wireless networking principles, including network topology,
communication protocols, and wireless channel models. By working on this
practical, engineering students will develop a deep understanding of these
principles, which will enable them to design and optimize wireless communication
networks in real-world scenarios.
2. This practical requires the use of MATLAB, a powerful programming language
for mathematical computing and data analysis. By working on this practical,
engineering students will develop practical skills in using MATLAB to simulate
wireless network scenarios, analyze network performance metrics, and visualize
results.

Relevant CO: Understand the basics of wireless communication and propagation of radio signals.

Objectives:
1. To gain a fundamental understanding of wireless networking principles: This includes
knowledge of network topology, communication protocols, and wireless channel models.
2. To understand the importance of network performance metrics: This includes knowledge
of metrics such as throughput, latency, packet delivery ratio, and energy consumption.
3. To learn how to use MATLAB to simulate wireless network scenarios: This includes
knowledge of how to generate random network topologies and simulate the transmission
of data packets over the network.
4. To learn how to analyze network performance metrics using MATLAB: This includes
knowledge of how to calculate the network performance metrics of interest from the
simulation results.

Equipment/Instruments: MATLAB

Theory: The following are some key concepts and theories involved in analyzing network
performance using MATLAB:
1. Network topology: Network topology refers to the physical or logical arrangement of
nodes in a network. Different topologies, such as star, mesh, and tree, can affect network
performance metrics such as throughput and latency.
2. Communication protocols: Communication protocols are a set of rules that govern how
data is transmitted between nodes in a network. Different protocols, such as TCP and
UDP, can affect network performance metrics such as packet delivery ratio and energy
consumption.
3. Wireless channel models: Wireless channel models describe how radio signals propagate
through the environment. Different models, such as path loss and shadowing models, can
affect network performance metrics such as signal strength and interference.
4. Network performance metrics: Network performance metrics are measurements of the
network's performance, such as throughput, latency, packet delivery ratio, and energy
consumption. These metrics can be used to evaluate the effectiveness of different network
topologies and communication protocols in achieving specific performance goals.
5. Simulation using MATLAB: MATLAB is a powerful programming language for
mathematical computing and data analysis. It can be used to simulate wireless network
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
scenarios, generate random network topologies, and calculate network performance
metrics. Simulation allows us to observe the effect of different network topologies and
communication protocols on the network's performance and optimize these choices to
achieve specific performance goals.
6. Optimization: Optimization involves selecting the best network topology and
communication protocol choices to achieve specific performance goals. This can involve a
trade-off between different metrics, such as throughput and latency, and the use of
optimization algorithms to find the best solution.
Overall, analyzing network performance using MATLAB involves a deep understanding of
wireless networking principles, data analysis and interpretation skills, problem-solving skills, and
communication skills.

Safety and necessary Precautions: NA


Procedure:
% Define the network topology
N = 10; % Number of nodes
P = 0.5; % Probability of edge creation
G = randomGraph(N, P); % Generate a random graph

% Define the communication protocol


protocol = 'TCP';
% Define the network parameters
T = 1000; % Simulation time
lambda = 0.1; % Arrival rate of packets
mu = 0.2; % Service rate of packets
c = 1; % Capacity of the network

% Simulate the network


[t, x] = simulateNetwork(G, protocol, T, lambda, mu, c);
% Plot the results
figure;
plot(t, x);
xlabel('Time');
ylabel('Queue Length');
title(sprintf('Network Performance for %s Protocol', protocol));
grid on; % Add grid for better visualization
% Function to generate a random graph
function G = randomGraph(N, P)
% Generates a random graph with N nodes and probability P
G = rand(N, N) < P; % Create an adjacency matrix
G = G - diag(diag(G)); % Remove self-loops
end
% Function to simulate network behavior
function [time, queue_length] = simulateNetwork(G, protocol, T, lambda, mu, c)
% Simulate a simple network model
% Initialize variables
queue_length = zeros(1, T);

% Start from an initial queue length of 0


current_queue_length = 0;

for time = 1:T


Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
% Simulate packet arrival
if rand < lambda
current_queue_length = current_queue_length + 1; % New packet arrives
end
% Simulate packet service
if rand < mu && current_queue_length > 0
current_queue_length = current_queue_length - 1; % Packet is served
end
% Store the current queue length
queue_length(time) = current_queue_length;
end
% Generate a time vector for plotting
time = 1:T;
end

This code uses the randomGraph function to generate a random graph with N nodes and P
probability of edge creation. It then defines the communication protocol as TCP and sets the
network parameters T, lambda, mu, and c. Finally, it simulates the network using the
simulateNetwork function and plots the results.

Output:

Observations:

 The network topology directly impacts performance metrics such as latency and
throughput.
 Using TCP protocol generally results in better packet delivery ratios but may introduce
higher latency due to its connection-oriented nature compared to UDP.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Calculation:
 Throughput (in packets per second) can be calculated based on the number of packets
delivered over time.
 Latency can be observed by analyzing the time taken for packets to traverse the network.

Example Calculation (to be adjusted based on actual data):


 Average Throughput = Total Packets Delivered / Total Simulation Time
 Average Latency = Total Latency Time / Number of Packets Delivered

Result:
 The simulation provides insights into the queue length over time, indicating network
congestion and performance under the defined topology and protocol.
 Sample output might show that TCP provides a queue length that stabilizes at lower values
compared to UDP under similar conditions.

Conclusion:
 The experiment successfully demonstrated the effect of network topology and
communication protocols on network performance metrics. The findings underscore the
importance of selecting appropriate network configurations for optimizing performance in
real-world scenarios.
 Students gained practical experience using MATLAB for simulations and a deeper
understanding of the principles of wireless networking.
Quiz:

1. What function is used to generate the network topology?


 The function randomGraph(N, P) generates a random graph.
It takes N (number of nodes) and P (probability of edge creation) as inputs.

2. What communication protocol is used in the simulation?


 The simulation uses the Transmission Control Protocol (TCP).
TCP is a connection-oriented protocol that ensures reliable data transmission.

3. What network parameters are adjustable in the simulation?


 Adjustable parameters include the number of nodes (N) and probability of edge creation
(P).Other parameters are simulation time (T), packet arrival rate (lambda), service rate
(mu), and network capacity (c).

4. What is the purpose of the simulateNetwork function?


 The simulateNetwork function simulates network behavior over time.
It calculates the queue lengths based on packet arrivals and services.

5. How are the results of the simulation visualized in the code?


 Results are visualized using the plot function to show queue length over time.
The x-axis represents time, while the y-axis shows the corresponding queue length.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 2
Generate a binary sequence and simulate its transmission over an AWGN
channel using MATLAB.

Date:

Competency and Practical Skills:


1. Knowledge of digital communication systems and their components.
2. Understanding of channel coding techniques and modulation schemes.
3. Familiarity with the concept of noise and its impact on the signal quality.
4. Knowledge of basic signal processing techniques.
5. Understanding of MATLAB programming for signal processing and
communication systems. Ability to generate binary sequences and apply
modulation schemes using MATLAB.
6. Capability to simulate signal transmission over a noisy channel and analyze the
impact of noise on the signal quality.
7. Proficiency in using MATLAB for signal processing, filtering, and visualization
of results.
8. Skill in optimizing signal processing algorithms for improved performance and
faster simulation times.
9. Ability to interpret simulation results and draw meaningful conclusions about the
performance of the system.

Relevant CO: Understand the basic concepts of cellular system and design requirements.

Objectives:
1. To understand the basics of digital communication systems and their components.
2. To learn about the effects of noise on signal quality and the need for error correction
techniques.
3. To become familiar with different modulation schemes and their performance in noisy
channels.
4. To gain proficiency in using MATLAB for signal processing and communication system
simulations.
5. To analyze the performance of a communication system in terms of bit error rate (BER)
and signal-to-noise ratio (SNR).
6. To optimize the communication system parameters for improved performance and
reliability.

Equipment/Instruments: MATLAB

Theory: Generating a binary sequence and simulating its transmission over an Additive White Gaussian
Noise (AWGN) channel is a fundamental exercise in digital communication systems. The basic idea is to
generate a stream of digital bits that represent information and then apply modulation techniques to map
these bits onto a carrier signal that can be transmitted over a communication channel. In this case, the
communication channel is modeled as an AWGN channel, which is a common model for many wireless
communication scenarios.
The binary sequence is typically generated using a random number generator or by encoding a
message using a channel code such as a block code or convolutional code. The modulated signal
is then transmitted over the AWGN channel, which adds noise to the signal. The amount of noise
depends on the signal-to-noise ratio (SNR) of the channel, which is defined as the ratio of the
signal power to the noise power.
The performance of the communication system can be analyzed in terms of the bit error rate
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
(BER), which is the probability of an error in the received bits due to noise. The BER can be
calculated by comparing the received bits to the transmitted bits and counting the number of
errors.
In MATLAB, the process of generating a binary sequence and simulating its transmission over an
AWGN channel involves several steps, including generating the binary sequence, applying
modulation, simulating the AWGN channel, and calculating the BER. The performance of the
communication system can be analyzed by varying the SNR and observing the effect on the BER.

Procedure:

% Generate binary sequence


bitsPerSymbol = 1;
numBits = 10000;
binaryData = randi([0 1], numBits, bitsPerSymbol);
% Modulate binary sequence with ASK
modulationIndex = 0.5;
carrierFreq = 100; % Carrier frequency in Hz
symbolRate = 10; % Symbols per second
symbolPeriod = 1 / symbolRate; % Time duration for each symbol
t = 0:symbolPeriod:(numBits / symbolRate) - symbolPeriod; % Time vector
carrier = cos(2 * pi * carrierFreq * t); % Carrier signal
modulatedSignal = carrier .* (2 * binaryData - 1) * modulationIndex; % ASK modulation

snr = 10; % Signal-to-noise ratio in dB


signalPower = var(modulatedSignal); % Signal power
noisePower = signalPower / (10^(snr/10)); % Noise power
noise = sqrt(noisePower) * randn(size(modulatedSignal)); % AWGN
receivedSignal = modulatedSignal + noise; % Received signal with noise
demodulatedSignal = receivedSignal ./ carrier; % Coherent demodulation
demodulatedData = demodulatedSignal > 0; % Thresholding to recover bits
numErrors = sum(xor(binaryData, demodulatedData)); % Count errors
ber = numErrors / numBits; % Bit Error Rate
fprintf('BER: %f\n', ber);

In this code, we first generate a binary sequence of length numBits using the randi(R,N)
function. We then modulate the binary sequence with ASK using a carrier frequency of
carrierFreq, a symbol rate of symbolRate, and a modulation index of modulationIndex. Next,
we simulate the transmission over an AWGN channel using the snr parameter to determine the
amount of noise to add to the signal. We demodulate the received signal by dividing by the carrier
signal and then thresholding at zero to recover the binary sequence. Finally, we calculate the BER
by comparing the transmitted binary sequence to the demodulated binary sequence using the xor
function.

Observations:
 Bit Error Rate (BER): The calculated BER indicates the quality of the signal transmission.
A lower BER means better performance in the presence of noise.

Result:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Calculation:
 Signal Power: signalPower = var(modulatedSignal)
 Noise Power: noisePower = signalPower / (10^(snr/10))
 Number of Errors: numErrors = sum(xor(binaryData, demodulatedData))
 BER Calculation: ber = numErrors / numBits

Conclusion:
 The experiment demonstrated how noise impacts the transmission of a binary sequence
over an AWGN channel. The performance of the communication system can be evaluated
using the BER, which provides insights into the effectiveness of the modulation scheme
under noisy conditions.
Quiz:
1. What does the code simulate?
 The code simulates the transmission of a binary sequence over an Additive White
Gaussian Noise (AWGN) channel.

2. What modulation scheme is used in the code?


 The code uses Amplitude Shift Keying (ASK) for modulation.

3. What is the effect of SNR on the BER?


 Generally, as SNR increases, the BER decreases, indicating better signal quality.

4. What is the effect of modulation index on the BER?


 A higher modulation index can improve signal strength but may also increase
susceptibility to noise.

5. What is the effect of symbol rate on the BER?


 A higher symbol rate can lead to increased errors if the channel is not capable of
supporting the data rate due to noise.

6. What is the effect of carrier frequency on the BER?


 The choice of carrier frequency can influence how well the signal propagates and its
susceptibility to noise.

7. How can the BER be further reduced?


 The BER can be reduced by increasing the SNR, using error correction techniques, and
selecting a more robust modulation scheme.

8. What is the advantage of using error correction coding techniques?


 Error correction coding allows the recovery of original data even in the presence of errors,
improving overall system reliability.

9. Can you suggest any other modulation scheme that can be used instead of ASK?
 Other modulation schemes include Frequency Shift Keying (FSK), Phase Shift Keying
(PSK), and Quadrature Amplitude Modulation (QAM).

10. What is the purpose of using the randi() function in the code?
 The randi() function generates a random binary sequence, simulating the digital data to be
transmitted.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 3
Simulate the line coding techniques using MATLAB.

Date:

Competency and Practical Skills:


1. Understanding the basics of digital transmission and line coding techniques.
2. Understanding the different types of line coding techniques, such as unipolar,
polar, and bipolar line codes.
3. Understanding the different types of line codes used in practical applications, such
as Manchester, Differential Manchester, and AMI.
4. Familiarity with MATLAB programming language and its signal processing
toolbox.
5. Ability to generate a digital signal with a given bit pattern.
6. Ability to apply different line coding techniques to the digital signal.
7. Ability to visualize the waveform and power spectrum of the coded signal.

Relevant CO: Design mobile radio propagation model.

Objectives:
The objectives of simulating the line coding techniques using MATLAB are:
1. To understand the basics of digital transmission and line coding techniques.
2. To familiarize with the different types of line coding techniques and their advantages and
disadvantages.
3. To learn the implementation of different line coding techniques using MATLAB.
4. To visualize the waveform and power spectrum of the coded signal.
5. To simulate the effects of channel impairments, such as noise and distortion, on the coded
signal.
6. To evaluate the performance of different line coding techniques in terms of their error
detection and correction capabilities.

Equipment/Instruments: MATLAB

Theory: Line coding is a process of converting a sequence of digital bits into a digital signal
suitable for transmission over a communication channel. In other words, line coding transforms a
sequence of binary data into a waveform that can be transmitted over a physical medium such as
copper wires, fiber-optic cables, or wireless channels.
There are several types of line coding techniques, each with its advantages and disadvantages.
Some of the commonly used line coding techniques include:
1. Non-return-to-zero (NRZ) coding
2. Manchester coding
3. Differential Manchester coding
4. Bipolar encoding
5. Alternate mark inversion (AMI) coding
Each line coding technique has its own unique properties and is suitable for different types of
applications. For example, NRZ coding is simple and efficient but can suffer from DC bias, while
Manchester coding has a balanced DC component but requires a higher bandwidth.
In order to simulate the line coding techniques using MATLAB, we need to generate a sequence
of digital bits and then apply the desired line coding algorithm to it. We can then visualize the
waveform and power spectrum of the coded signal and measure its various parameters such as the
DC component and bandwidth. We can also simulate the effects of channel impairments such as
noise and distortion on the coded signal and evaluate the performance of different line coding
techniques in terms of their error detection and correction capabilities.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Procedure:
% Line Coding Techniques Simulation

% Generate a random binary sequence


bits = randi([0, 1], 1, 100);

% NRZ Line Coding


nrzSignal = 2 * bits - 1;

% Manchester Line Coding


manchesterSignal = [];
for i = 1:length(bits)
if bits(i) == 1
manchesterSignal = [manchesterSignal, 1, -1]; % 1 -> 1, 0
else
manchesterSignal = [manchesterSignal, -1, 1]; % 0 -> 0, 1
end
end

% Differential Manchester Line Coding


diffManchesterSignal = [];
previousLevel = 1; % Initial level
for i = 1:length(bits)
if bits(i) == 1
previousLevel = -previousLevel; % Invert level
diffManchesterSignal = [diffManchesterSignal, previousLevel, previousLevel]; % Same
level
else
diffManchesterSignal = [diffManchesterSignal, previousLevel, -previousLevel]; % Invert
level
end
end

% AMI (Alternate Mark Inversion) Line Coding


amiSignal = [];
previousNonZeroLevel = 1; % Track previous non-zero level
for i = 1:length(bits)
if bits(i) == 1
amiSignal = [amiSignal, previousNonZeroLevel]; % Alternate level for 1
previousNonZeroLevel = -previousNonZeroLevel; % Change level
else
amiSignal = [amiSignal, 0]; % Zero for 0
end
end

% Time Vector for Plotting


t = 0:0.01:(length(bits)-1)*0.01; % Adjust based on bit duration

% Plotting
figure;
subplot(4, 1, 1);
stem(bits, 'LineWidth', 2);
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
title('Original Bits');
xlabel('Bit Index');
ylabel('Bit Value');
ylim([-0.5, 1.5]);

subplot(4, 1, 2);
plot(nrzSignal, 'LineWidth', 2);
title('NRZ Coded Signal');
xlabel('Time Index');
ylabel('Signal Amplitude');
ylim([-1.5, 1.5]);

subplot(4, 1, 3);
plot(manchesterSignal, 'LineWidth', 2);
title('Manchester Coded Signal');
xlabel('Time Index');
ylabel('Signal Amplitude');
ylim([-1.5, 1.5]);

subplot(4, 1, 4);
plot(diffManchesterSignal, 'LineWidth', 2);
title('Differential Manchester Coded Signal');
xlabel('Time Index');
ylabel('Signal Amplitude');
ylim([-1.5, 1.5]);

figure;
plot(amiSignal, 'LineWidth', 2);
title('AMI Coded Signal');
xlabel('Time Index');
ylabel('Signal Amplitude');
ylim([-1.5, 1.5]);

% Display a message indicating completion


disp('Line coding techniques simulation completed.');

This code first generates a random binary sequence of length 100 using the randi function. It then
performs NRZ line coding by mapping each binary bit 0 to -1 and each binary bit 1 to 1.
The coded signal is then plotted using the plot function, and the original binary sequence and the
coded signal are displayed side-by-side using the subplot function.
You can modify this code to simulate other line coding techniques such as Manchester coding or
AMI coding by replacing the line coding algorithm with the desired one

Observations:

1. Original Bits:
 A random sequence of binary bits is generated, consisting of 0s and 1s.
 Example: [1, 0, 1, 1, 0, 0, 1, 0]

2. NRZ Coded Signal:


 The NRZ signal represents 1 as +1 and 0 as -1.
 The amplitude transitions reflect the bits directly, showing long stretches of constant
amplitude.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
 Example: For the bits [1, 0, 1, 1], the NRZ signal would be [1, -1, 1, 1].

3. Manchester Coded Signal:


 Each bit is represented by two transitions:
o A 1 is represented as a high-to-low transition,
o A 0 as a low-to-high transition.
 Example: For the bits [1, 0, 1], the Manchester signal would look like [-1, 1, -1, -1, 1].

4. Differential Manchester Coded Signal:


 The signal begins with an initial level and alternates with every 1.
 A 0 maintains the previous level while a 1 changes it.
 Example: For bits [1, 0, 1], the signal may look like [1, -1, -1, 1].

5. AMI Coded Signal:


 In AMI coding, 1s are represented by alternating positive and negative voltages, and 0s are
represented by zero voltage.
 Example: For bits [1, 0, 1], the AMI signal might be [1, 0, -1, 0, 1].

Calculation:

1. DC Component Calculation:
 The DC component can be calculated as the mean of the coded signal.
 For example, for the NRZ signal, if the bits are [1, 0, 1], the NRZ coded signal is [1, -1, 1],
and the DC component can be calculated as:
 DCNRZ= (1+(-1) +1)/3 = 1/3 = 0.33

2. Bandwidth Calculation:
 The required bandwidth for each line code can be estimated:
o NRZ: 1/T
o Manchester: 2/T
o Differential Manchester: 2/T
o AMI: Similar to NRZ, 1/T

3. Power Spectra:
 The power spectrum of each line-coded signal can be computed using the Fourier
Transform. This can reveal the frequency components present in each signal.

Result:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Conclusion:

 The simulation of line coding techniques using MATLAB successfully demonstrated the
differences between various coding schemes.
 NRZ is simple but can lead to DC bias, while Manchester and Differential Manchester
coding offer better synchronization and balance but require more bandwidth.
 The AMI coding technique effectively mitigates DC bias by alternating the signal levels,
making it suitable for applications where power efficiency is critical.
 Overall, understanding these techniques is crucial for designing efficient digital
communication systems, and MATLAB proves to be an effective tool for visualizing and
analysing these coding methods.

Quiz:

1. What is line coding, and why is it necessary in digital communication systems?


 Line coding transforms digital data into a format suitable for transmission, ensuring
reliable communication over various media.

2. What are the different types of line coding techniques used in digital communication
systems?
 NRZ, Manchester, Differential Manchester, Bipolar (AMI), etc.

3. What is the difference between polar NRZ and polar RZ line coding techniques?
 NRZ uses two levels without returning to zero for 0 bits, while RZ returns to zero during
each bit interval.

4. What are the advantages and disadvantages of using bipolar line coding techniques?
 Advantages include DC balance and error detection; disadvantages include increased
bandwidth requirements.

5. How can you simulate line coding techniques using MATLAB, and what are the different
parameters that you can analyze?
 By generating a binary sequence and applying coding techniques, we can analyze the
waveform, power spectrum, and effects of noise and distortion.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 4
Simulate the Binary amplitude shift keying using MATLAB and simulink.

Date:

Competency and Practical Skills:


1. Understand the concepts of binary amplitude shift keying (BASK) modulation and
demodulation.
2. Develop skills in using MATLAB and Simulink for digital communication system
simulations.
3. Analyze the performance of BASK in terms of bit error rate (BER) and signal-to-noise
ratio (SNR).
4. Setting up BASK modulation and demodulation blocks in Simulink
5. Generating random binary data for simulation
6. Measuring bit error rate (BER) and signal-to-noise ratio (SNR)

Relevant CO: Design mobile radio propagation model.

Objectives:
1. To learn about the principles of BASK modulation and demodulation
2. To simulate a BASK communication system using MATLAB and Simulink
3. To analyze the system's performance in terms of bit error rate (BER) and signal-to-noise
ratio (SNR)

Equipment/Instruments: MATLAB,SIMULINK

Theory: Binary amplitude shift keying (BASK), also known as on-off keying (OOK), is a simple
digital modulation technique where the amplitude of the carrier wave is switched between two
levels, depending on the input binary data. In BASK, a binary '1' is represented by the presence of
the carrier wave, while a binary '0' is represented by the absence of the carrier wave.
The BASK modulator can be represented by the following equation:
s(t) = A * d(t) * cos(2 * pi * f_c * t)
where:
 s(t) is the modulated signal
 A is the amplitude of the carrier wave
 d(t) is the binary data input (either 0 or 1)
 f_c is the carrier frequency
 t is time
The BASK demodulator uses an envelope detector or a synchronous detector followed by a
decision-making circuit, which compares the received signal with a threshold value to determine
the transmitted binary data.
In this lab, you will simulate a BASK communication system using MATLAB and Simulink, and
analyze its performance in terms of bit error rate (BER) and signal-to-noise ratio (SNR).

Safety and necessary Precautions: NA


Procedure:

1. Launch MATLAB and open Simulink: 1.1. Start MATLAB and type "simulink" in the
Command Window, then press Enter to open the Simulink Library Browser.
2. Create a new Simulink model: 2.1. In the Simulink Library Browser, click "New" in the
toolbar or go to File > New > Model to create a new Simulink model.
3. Add necessary blocks to the model:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
3.1. In the Simulink Library Browser, navigate to Simulink > Sources and add the
following blocks to your model: - "Random Integer Generator" (to generate
binary data) - "Repeating Sequence Stair" (to create a clock signal)
3.2. Navigate to Simulink > Sinks and add the following blocks: - "Scope" (to visualize
signals) - "Error Rate Calculation" (to calculate the bit error rate)
3.3. Navigate to Communications Toolbox > Modulation > General Modulation
Techniques and add the following blocks: - "Rectangular Pulse" (to create a
baseband rectangular pulse) - "Amplitude Modulator Baseband" (to perform
BASK modulation) 3.4. Navigate to Communications Toolbox >
Synchronization and add the following block: - "Buffer" (to buffer the
demodulated signal)
3.5. Navigate to Communications Toolbox > Modulation > General Demodulation
Techniques and add the following block: - "Envelope Detector" (to perform
BASK demodulation)
4. Configure the blocks:
4.1. Double-click the "Random Integer Generator" block and set the following
parameters: - M-ary number: 2 - Sample time: 1
4.2. Double-click the "Repeating Sequence Stair" block and set the following
parameters: - Vector of output values: [0 1] - Vector of time steps: [0 1]
4.3. Double-click the "Rectangular Pulse" block and set the Pulse width to 1.
4.4. Double-click the "Amplitude Modulator Baseband" block and set the following
parameters: - Modulation index: 1 - Carrier amplitude: 1
4.5. Double-click the "Buffer" block and set the following parameters: - Buffer size: 1
- Buffer overlap: 0
4.6. Double-click the "Envelope Detector" block and set the following parameters: -
Sample time: 1 - Time constant: 0.1
5. Connect the blocks:
5.1. Connect the output of the "Random Integer Generator" block to the input of the
"Rectangular Pulse" block.
5.2. Connect the output of the "Rectangular Pulse" block to the input of the
"Amplitude Modulator Baseband" block.
5.3. Connect the output of the "Amplitude Modulator Baseband" block to the input of
the "Envelope Detector" block.
5.4. Connect the output of the "Envelope Detector" block to the input of the "Buffer"
block.
5.5. Connect the output of the "Random Integer Generator" block to the "Original"
input of the "Error Rate Calculation" block.
5.6. Connect the output of the "Buffer" block to the "Received" input of the "Error
Rate

Result:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Observations:

 Simulated Data: Generate random binary data and measure the performance in terms of
BER and SNR.

Conclusion:

 The BASK modulation technique demonstrates its capability to represent binary data
effectively.
 The performance analysis indicates that as the SNR increases, the BER decreases,
confirming that BASK is suitable for scenarios with adequate signal strength.
 While BASK is simple, it is susceptible to noise, and thus careful consideration is needed
when deploying it in noisy environments.

Quiz:

1. What does BASK stand for, and what is another name for this modulation technique?
 Binary Amplitude Shift Keying; another name is On-Off Keying (OOK).

2. What is the primary characteristic of a BASK modulated signal with respect to the input
binary data?
 A binary '1' is represented by the presence of the carrier wave, while a binary '0' is
represented by the absence of the carrier wave.

3. How does the envelope detector work in the demodulation process of BASK?
 The envelope detector extracts the amplitude of the received signal and compares it with a
threshold to determine the transmitted binary data.

4. What parameters can be used to assess the performance of a BASK communication


system?
 Bit Error Rate (BER) and Signal-to-Noise Ratio (SNR).

5. How does the addition of noise (using an AWGN Channel block) affect the performance
of a BASK communication system in terms of bit error rate (BER) and signal-to-noise
ratio (SNR)?
 Adding noise increases the BER, leading to a lower SNR, which indicates poorer
performance of the communication system.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
6. What are the advantages and disadvantages of using BASK as a modulation technique in
digital communication systems?

 Advantages: Simple implementation, efficient for low data rates.


 Disadvantages: Susceptible to noise, less efficient in bandwidth compared to other
modulation schemes.

7. How can the performance of a BASK communication system be improved by adjusting


the system parameters or employing different techniques?
 Performance can be improved by increasing the carrier amplitude, utilizing error
correction techniques, or using more sophisticated modulation schemes like QAM.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 5
Simulate the Binary phase shift keying using MATLAB and simulink.

Date:

Competency and Practical Skills:


1. Understand the concepts of binary phase shift keying (BPSK) modulation and
demodulation
2. Develop skills in using MATLAB and Simulink for digital communication system
simulations
3. Analyze the performance of BPSK in terms of bit error rate (BER) and signal-to-noise
ratio (SNR)
4. Setting up BPSK modulation and demodulation blocks in Simulink
5. Generating random binary data for simulation
6. Measuring bit error rate (BER) and signal-to-noise ratio (SNR)
7. Visualizing and interpreting simulation results

Relevant CO: Design mobile radio propagation model.

Objectives:
1. To learn about the principles of BPSK modulation and demodulation
2. To simulate a BPSK communication system using MATLAB and Simulink
3. To analyze the system's performance in terms of bit error rate (BER) and signal-to-noise
ratio (SNR)

Equipment/Instruments: MATLAB,SIMULINK

Theory: Binary Phase Shift Keying (BPSK) is a digital modulation technique where the phase of
the carrier wave is switched between two values, depending on the input binary data. In BPSK, a
binary '1' is represented by one phase value of the carrier wave, while a binary '0' is represented
by another phase value (usually shifted by 180 degrees).
The BPSK modulator can be represented by the following equation:
s(t) = A * cos(2 * pi * f_c * t + (2 * d(t) - 1) * pi)
where:
 s(t) is the modulated signal
 A is the amplitude of the carrier wave
 d(t) is the binary data input (either 0 or 1)
 f_c is the carrier frequency
 t is time
The BPSK demodulator uses a coherent detector, which multiplies the received signal by a local
replica of the carrier, followed by low-pass filtering and decision-making circuitry to determine
the transmitted binary data.
In this lab, you will simulate a BPSK communication system using MATLAB and Simulink and
analyze its performance in terms of bit error rate (BER) and signal-to-noise ratio (SNR).

Safety and necessary Precautions: NA


Procedure:

1. Launch MATLAB and open Simulink:


1.1. Start MATLAB and type "simulink" in the Command Window, then press Enter to
open the Simulink Library Browser.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
2. Create a new Simulink model:
2.1. In the Simulink Library Browser, click "New" in the toolbar or go to File > New >
Model to create a new Simulink model.
3. Add necessary blocks to the model:
3.1. In the Simulink Library Browser, navigate to Simulink > Sources and add the
following blocks to your model: - "Random Integer Generator" (to generate binary
data)
3.2. Navigate to Simulink > Sinks and add the following blocks: - "Scope" (to
visualize signals) - "Error Rate Calculation" (to calculate the bit error rate)
3.3. Navigate to Communications Toolbox > Modulation > Digital Baseband
Modulation and add the following block: - "PSK Modulator Baseband" (to perform
BPSK modulation)
3.4. Navigate to Communications Toolbox > Modulation > Digital Baseband
Demodulation and add the following block: - "PSK Demodulator Baseband" (to
perform BPSK demodulation)
4. Configure the blocks:
4.1. Double-click the "Random Integer Generator" block and set the following
parameters: - M-ary number: 2 - Sample time: 1
4.2. Double-click the "PSK Modulator Baseband" block and set the following
parameters: - M-ary number: 2 - Phase offset (rad): 0 - Symbol period: 1
4.3. Double-click the "PSK Demodulator Baseband" block and set the following
parameters: - M-ary number: 2 - Phase offset (rad): 0 - Symbol period: 1
5. Connect the blocks:
5.1. Connect the output of the "Random Integer Generator" block to the input of the
"PSK Modulator Baseband" block.
5.2. Connect the output of the "PSK Modulator Baseband" block to the input of the
"PSK Demodulator Baseband" block.
5.3. Connect the output of the "Random Integer Generator" block to the "Original"
input of the "Error Rate Calculation" block.
5.4. Connect the output of the "PSK Demodulator Baseband" block to the "Received"
input of the "Error Rate Calculation" block.
6. Run the simulation:
6.1. Adjust the simulation stop time and other settings as needed in the Simulink model
window.
6.2. Click the "Run" button in the toolbar to start the simulation.
7. Visualize and analyze the results:
7.1. Use the "Scope" blocks to visualize the input binary data, modulated signal, and
demodulated signal.
7.2. Connect a "Display" block to the output of the "Error Rate Calculation" block to
show the calculated BER.

Observations:

 input Binary Data: The binary data generated by the "Random Integer Generator" appears
as a series of 0s and 1s.
 Modulated Signal: The output of the "PSK Modulator Baseband" block shows the phase-
shifted signal corresponding to the input binary data. For each bit, the phase of the carrier
shifts by 180 degrees.
 Demodulated Signal: The output of the "PSK Demodulator Baseband" block recovers the
original binary data.
 Bit Error Rate (BER): The "Error Rate Calculation" block calculates the number of bit
errors by comparing the original and received signals. If no noise is introduced, BER
should be 0.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Result:

Conclusion:

 The BPSK modulation and demodulation system was successfully simulated using
MATLAB and Simulink.
 Without noise, BPSK modulation offers a very low bit error rate, with the demodulator
correctly recovering the binary data.
 The system’s performance degrades with the introduction of noise, as observed through
increased bit error rates (BER) at lower SNR levels.
 This experiment demonstrates the principles of BPSK and the effects of noise on digital
communication systems.

Quiz:

1. What does BPSK stand for, and what are the key characteristics of a BPSK modulated
signal?
 BPSK stands for Binary Phase Shift Keying. Key characteristics of a BPSK modulated
signal include:
 It modulates binary data by shifting the phase of a carrier signal.
 A binary '1' is represented by one phase, and a binary '0' by a phase shift of 180
degrees.
 It is robust to noise but has a lower data rate compared to higher-order modulation
schemes.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
2. What is the primary difference between BPSK and BASK modulation techniques in terms
of their representation of binary data?
 BPSK represents binary data by shifting the phase of the carrier signal.
 BASK (Binary Amplitude Shift Keying) represents binary data by changing the amplitude
of the carrier signal.

3. How does the coherent detector in the BPSK demodulation process work?
 A coherent detector in BPSK demodulation multiplies the received signal with a
synchronized version of the carrier signal. It then uses a low-pass filter to recover the
original binary data by detecting phase differences in the received signal.

4. What parameters can be used to assess the performance of a BPSK communication


system?
 The key parameters used to assess the performance of a BPSK system include:
 Bit Error Rate (BER): Measures the rate of errors in the transmitted bits.
 Signal-to-Noise Ratio (SNR): The ratio of the signal power to the noise power.

5. How does the addition of noise (using an AWGN Channel block) affect the performance
of a BPSK communication system in terms of bit error rate (BER) and signal-to-noise ratio
(SNR)?
 The addition of noise using an AWGN channel increases the BER, as noise introduces
errors in the received signal. As the SNR decreases (i.e., the signal power becomes
comparable to or less than the noise power), the BER increases, indicating a degradation in
the system's performance.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 6
Simulate the Delta Modulation using MATLAB and simulink.

Date:

Competency and Practical Skills:


1. Understand the concepts of delta modulation (DM) and its application in digital
communication systems
2. Develop skills in using MATLAB and Simulink for simulating delta modulation systems
3. Analyze the performance of delta modulation in terms of signal reconstruction and
quantization noise
4. Setting up delta modulation and demodulation blocks in Simulink
5. Generating input signals for simulation
6. Measuring signal reconstruction error and quantization noise

Relevant CO: Differentiate multiple access techniques.

Objectives:
1. To learn about the principles of delta modulation and demodulation
2. To simulate a delta modulation communication system using MATLAB and Simulink
3. To analyze the system's performance in terms of signal reconstruction and quantization
noise

Equipment/Instruments: MATLAB,SIMULINK

Theory: Delta modulation (DM) is a simple form of differential pulse-code modulation (DPCM)
used in digital communication systems. It encodes an analog input signal into a binary output by
comparing the current input sample with the previous input sample. If the current sample is
greater than the previous sample, a binary '1' is generated; otherwise, a binary '0' is produced.
The DM modulator can be represented by the following equations:
Δx[n] = x[n] - x[n-1] y[n] = 1, if Δx[n] ≥ 0 y[n] = 0, if Δx[n] < 0
where:
 x[n] is the input signal
 Δx[n] is the difference between consecutive input samples
 y[n] is the binary output
The DM demodulator reconstructs the original signal using the binary output and a step size. It
accumulates the step size for each binary '1' and subtracts the step size for each binary '0':
x'[n] = x'[n-1] + step_size, if y[n] = 1 x'[n] = x'[n-1] - step_size, if y[n] = 0
where:
 x'[n] is the reconstructed signal
In this lab, you will simulate a delta modulation communication system using MATLAB and
Simulink and analyze its performance in terms of signal reconstruction and quantization noise.

Safety and necessary Precautions: NA


Procedure:
1. Launch MATLAB and open Simulink:
1.1. Start MATLAB and type "simulink" in the Command Window, then press Enter to
open the Simulink Library Browser.
2. Create a new Simulink model:
2.1. In the Simulink Library Browser, click "New" in the toolbar or go to File > New >
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Model to create a new Simulink model.
3. Add necessary blocks to the model:
3.1. In the Simulink Library Browser, navigate to Simulink > Sources and add the
following blocks to your model: - "Sine Wave" (to generate the input analog signal)
3.2. Navigate to Simulink > Sinks and add the following blocks: - "Scope" (to
visualize signals)
3.3. Navigate to DSP System Toolbox > Signal Operations and add the following
block: - "Delta Modulator" (to perform delta modulation)
3.4. Navigate to DSP System Toolbox > Signal Operations and add the following
block: - "Delta Demodulator" (to perform delta demodulation)
4. Configure the blocks:
4.1. Double-click the "Sine Wave" block and set the following parameters: -
Amplitude: 1 - Frequency: 10 - Sample time: 0.001
4.2. Double-click the "Delta Modulator" block and set the following parameters: - Step
size: Adjust to an appropriate value (e.g., 0.1)
4.3. Double-click the "Delta Demodulator" block and set the following parameters: -
Step size: Use the same value as in the "Delta Modulator" block
5. Connect the blocks:
5.1. Connect the output of the "Sine Wave" block to the input of the "Delta Modulator"
block.
5.2. Connect the output of the "Delta Modulator" block to the input of the "Delta
Demodulator" block.
5.3. Connect the output of the "Sine Wave" block to one input of a "Scope" block (to
visualize the input signal).
5.4. Connect the output of the "Delta Demodulator" block to another input of the
"Scope" block (to visualize the reconstructed signal).
6. Run the simulation:
6.1. Adjust the simulation stop time and other settings as needed in the Simulink model
window.
6.2. Click the "Run" button in the toolbar to start the simulation.
7. Visualize and analyze the results:
7.1. Use the "Scope" block to visualize the input analog signal and the reconstructed
signal after delta modulation and demodulation.
7.2. Observe the signal reconstruction quality and the quantization noise present in the
reconstructed signal.
7.3. Experiment with different step sizes in the "Delta Modulator" and "Delta
Demodulator" blocks to observe their effects on the signal reconstruction and
quantization noise.

Observations:

 During the simulation, the original sine wave signal and the reconstructed signal after
demodulation were visualized using the "Scope" block.
 The reconstructed signal closely followed the original input signal when the step size was
appropriately chosen.
 As the step size increased, quantization noise became more noticeable, affecting the
quality of signal reconstruction.
 When the step size was too small, the reconstructed signal lagged behind the input signal,
leading to tracking errors.
 With a moderate step size, the system provided a good balance between signal tracking
and noise suppression.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Result:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)

Conclusion:

 Delta modulation is a useful technique for encoding analog signals into binary data,
especially in applications requiring low bandwidth and low complexity.
 The performance of delta modulation is highly dependent on the step size, which must be
chosen carefully to minimize signal distortion and quantization noise.
 Simulating delta modulation using MATLAB and Simulink provides a practical way to
understand the trade-offs between signal fidelity and noise in digital communication
systems.

Quiz:

1. modulation techniques like BPSK and BASK?


 Delta modulation (DM) is different from BPSK and BASK because it encodes the
difference between successive samples of the input signal, whereas BPSK and BASK
directly modulate the carrier signal using the binary data. BPSK modulates the phase of
the carrier, while BASK modulates the amplitude. DM focuses on tracking the changes in
the input signal, making it more suitable for slowly varying signals but potentially
introducing quantization noise.

2. How do the delta modulation and demodulation processes work, and what are the key
equations that describe these processes?
 In delta modulation, the difference between consecutive input samples
Δx[n]=x[n]−x[n−1]\Delta x[n] = x[n] - x[n-1]Δx[n]=x[n]−x[n−1] is calculated. A binary '1'
is generated if the current sample is greater than the previous sample, otherwise, a binary
'0' is generated. During demodulation, the reconstructed signal x′[n]x'[n]x′[n] is updated by
adding or subtracting a step size, depending on the binary data received.

3. What is the role of the step size in delta modulation, and how does it affect the signal
reconstruction and quantization noise?
 The step size controls how closely the modulator and demodulator follow the input signal.
A larger step size allows the system to track faster changes in the signal but increases
quantization noise. A smaller step size reduces quantization noise but may result in the
system being unable to keep up with rapid changes in the signal, leading to tracking errors.

4. How can you adjust the step size in the Simulink model to achieve better signal
reconstruction and minimize quantization noise?
 You can adjust the step size by experimenting with different values in the "Delta
Modulator" and "Delta Demodulator" blocks. A moderate step size that matches the rate of
change of the input signal generally provides the best trade-off between accurate signal
tracking and minimal quantization noise. It can be increased or decreased depending on the
frequency and amplitude of the input signal.

5. In the simulation, what types of input signals can be used to test the performance of the
delta modulation system?
 Sine waves to observe how well the system tracks smooth, periodic changes.
 Square waves to see how the system handles sharp transitions.
 Triangular waves for testing how it performs with linear changes.
 Random noise to test the system’s performance in the presence of unpredictable inputs.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
6. What are the advantages and disadvantages of using delta modulation in digital
communication systems compared to other modulation techniques?

 Advantages:
 Simple implementation compared to more complex techniques like PCM (Pulse Code
Modulation).
 Requires lower bandwidth since it transmits fewer bits compared to PCM.
 Disadvantages:
 Prone to slope overload distortion if the signal changes faster than the modulator can track.
 Quantization noise can be higher, especially with small step sizes.
 Limited to slowly varying signals, making it less suitable for high-frequency components.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 7
Simulate the Direct sequence spread spectrum using MATLAB and simulink.

Date:

Competency and Practical Skills:


1. Understand the concepts of direct sequence spread spectrum (DSSS) and its application in
digital communication systems
2. Develop skills in using MATLAB and Simulink for simulating DSSS systems
3. Analyze the performance of DSSS in terms of signal processing gain, interference
rejection, and multiple access capability
4. Setting up DSSS modulation and demodulation blocks in Simulink
5. Generating input signals and pseudorandom noise (PN) sequences for simulation
6. Measuring signal-to-interference ratio (SIR) and signal-to-noise ratio (SNR)

Relevant CO: Differentiate multiple access techniques.

Objectives:
1. To learn about the principles of direct sequence spread spectrum (DSSS) modulation and
demodulation
2. To simulate a DSSS communication system using MATLAB and Simulink
3. To analyze the system's performance in terms of signal processing gain, interference
rejection, and multiple access capability

Equipment/Instruments: MATLAB,SIMULINK

Theory: Direct Sequence Spread Spectrum (DSSS) is a digital modulation technique that spreads
a narrowband signal across a wide frequency band using a pseudorandom noise (PN) sequence.
This technique provides various benefits, such as signal processing gain, interference rejection,
and multiple access capability.
In DSSS modulation, the input data bits are multiplied by the PN sequence, effectively spreading
the signal's bandwidth. The modulated signal can then be transmitted using traditional modulation
techniques, such as BPSK, QPSK, or others.
The DSSS demodulation process requires the same PN sequence as used in the modulation. The
received signal is multiplied by the PN sequence to despread the signal, and then the original data
bits are extracted using a correlator or matched filter.
In this lab, you will simulate a DSSS communication system using MATLAB and Simulink and
analyze its performance in terms of signal processing gain, interference rejection, and multiple
access capability.

Safety and necessary Precautions: NA


Procedure:
1. Open MATLAB and Simulink.
2. Create a new Simulink model.
3. Add necessary blocks to the model such as "Random Integer Generator" (to generate
binary data), "Scope" (to visualize signals), "Error Rate Calculation" (to calculate the bit
error rate), "PN Sequence Generator" (to generate the pseudorandom noise sequence),
"PSK Modulator Baseband" (to perform BPSK modulation), "PSK Demodulator
Baseband" (to perform BPSK demodulation), and "Product" blocks from the Simulink >
Math Operations library to perform multiplication for the spreading and despreading
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
processes.
4. Configure the blocks by setting the appropriate parameters such as M-ary number,
polynomial, initial states, samples per frame, phase offset (rad), and symbol period.
5. Connect the blocks by connecting the output of the "Random Integer Generator" block to a
"Product" block for spreading the data with the PN sequence, connecting the output of the
"PN Sequence Generator" block to the same "Product" block for spreading, connecting the
output of the "Product" block (spreading) to the input of the "PSK Modulator Baseband"
block, connecting the output of the "PSK Modulator Baseband" block to the input of the
"PSK Demodulator Baseband" block, connecting the output of the "PSK Demodulator
Baseband" block to a "Product" block for despreading the data with the PN sequence,
connecting the output of the "PN Sequence Generator" block to the same "Product" block
for despreading, and connecting the output of the "Product" block (despreading) to the
"Received" input of the "Error Rate Calculation" block.
6. Run the simulation and observe the results in the "Scope" block and "Error Rate
Calculation" block.
7. Analyze the performance of the DSSS system in terms of signal processing gain,
interference rejection, and multiple access capability by measuring the signal-to-noise
ratio (SNR), signal-to-interference ratio (SIR), and bit error rate (BER).
8. Adjust the parameters of the DSSS system to improve its performance, such as increasing
the length of the PN sequence, adjusting the data rate, or implementing coding techniques.
9. Save the simulation and results for future reference.

Observations:
1. Bit Error Rate (BER):
o Observed BER values after simulating various SNR conditions, indicating the
number of errors in the received signal relative to the total number of transmitted
bits.
o Example: At SNR = 10 dB, BER = 0.02 (2% error rate).
2. Signal-to-Noise Ratio (SNR):
o The calculated SNR values for the transmitted signal under different noise
conditions.
o Example: For an average power of the signal of 1, and noise power of 0.1, the SNR
= 10 dB.
3. Signal-to-Interference Ratio (SIR):
o Measured SIR values which show the effectiveness of the DSSS system in
rejecting interference.
o Example: SIR observed at various points, such as 15 dB indicating a good
performance against interference.

Result:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Conclusion:

 The simulation of the DSSS system using MATLAB and Simulink successfully
demonstrated the principles of spreading and despreading in digital communication
systems.
 Key findings:
 Increased SNR leads to reduced BER, confirming the effectiveness of DSSS in
combating noise.
 The system exhibited good interference rejection capabilities, as indicated by
satisfactory SIR values.
 DSSS shows potential for multiple access communications due to its ability to
operate with different PN sequences for various users.
 Future work may include further optimizations and real-world simulations to
analyze the practical implications of DSSS in various communication
environments.

Quiz:

1. What is Direct Sequence Spread Spectrum (DSSS), and how does it work?
 Direct Sequence Spread Spectrum (DSSS) is a modulation technique used in digital
communication systems that spreads a narrowband signal over a wide frequency band. It
works by multiplying the data signal with a pseudorandom noise (PN) sequence, which
increases the bandwidth of the transmitted signal. The use of a PN sequence helps in
reducing the effects of interference and improves the system's capability to reject
jamming.

2. What is the advantage of using DSSS in digital communication systems?


 Interference rejection: DSSS is resilient to narrowband interference, allowing the system
to maintain signal integrity.
 Multiple access capability: DSSS can support multiple users simultaneously without
interference, as each user can use a unique PN sequence for spreading.
 Improved security: The spread spectrum technique makes it difficult for unauthorized
users to intercept or jam the signal.
 Robustness against multipath fading: DSSS can improve signal quality in environments
with multiple signal paths.
3. What are the key components of a DSSS system, and how do they work together?
 Data Source: Generates the input data (binary data) to be transmitted.
 PN Sequence Generator: Produces the pseudorandom noise sequence that is used to spread
the data signal.
 Modulator: Combines the data signal with the PN sequence to create a spread spectrum
signal (e.g., BPSK modulator).
 Channel: The medium through which the spread signal is transmitted, which may
introduce noise or interference.
 Demodulator: Despreads the received signal using the same PN sequence to retrieve the
original data.
 Error Rate Calculation Block: Analyzes the performance by comparing the transmitted
data with the received data to calculate the Bit Error Rate (BER).
4. What is a pseudorandom noise (PN) sequence, and how is it used in DSSS?
 A pseudorandom noise (PN) sequence is a sequence of binary values that appears random
but is generated deterministically using a specific algorithm. In DSSS, the PN sequence is
used to modulate the input data by multiplying the data bits with the PN sequence,
effectively spreading the signal over a broader bandwidth. The receiver uses the same PN
sequence to despread the signal, allowing for the recovery of the original data.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
5. How do you generate a PN sequence in MATLAB and Simulink?
 In MATLAB and Simulink, a PN sequence can be generated using the "PN Sequence
Generator" block. This block allows you to configure parameters such as the polynomial
for generating the sequence, initial states, and the length of the sequence. The generated
PN sequence can then be used for modulation in a DSSS system.

6. What is the role of the "Random Integer Generator" block in the Simulink model, and how
is it configured?
 The "Random Integer Generator" block in the Simulink model is used to generate a
sequence of random integers that represent binary data (0s and 1s). This block can be
configured by setting parameters such as the minimum and maximum values (for binary
data, this would be 0 and 1) and the sample time, which defines the rate at which the
random data is generated. This generated data is then fed into the spreading process in the
DSSS system.

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Experiment No: 8
Simulate WSN node to determine position on node and blink LED using cupcarbon
simulator and senscript.

Date:

Competency and Practical Skills:


This practical is expected to develop the following skills for the industry identified competency
“Maintain Wireless and Mobile Network”.
1. Use Cupcarbon Simulator.

Relevant CO: Compare various wireless communication systems and networks.

Objectives:
The objective of this experiment is to simulate a Wireless Sensor Network (WSN) node using
CupCarbon simulator and Senscript language. The WSN node will be used to determine its
position and blink LED.
Equipment/Instruments: MATLAB,SIMULINK

Theory: Wireless Sensor Networks (WSNs) are one of the fastest growing control and monitoring
technologies in recent years. According to Kumbhar et al., WSNs are destined to be one of the 10
technologies that will change the world and the foreseen future is impregnated by WSNs powered
by batteries that will monitor our environment and even us. WSNs are composed by a set of
spatially distributed sensors that are capable of collecting, storing and processing environmental
information. Although in their beginnings they were connected by wires, nowadays, WSNs are
wirelessly connected with other nodes for communicating and transmitting the collected data. In
this sense, the application field of this technology is very broad and can be applied in different
areas.

Safety and necessary Precautions: NA


Procedure:
1. Create New Project
Click : Project -> New Project Give any Project Name (Example : WN1)
2. Select Sensor Node Click : Nodes -> Add sensor
3. Create scripts
Click : Simulation -> Communication script
Give a file name (Example : dispose)
The Senscript to display positions is as below :
loop
getpos x
println $x
delay 500
4. Script assignment: Device parameters]
Assign the script of each sensor.
Select a sensor and then click on the item Device parameters in the menu nodes. Once the
device parameter window is opened, click on Enter to display its Parameters. Select the
corresponding script in the list(Example : dispose) of the Script file and then click on the
button (blue arrow) in the right part.
5. Create New Project
6. Click : Project -> New Project
7. Give any Project Name (Different From previous)(Example : WN2)
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Select Sensor Node
8. Click : Nodes ->Add sensor
Create scripts
9. Click : Simulation -> Communication script
Give a suitable Filename (Example : blinkled1)
The Senscript to display positions is as below :
loop
mark 1
delay 1000
mark 0
delay 1000
10. Script assignment: Device parameters
• Assign the script of each sensor.
• Select a sensor and then click on the item Device parameters in the menu nodes.
• Once the device parameter window is opened, click on Enter to display its parameters.
• Select the corresponding script in the list of the Script file and then click on the button
(blue arrow) in the right part.
11. Simulate
 Open the simulation window: Simulation -> WSN Simulation

Observations:
Position(X,Y): As the simulation runs, note the position coordinates printed on the console.

Result:

Conclusion:

In this practical experiment, we successfully simulated a Wireless Sensor Network (WSN) node
using the CupCarbon simulator and the Senscript programming language. By following the
outlined procedures, we created a WSN project, added sensor nodes, and implemented scripts to
determine node positions and control an LED's blinking behavior.

The experiment highlighted the importance of Wireless Sensor Networks in various applications,
including environmental monitoring and smart city solutions. It demonstrated how CupCarbon
serves as an effective tool for modeling and simulating WSNs, providing a user-friendly interface
for designing network topologies and visualizing node interactions.
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
Quiz:

1. What is a Wireless Sensor Network (WSN), and what are its applications?
 A Wireless Sensor Network (WSN) is a network of spatially distributed sensor nodes that
collect, process, and transmit environmental data wirelessly. Applications of WSNs
include environmental monitoring (like temperature, humidity, and pollution), agriculture
(crop monitoring and precision farming), healthcare (patient monitoring), smart cities
(traffic management), and military surveillance.

2. What is CupCarbon simulator, and how is it used in simulating WSN nodes?


 CupCarbon is a software simulator designed for modeling and simulating Wireless Sensor
Networks. It allows users to create sensor nodes, define their behaviors using Senscript,
visualize network topologies, and analyze network performance. CupCarbon provides a
graphical interface for designing WSNs and simulating their operation, including the
collection and transmission of data.

3. What is Senscript, and how is it used in programming WSN nodes?


 Senscript is a scripting language specifically designed for programming the behavior of
nodes in a Wireless Sensor Network within the CupCarbon simulator. It allows users to
write scripts that define actions for nodes, such as collecting data, communicating with
other nodes, and controlling physical components like LEDs. Senscript is used to
implement functionality like retrieving node positions and blinking LEDs as demonstrated
in this experiment.

4. What are the steps involved in setting up a simulation environment using CupCarbon
simulator?
 Create a new project.
 Add sensor nodes to the project.
 Create communication scripts using Senscript.
 Assign scripts to the respective sensor nodes.
 Configure device parameters as needed.
 Start the simulation to observe the behavior of the network.

5. How do you create a WSN node and its network topology using CupCarbon simulator?
 To create a WSN node in CupCarbon, you add a sensor node from the Nodes menu. You
can define the node’s position and attributes. For network topology, you can arrange
multiple nodes within the project workspace, ensuring they are appropriately positioned
relative to one another to reflect the desired network layout (e.g., star, mesh).

6. What are some functions provided by Senscript for controlling the behavior of WSN
nodes?
 getpos: Retrieves the node’s position.
 println: Prints messages or data to the console.
 mark: Controls the state of physical components like LEDs (turning them on or off).
 delay: Pauses the script execution for a specified time.
 loop: Repeats the enclosed script block indefinitely.

7. How do you program a WSN node using Senscript to determine its position and blink an
LED?
 Use the getpos function to obtain the node’s position and the println function to output
it.
 For blinking the LED, use the mark function to toggle the LED state (1 for ON, 0 for OFF)
with delay commands to control the timing. The scripts would look like:
Wireless Communication (3171608) Enrollment No:210160116005(IT-A1)
loop
getpos x
println $x
delay 500

and

Copy code
loop
mark 1
delay 1000
mark 0
delay 1000

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

You might also like