WCN Fiile Piyush Edited

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

EXPERIMENT - 1

AIM : Write a Scilab code to calculate no of channel in FDMA.


Code:
disp('Name:Piyush Khanna')
disp('roll number- 2101330310057')
Bt=14.5*10^6//It is allocated banwidth of system
Bc=30*10^3//It is channel spacing
Bg=10000//It is guard band spacing
p_cell=9//It is area of cell
K=3//It is total number of cells in a cluster
Nt=(Bt-2*Bg)/Bc//It is total number of channel per cluster
Nc=3
Nd=Nt-Nc//It is no of user data channel per cluster
Ndc=Nd/K//it gives no of user data channel
eff=(Ndc)/(Bt*p_cell)
printf("The spectral efficiency is:%f",eff)
Output:
EXPERIMENT:02

Aim: To calculate allocated bandwidth for given specification.


EXPERIMENT:03

Aim: Write a Scilab code to calculate efficiency in TDMA system.

Code:
disp('Name:Piyush khanna')
disp('Roll Number:2101330310057')
Bt=25*10^6//It's allocated bandwidth of system
Bg=20000//It is guard spacing
Bc=3000//It is channel spacing
Ld=260//It is no of data symbol in time slot
Ls=450//It is no of symbol in a time slot
Tf=40*10^(-3)//it is time duration of a TDMA frame
Tp=0//Duration for preamble in frame
Tt=0//It is trailer time duration
K=7//It is no of cells in a cluster
Nu=(Bt-2*Bg)/Bc//To determine total no of simultaeous user in each
cell is Nu
printf("total no of simultaneous user in each cell is:%f",Nu)
eff1=(Tf-Tp-Tt)/(Tf*(Ld/Ls))//it is used to determine spectral efficency
per frame is eff1
printf("the efficiency of TDMA system per frame is:%f",eff1)//done to
determine spectral efficieny of overall system
eff_sys=eff1*(Nu*Bc)/Bt
printf("the spectral efficiency of overall system is:%f",eff_sys)
Output:
EXPERIMENT-04

Aim: Write a Scilab code to calculate channel capacity of SISO.


Code:
disp('Name:Piyush khanna')
disp('Roll Number:2101330310057')
//Doing to calculate channel capacity of single input and single output
system
B=2000//It is channel bandwidth
SNR_db=20//It is given in db
SNR_num=10^(SNR_db/10)//SNR is in
number C=(B*log(1+SNR_num))/log(2)
printf("the channel capacity of system is:%f",C)

Output:
EXPERIMENT-05

AIM: Write a Scilab code to calculate the throughput of Pure Aloha.

