#page no. 454
import math
Bt=400.*10.**6.
Bc=100.
Gp=Bt/Bc#processing gain
k=math.log10(Gp)/math.log10(2)
print'%s %d %s %s %d %s' %('At 19.2 kbps the processing gain =',Gp/10000,'MHz/100Hz','=',Gp/1000000,'* 10**6')
print'%s %d %s' %('minimum no. of PN bits k =',round(k),'bits')
#page no.460
import math
Rc=10.*10.**6.#code rate
Bc=Rc#RF bandwidth=code rate
Rb=4.8*10.**3.#info. data rate
Gp=Bc/Rb#processing gain
GpdB=10.*math.log10(Gp)#processing gain in dB
Rc1=50.*10.**6.
Bc1=Rc1
Gp1=Bc1/Rb
Gp1dB=10.*math.log10(Gp1);
Inc=Gp1dB-GpdB
print'%s %.1f %s' %('increase in processing gain =',Inc+0.1,'dB')
#page no.461
Bc=1.25*10.**6.
Rb=9600.
SrmindB=3.
Srmin=10.**(SrmindB/10.)
Mmax=(Bc/Rb)*(1./Srmin)#maximum no. of simultaneous users
SrmaxdB=9.
Srmax=10.**(SrmaxdB/10.)
Mmin=(Bc/Rb)*(1./Srmax)#minimum no. of simultaneous users
print'%s %d %s %d %s' %('A single cell IS-95 CDMA digital cellular system can support from = ',Mmin,'to',Mmax,'users')
#page no. 463
ImaipNodB=6.
ImaipNo=10.**(ImaipNodB/10.)
NopImai=1./ImaipNo
SINRdB=8.
SINR=10.**(SINRdB/10.)#signal to noise ratio
Q=128.#total spreading factor
a=.55#relative intercellular interfernce factor
M=Q/((1.+a)*(1.+NopImai)*SINR)
print'%s %.1f %s' %('M =',M,'users per cell')
#page no.465
import math
Gv=2.5#interfernce reduction factor
Ga=2.5#antenna sectorisation gain factor
a=1.6#interfence increase factor
Pf=(Gv*Ga)/a
PfdB=10.*math.log10(Pf)
print'%s %.1f %s' %('perfomance improvement factor Pf(dB) is =',PfdB,'dB')
#page no.465
Bc=1.25*10.**6.
Rb=9600.
PfdB=6.
Pf=10.**(PfdB/10.)
SrmindB=3.
Srmin=10.**(SrmindB/10.)
Mmax=((Bc/Rb)*(1./Srmin))*(Pf)#maximum users
SrmaxdB=9.
Srmax=10.**(SrmaxdB/10.)
Mmin=((Bc/Rb)*(1./Srmax))*(Pf)#minimum users
print'%s %d %s %s %d %s %s %d %s %d' %('A single cell IS-95 CDMA system can support from =',Mmin -1,'users','to',Mmax +1,'users','or',Mmin -1,'< M <',Mmax +1)
#page no.467
BW=1.25*10.**6.
CR=1.2288*10.**6.#chip rate
BWef=CR/BW
print'%s %.2f %s' %('bandwidth efficiency is =',BWef,'chips/s/Hz')
#page no.477
import math
Bc=1.2288*10**6
Rb=9.6*10**3#baseband data rate
Gp=Bc/Rb#processing gain
GpdB=10*math.log10(Gp)#processing gain in dB
Rb1=4.8*10**3
Gp1=Bc/Rb1
Gp1dB=10*math.log10(Gp1)
Rb2=2.4*10**3
Gp2=Bc/Rb2
Gp2dB=10*math.log10(Gp2)
Rb3=1.2*10**3
Gp3=Bc/Rb3
Gp3dB=10*math.log10(Gp3)
Rb4=19.2*10**3
Gp4=Bc/Rb4
Gp4dB=10*math.log10(Gp4)
print'%s %d %s' %('processing gain Gp(dB) at the baseband data rate of 9.6kbps is =',GpdB,'dB')
print'%s %d %s' %('processing gain Gp(dB) at the baseband data rate of 4.8kbps is =',Gp1dB,'dB')
print'%s %d %s' %('processing gain Gp(dB) at the baseband data rate of 2.4kbps is =',Gp2dB,'dB')
print'%s %d %s' %('processing gain Gp(dB) at the baseband data rate of 1.2kbps is =',Gp3dB,'dB')
print'%s %d %s' %('processing gain Gp(dB) at the baseband data rate of 19.2kbps is =',Gp4dB,'dB')
#page no.486
N=(2.**42.-1.)
TDR=19200.#transmission data rate
t=N/TDR
print'%s %.2f %s' %('time taken to transit the complete long code =',(t/(60.*60.*24.*365.)),'years')
#page no.491
Prm=-85.
Ptm=-76.-Prm
Ptrm=5.
Diff=Ptm-Ptrm
t1dB=1.25
t=Diff*t1dB#time for adjusting
print'%s %d %s' %('time needed to adjust mobile transmitter level is =',t,'msecs')
#page no.497
d1=1.*10.**3.#dist.direct sig. from A
d11=1.5*10.**3.#dist.A and building
d12=0.5*10.**3.#dist.mobile and building
d2=d11+d12#dist.reflected sig.
d3=3.*10.**3.#dist.direct sig. from B
c=3.*10.**8.
D1=(d3-d1)
t1=D1/c#delay direct signal from A
D2=(d3-d2)
t2=D2/c#delay reflected signal from A
print'%s %.2f %s' %('time delay for direct signal from A =',t1*10**6,'microsecs')
print'%s %.2f %s' %('\ntime delay for reflected signal from A =',t2*10**6,'microsecs')
#page no.502
import math
Y=4.
d1=100.
B=1.#(say)
Ptm=1#(say)
Prm1=B*Ptm/(d1)**Y
d2=10000.
Prm2=B*Ptm/(d2)**Y
Prm1IPrm2=Prm1/Prm2#expected differnce in recieved power level
Prm1IPrm2dB=10.*math.log10(Prm1IPrm2)
print'%s %d %s' %('expected differnce in recieved power level =',-Prm1IPrm2dB,'dB')
#page no.505
EbINodB=-1.59#shannon limit in (AWGN)
EbINo=10.**(EbINodB/10.)
M=1./EbINo#theoretical mobile users
EbINodB1=6.
EbINo1=10.**(EbINodB1/10.)
M1=1./EbINo1#practical mobile users
print'%s %.2f %s' %('theoretical number of mobile users,M =',M,'Gp')
print'%s %.2f %s' %('\npractical number of mobile users,M =',M1,'Gp')
#page no.506
import math
Bc=1.25*10.**6.
Rb=9.6*10.**3.
Gp=Bc/Rb
GpdB=10.*math.log10(Gp)
EbINodB=6.
EbINo=10.**(EbINodB/10.)
p=0.5#interference factor
a=.85#power control accuracy factor
v=.6#voice activity factor
Y=2.55#improvement from sectorisation
M=(Gp/(EbINo))*(1./(1.+p))*a*(1./v)*Y#no. of mobile users per cell
Ns=3.
Nmps=M/Ns
print'%s %d' %('no. of mobile users per sector =',Nmps)