Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

CT111 Lab Report

Name : Poriya Neel Dharmeshbhai


Student ID : 202001139
Lab No. : 1
Date : 25/03/2021

I, Neel Poriya, ID : 202001139, declare that


1. The work that I am presenting is my own work.
2. I have not copied the work (Matlab code, results, etc.) that someone else has done.
3. Concepts, understanding and insights I will be describing are my own.
4. Whenever I have relied on an existing work that is not my own, I have provided a proper
reference citation.
5. I make this pledge truthfully. I know that violation of this solemn pledge can carry grave
consequences.

Information Theory
In the year 1948, Claude Shannon came up his model of
communication system which remains the foundation of
communication system till date.
He proved that amount of information that can be transferred is
1. directly proportional to bandwidth, B
2. a logarithmic function.

So, N=B∗log 2 ( M ),

where, N = no. of bits transferred per second


B = Bandwidth
M = size of message Claude Shannon
Later, he derived the final equation describing the rate of Image Credit : wikipedia.org
message transfer in terms of Bandwidth, Signal Power and
Noise Power, as

(
Rb ≤ C=B∗log 2 1+
PS
PN )
where, Rb = Data Rate

C = Channel Capacity (in bits/s)


B = Bandwidth (in Hz)
PS = Signal Power

P N = Noise Power
From the above equatioin, we can conclude that the data rate of message transfer cannot
exceed Channel Capacity, it is also known as Shannon’s Limit.
1|Page
CT111 Lab Report

PS
Here, the ratio is also known as Signal to Noise Ratio (SNR). The greater the ratio, the
PN
better the signal.
SNR can also be written in the following form,
PS ES
SNR= =
PN N0

where, E S = Energy per symbol ( a symbol is a collection of bits ).

N 0 = Spectral Density of Noise

Another quantity is E B which is energy per bit, and is related to E S as given below,

RB
∗EB
ES B
=
N0 N0

Efficiency
There are two kinds of efficiencies associated with communication systems i.e., Bandwidth
Efficiency and Power Efficiency
1. Bandwidth Efficiency : As the name suggests, it measures how proficiently is the
bandwidth for the signal utilized and is given by,

η B=
RB
B (
=log 2 1+
PS
PN )
2. Power Efficiency : This is used to know how accurately is the power of signal is used
and is usually inversely proportional to power of signal.
1
ηP∝
PS

1
From the above equation it can be seen that η B ∝ , which shows that the signal can be
ηP
either power efficient or bandwidth efficient, but not both.

Lab Exercises
EB
1. For this exercise, a range of is given and their respective bandwidth efficiencies
N0
E
η Bneeds to be calculated. A final plot is to be made between B and η B . Here, is the
N0
MATLAB code for the same.

2|Page
CT111 Lab Report

(P.T.O)
%%Below 2 statements clears all variables from workspace and %
%close all other running MATLAB program.

clear vars

close all

%%Storing given values of Es/No in a vector having values %


%ranging from -10 to 10 with steps of 0.1
EsNodB = -10:0.1:10;

%%Converting Es/No values from dBWatts to Watts


EsNo = 10.^(0.1*EsNodB);

%%The below expression will calculate Nb value for all Es/No %


%values and store it in Nb vector.
Nb = log2(1+EsNo);

%%Plotting a graph with Es/No on X-axis and Nb on Y-axis.


plot(EsNodB, Nb, 'linewidth', 2);
xlabel('Symbol SNR Es/No in dB');
ylabel('Spectral Efficiency in bps/Hz');
grid

Results :