Code:
disp("Piyush Khanna")
disp("Roll number - 57")
TDR=1*10^6
G=0.5
SmaxALOHA=G*%e^(-2*G)*TDR//It is throughput
printf('\nmax. throughput of ALOHA with large number of subscribers
with transmission rate 1Mbps is=%.fkbps',SmaxALOHA*10^(-3))
Stdma=100/100*TDR
printf('\nthroughput of a TDMA network is=%.fMbps',Stdma*10^(-6))
Saloha=TDR
printf('\n throughput of ALOHA with 1 subscriber is=
%.fMbps',Saloha*10^(-6))
Output:
EXPERIMENT-06

OBJECTIVE: Write a Scilab code for finding spectral efficiency.

Code:
clear;
disp('Piyush Khanna')
disp('Roll number-2101330310057')
bw=12.5*10^3
tdr1=512//transmission data rate
spef1=tdr1/bw//spectral efficiency
tdr2=1200
spef2=tdr2/bw
tdr3=2400
spef3=tdr3/bw
printf('the spectral efficiency in bps/hz at 512 bps transmission rate=
%f',spef1)
printf('the spectral efficiency in bps/hz at 1200 bps transmission rate=
%f',spef2)
printf('the spectral efficiency in bps/hz at 2400 bps transmission rate=
%f',spef3)

Output:
EXPERMIENT-07

OBJECTIVE: Write a Scilab code to calculate capacity and spectral


efficiency of TDMA.

Code:
clc;
clear all;
disp('Piyush Khanna')
disp('2101330310057')
nb=0.9;//it is bw efficiency factor
u=2;//it is bit efficiency with QPSK
vf=1;//it is voice activity factor;
bw=12.5;//in mhz
ir=16.2;
n=19;
Nu=nb*u*bw*1000/(vf*ir*n);
seff=int(Nu)*ir/(bw*1000);
printf('capacity of system is %d mobile users per cell\n',Nu);
printf('spectral efficiency of TDMA system is%.3f bit/sec/Hz\n',seff);

Output:
EXPERIMENT-08

AIM: Write a Scilab code to calculate channel capacity of single input


multiple output system.

Code:
clc;
clear all;
disp("Piyush Khanna,2101330310057")
//to calculate channel capacity of single input and multiple output system
b=2000;//it is channel bandwidth
n=20;//it is total no of transmitter
snr_db=30;//it is given in db
snr_num=10^(snr_db/10);//it gives snr in number
snr=n*snr_num;
c=(b*log(1+snr))/log(2);
printf("the channel capcity of system is:%f",c);

Output:
EXPERIMENT-09

Aim: Write a scilab code to calculate channel capacity of SIMO with


n=40.

Code:
clc;
clear all;
disp("Piyush Khanna,2101330310057")
//to calculate channel capacity of single input and multiple output system
b=2000;//it is channel bandwidth
n=40;//it is total no of transmitter
snr_db=500;//it is given in db
snr_num=10^(snr_db/10);//it gives snr in number
snr=n*snr_num;
c=(b*log(1+snr))/log(2);
printf("the channel capcity of system is:%f",c);

Output:
EXPERIMENT-10

Aim: Write a scilab code to calculate channel capacity of multiple input


and single output system.

Code:
clc;
clear all;
disp("Piyush Khanna,2101330310057")
//to calculate channel capacity of multiple input and single output system
b=3000;//it is channel bandwidth
n=30;//it is total no of transmitter
snr_db=500;//it is given in db
snr_num=10^(snr_db/10);//it gives snr in number
snr=n*snr_num;
c=(b*log(1+snr))/log(2);
printf("the channel capcity of system is:%f",c);

Output:
EXPERIMENT-11

Aim: Write a scilab code to calculate channel capacity of MIMO system.

Code:

clc;
clear all;
disp("Piyush Khanna,2101330310057")
//to calculate channel capacity of multiple input and single output system
b=3000;//it is channel bandwidth
m=40//it is total no of reciever
n=30;//it is total no of transmitter
snr_db=500;//it is given in db
snr_num=10^(snr_db/10);//it gives snr in number
snr=n*m*snr_num;
c=(b*log(1+snr))/log(2);
printf("the channel capcity of system is:%f",c);

Output:
EXPERIMENT-12

Aim: Write a scilab code to calculate allocated Bw “Bt” given N, Bc and


Bg for a wireless system.

Code:
clc;
clear all;
disp("Piyush Khanna,2101330310057")
//to calculate no of channel in FDMA
N=416;//it is no of channel
Bg=10^3;//Guard band
Bc=30*10^3;//it is channel bw
Bt=(N*Bc+2*Bg);
printf("the allocated bw is %f",Bt);

Output:
EXPERIMENT-13

Aim: Write a scilab code to calculate time in transmitting 1 bit of data.

Code:
clc;
clear all;
disp("Piyush Khanna,2101330310057")
//to caclulate time in transmitting 1 bit of data
Rate=270833;//it is in bits per sec
time=1/Rate;//it is to convert in seconds
printf("the required time is:%f",time);

Output:
EXPERIMENT-14

Aim: Write a scilab code to calculate rate of transmission of data if no of


bit and time is given.

Code:

clc;
clear all;
disp("Piyush Khanna,2101330310057")
no_of_bit=2000;
time=0.004;//it is in second
rate=no_of_bit/time;//in bps
printf("the required rate is %f",rate);

Output:
EXPERIMENT-15

Aim: Write a scilab code to compute frame efficiency in TDMA system.

Code:

clc;
clear all;
disp("Piyush Khanna,2101330310057")
n=156.25;//total no of bit in TDMA
nov=40.25;//no of overhead bit
eff=(1-nov/n)*100//total frame efficiency in percentage
printf("the total frame efficiency is :%f",eff)

Output:
EXPERIMENT-16

Aim: write a scilab code to compute nov in TDMA system.

Code:

clc;
clear all;
disp("Piyush Khanna,2101330310057")
n=156.25;//total no of bit in TDMA
eff=74.25;
nov=(1-eff/100)*n;//total frame efficiency in percentage
printf("the no of overhead is:%f",nov);

Ouput:
EXPERIMENT-17

Aim: Write a scilab code to calculate vulnerable time for pure aloha.

Code:

clc;
clear all;
disp("Piyush Khanna,2101330310057")
fs=200;//size of frame
bw=200*10^3;// in bit per sec
tfr=fs/bw;//transmitting time
vt=2*tfr;//vulnerable time for pure aloha
printf("the vulnerable time is:%f",vt);

Output:
EXPERIMENT-18

Aim: Write a scilab code to calculate throughput of pure aloha in


Kbps.

Code:
EXPERIMENT-19

Aim: Write a scilab code to calculate no of stations, given other


parameters of pure aloha.

You might also like