WCN Fiile Piyush Edited
WCN Fiile Piyush Edited
WCN Fiile Piyush Edited
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
Output:
EXPERIMENT-05
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
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
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
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
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
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
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
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
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
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
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
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
Code:
EXPERIMENT-19