ES
This graph shows that as the signal to noise ratio ( ¿increases, the spectral efficiency also
N0
increases, resulting in an increase in the data rate.
From this exercise I learned the following in MATLAB :
1. Working with MATLAB editor.

3|Page
CT111 Lab Report

EB
2. Creating vectors (here, for and η B)
N0
3. Various functions related to plotting graphs :
a. plot() : plots a graph for given 2 vectors, with some customizations like
adjusting linewidth of the graph.
b. xlabel() : adds a label to the X-axis.
c. ylabel() : adds a label to the Y-axis.
d. grid : adds grid to the plot.
2. In this exercise, for given range of Bandwidth B, 0 – 10Hz, resultant Channel capacity
was to be found for Signal Power PS = 0dBW and 12dBW.
For this problem, P N was taken equal to B, because P N is often given by the area
under the graph of B vs . N 0 , so its value can be written as P N =B∗N 0, assuming N 0
=1, then P N =B .
Following is the MATLAB code for this exercise:
%%Clearing variables and closing running MATLAB programs.
clear vars
close all

%%Creating a vector for Bandwidth ranging from 0-10


B = 0:0.01:10;

%%Storing the given signal powers.


PsdB = [0, 12];
%%Converting signal power from dBW to W
PsW = 10.^(0.1*PsdB);

%%Creating a vector with same no. of rows as PsdB and no. of column as
%%B with all elements initialized with zeros.
C = zeros(length(PsdB), length(B));

%%Using for loop to iterate over C to fill it with respective values


for i = 1:2
C(i,:) = B.*log2(1+PsW(i)./B);
end

%%Plotting the graph


plot(B, C, 'linewidth', 2);
xlabel('Bandwidth in Hertz')
ylabel('Spectral Efficiency in bps/Hz');
legend('P/N_0 = 0 dB','P/N_0 = 12 dB');
grid

Results :

4|Page
CT111 Lab Report

This graph represents that :


i. As the bandwidth increases, so does the bandwidth efficiency.
ii. Greater the signal power ( PS ¿ , greater is the bandwidth efficiency.

From this exercise I learned the following in MATLAB :


1. To create an empty vector (here, for C)
2. Adding legend to plots.

3. In this exercise, I had to vary PS from -5 to 10dBW and calculate C for bandwidth values
of 1, 2, and 10 Hz. Here also, P N is assumed to be equal to B.

clear vars
close all
%%Creating Ps vector and converting it from dBW to W.
PsdB = -5:0.1:10;
PsW = 10.^(0.1*PsdB);

%%Storing Bandwidth values in a vector


B = [1,2,10];
%%Vector for channel capacity initialized with zeros.
C = zeros(length(B), length(PsW));

%%filling C vector with respective values.


for i = 1:length(B)
C(i,:) = B(i).*log2(1+PsW./B(i));
end

%%Plotting the graphs, MATLAB will treat different rows as %


%different plots and merge then into a single graph.
hold on
plot(PsdB, C, 'linewidth', 2);
legend('B=1Hz', 'B=2Hz', 'B=10Hz');
xlabel('Power in dBW');
ylabel('Spectral Efficiency in bps/Hz');
hold off
grid

5|Page
CT111 Lab Report

Results :

For PS from -5 to 10 dBW. For PS from -5 to 20 dBW.


Given in problem statement. As per the graph in lab manual provided.

This graph represents that :


i. As the signal power increases, so does the bandwidth efficiency.
ii. As the bandwidth increases, spectral efficiency also increases, which is consistent
with the result obtained in problem 2.
This graph represents that :
From this exercise I learned the following in MATLAB :
1. To plot multiple graphs in a single figure.

4. Here, the range of bandwidth is given as 0-10Hz. I have to find values of PS for C values
of 1 and 5 bps.
clear vars
close all

%%Creating vectors for bandwidth and channel capacity


B = 0:0.1:10;
C = [1, 5];

%%Creating a zero vector with no. of rows as equal to C and %


%columns equal to that of B.
PsW = zeros(length(C), length(B));

%%Filling the empty vector PsW


for i = 1:length(C)
PsW(i,:) = B.*(2.^(C(i)./B)-1);
end

%%Converting PsW from W to dBW.


%%PsdB = 10*log10(PsW);

plot(B, PsW, 'linewidth', 2);


legend('C = 1 bps/Hz', 'C = 2 bps/Hz');
xlabel('Bandwidth in Hz');
ylabel('Power in W');

6|Page
CT111 Lab Report

ylim([0 10])
grid

Results :

For PS values in Watts. For PS values in dBW.


As per graph in lab manual. As defined in problem statement.

This graph represents that :


i. As the bandwidth increases, the signal power ( PS ¿ decreases. This indicates that
1
B∝ . This can even be observed from channel capacity equation for a constant C.
PS
ii. Greater the channel capacity, greater the signal power ( PS ¿ .

From this exercise I learned the following in MATLAB :


1. How to limit the range of axis values using ylim and xlim functions.

5. Method 1 : In this method, for given range of η B, from 0-6 bps/Hz, I had to find
Eb
corresponding values of .
N0
Eb
Method 2 : In this method, for each given value of , from -2-10 dB, I had to search for
N0
possible values of η B satisfying the below equation.

(
η B=log 2 1+
η B Eb
N0 )
%%Method 1
Nb1 = 0:0.01:6;
%%Finding values of EbNoW in W and then converting it to dBW.
EbNoW1 = (2.^Nb1-1)./Nb1;
EbNodB1 = 10.*log10(EbNoW1);

%%Method 2

%%Making a vector for possible values of Nb.


All_Nb_Set = 0.1:0.25:10;
%%Creating Eb/No vector in dBW and converting it to W.
7|Page
CT111 Lab Report

EbNodB2 = -2:0.1:10;
EbNoW2 = 10.^(0.1*EbNodB2);

%%An empty vector for storing Nb values.


Nb2 = 0*EbNoW2;
counter = 1;

for ebno = EbNoW2


calculatedNb = log2(1+All_Nb_Set*ebno);
differenceNb = abs(All_Nb_Set - calculatedNb);
minIndex = find(differenceNb == min(differenceNb),1);
Nb2(counter) = All_Nb_Set(minIndex);
counter = counter + 1;
end

hold on
plot(EbNodB1, Nb1,'linewidth',2);
plot(EbNodB2, Nb2, 'linewidth', 2);
xlabel('Bit SNR Eb/No in dB')
ylabel('Spectral Efficiency in bps/Hz');
legend('Method 1', 'Method 2');
ylim([0 6])
hold off
grid
Result :

This graph represents that :


i. As the SNR increases (i.e., lesser noise and cleaner signal), the bandwidth efficiency
also increases. Also, as the bandwidth efficiency increases, the power efficiency
decreases.

Eb
Ques. At what value of does η B become zero?
N0
Eb
Ans. There exist no value of for which η B becomes zero, because in the formula
N0
E b 2η −1
B
Eb
= , the value of reaches infinity as η B tends to zero.
N0 ηB N0
8|Page
CT111 Lab Report

Conclusion
1. How would you define the information?
A. Information can be defined as a way of communicating ideas to one another in a
language known by both sender and receiver. Information cannot be restricted to any
particular topics; it can vary from the size of atoms to the size of the universe.

2. How would you measure the information?


A. Information can be measured using questions whose answers can only be “yes” or
“no”. For example, say we need to find whether the result of flipping a coin is head or
tail. We can ask a question that “Is it a head?” if the answer is yes, it’s a head or else a
tail. Another example can be of finding a letter among all alphabets. We can ask the
question “Whether the letter is smaller than M(middle letter of alphabets)?” if the
answer is yes/no, depending on it, we can ask another question for a smaller range of
letters until a single letter remains. Thus, every information can be mapped to some
yes/no patterns. The greater the number of questions needed to obtain the result,
greater is the size of information.
In digital communication, we measure information in a collection of bits. Bits can be
represented, in a way, similar to these yes/no answers in the form of 1’s and 0’s.
We can assign a collection of bits to represent each letter, number, and even special
character and use this collection to measure and use information.

3. How would you transmit the information?


A. Information can be transmitted using sound waves, light waves, etc. We
communicate with others by adjusting air pressure. However, it is difficult to address
a large mass of people with our voice, or to transmit our voice over large distances.
The pattern we have developed to store information called bits can be sent over long
distances by superimposing them on a carrier wave. These waves are then received by
the antennas of electric devices which converts them to the original information.
9|Page
CT111 Lab Report

Another way of transmitting information is to send this collection of bits through


optic fiber wires/copper wires from one device to another, the transmission in this
case is very efficient.

4. What prevents the information to be accurately transmitted?


A. When we transmit information in open air, say talking or using a flashlight at night,
its amplitude decreases after travelling a certain distance. Similarly, in digital
communication, while transmitting information through medium, some disturbances
(also called noise) gets inside our information and corrupts the data. There are
several kinds of noises, for eg., Thermal Noise, Flicker Noise, Burst Noise, etc. It
becomes necessary to remove this noises else the receiver won’t be able to read the
information correctly.

10 | P a g e

You might also like