summaryrefslogtreecommitdiff
path: root/sample_notebooks/SachinNaik
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-08-28 16:53:23 +0530
committerThomas Stephen Lee2015-08-28 16:53:23 +0530
commitdb0855dbeb41ecb8a51dde8587d43e5d7e83620f (patch)
treeb95975d958cba9af36cb1680e3f77205354f6512 /sample_notebooks/SachinNaik
parent5a86a20b9de487553d4ef88719fb0fd76a5dd6a7 (diff)
downloadPython-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.gz
Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.bz2
Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.zip
add books
Diffstat (limited to 'sample_notebooks/SachinNaik')
-rw-r--r--sample_notebooks/SachinNaik/ch5.ipynb416
1 files changed, 416 insertions, 0 deletions
diff --git a/sample_notebooks/SachinNaik/ch5.ipynb b/sample_notebooks/SachinNaik/ch5.ipynb
new file mode 100644
index 00000000..153ee7fb
--- /dev/null
+++ b/sample_notebooks/SachinNaik/ch5.ipynb
@@ -0,0 +1,416 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:98db718d0bf89da2e915ec31624499d68101b659175b122291fbf41d86cde068"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5: Fundamentals of Cellular Communications"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1, Page 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "ToCH=960.;# Total available channels\n",
+ "Cellarea=6.; #in km^2\n",
+ "Covarea=2000.;#in km^2\n",
+ "N1=4.; # Cluster Size\n",
+ "N2=7.; #Cluster Size\n",
+ "\n",
+ "#Calculations\n",
+ "Area1=N1*Cellarea;#for N=4\n",
+ "Area2=N2*Cellarea;#For N=7\n",
+ "No_of_clusters1=round(Covarea/Area1);\n",
+ "No_of_clusters2=round(Covarea/Area2);\n",
+ "No_of_CH1=ToCH/N1; # No of channels with cluster size 4\n",
+ "No_of_CH2=ToCH/N2; # No of channels with cluster size 7\n",
+ "SysCap1=No_of_clusters1*ToCH;\n",
+ "SysCap2=No_of_clusters2*ToCH;\n",
+ "\n",
+ "#Results\n",
+ "print 'System Capacity with cluster size 4 is %d channels'%SysCap1\n",
+ "print 'Number of clusters for covering total area with N equals 4 are %d'%No_of_clusters1\n",
+ "print 'System Capacity with cluster size 7 is %d channels'%SysCap2\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "System Capacity with cluster size 4 is 79680 channels\n",
+ "Number of clusters for covering total area with N equals 4 are 83\n",
+ "System Capacity with cluster size 7 is 46080 channels\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2, Page 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "S_IAMP=18.;# S/I ratio in dB\n",
+ "S_IGSM=12.;# S/I ratio in dB\n",
+ "PPL=4.; # propogation path loss coefficient\n",
+ "\n",
+ "#Calculations\n",
+ "# Using Equation 5.16 on page no 132, we get\n",
+ "N_AMP=(1./3)*((6*10**(0.1*S_IAMP))**(2/PPL));#reuse factor for AMPS\n",
+ " \n",
+ "N_GSM=(1./3)*((6*10**(0.1*S_IGSM))**(2/PPL));#reuse factor for GSM\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print 'Reuse Factor for AMP system is N = %.3f = approx %d \\n'%(N_AMP,N_AMP+1);\n",
+ "print 'Reuse Factor for GSM system is N = %.3f = approx %d \\n'%(N_GSM,N_GSM+1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reuse Factor for AMP system is N = 6.486 = approx 7 \n",
+ "\n",
+ "Reuse Factor for GSM system is N = 3.251 = approx 4 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3, Page 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCH=395.;#Total voice channels\n",
+ "CallHT=120.;#average call holding time in sec\n",
+ "Blocking=0.02;# 2%\n",
+ "PPL=4.; #propogation path loss coefficient\n",
+ "N1=4. #reuse factor\n",
+ "N2=7.; #reuse factor\n",
+ "N3=12.; #reuse factor\n",
+ "\n",
+ "#Calculations&Results\n",
+ "No_of_VCH1=VCH/N1; #for reuse factor N1\n",
+ "No_of_VCH2=VCH/N2; #for reuse factor N2\n",
+ "No_of_VCH3=VCH/N3; #for reuse factor N3\n",
+ "print 'NO of voice channels for N=4 are %d'%(round(No_of_VCH1));\n",
+ "print 'NO of voice channels for N=7 are %d'%(round(No_of_VCH2));\n",
+ "print 'NO of voice channels for N=12 are %d\\n'%(round(No_of_VCH3));\n",
+ "TrafLoad1=87.004;\n",
+ "Carryload1=(1-Blocking)*TrafLoad1;\n",
+ "TrafLoad2=45.877;\n",
+ "Carryload2=(1-Blocking)*TrafLoad2;\n",
+ "TrafLoad3=24.629;\n",
+ "Carryload3=(1-Blocking)*TrafLoad3;\n",
+ "# To find cell capacity\n",
+ "Ncall1=Carryload1*3600/CallHT;#Calls per hour per cell \n",
+ "Ncall2=Carryload2*3600/CallHT;\n",
+ "Ncall3=Carryload3*3600/CallHT;\n",
+ "print 'calls per hour per cell for N=4 are %d'%(round(Ncall1));\n",
+ "print 'calls per hour per cell for N=7 are %d'%(round(Ncall2));\n",
+ "print 'calls per hour per cell for N=12 are %d \\n'%(Ncall3);\n",
+ "# To find S BY I\n",
+ "# N=(1/3)[6*(S/I)]**(2/PPL)\n",
+ "S_I1=10*(PPL/2)*(math.log10(N1)-math.log10(1./3)-(2./PPL)*math.log10(6));#Mean S/I (dB)\n",
+ "\n",
+ "S_I2=10*(PPL/2)*(math.log10(N2)-math.log10(1./3)-(2./PPL)*math.log10(6));\n",
+ "S_I3=10*(PPL/2)*(math.log10(N3)-math.log10(1./3)-(2./PPL)*math.log10(6));\n",
+ "\n",
+ "print 'Mean S/I(dB) for N=4 is %.1f'%S_I1\n",
+ "print 'Mean S/I(dB) for N=7 is %.1f'%S_I2\n",
+ "print 'Mean S/I(dB) for N=12 is %.1f'%S_I3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "NO of voice channels for N=4 are 99\n",
+ "NO of voice channels for N=7 are 56\n",
+ "NO of voice channels for N=12 are 33\n",
+ "\n",
+ "calls per hour per cell for N=4 are 2558\n",
+ "calls per hour per cell for N=7 are 1349\n",
+ "calls per hour per cell for N=12 are 724 \n",
+ "\n",
+ "Mean S/I(dB) for N=4 is 13.8\n",
+ "Mean S/I(dB) for N=7 is 18.7\n",
+ "Mean S/I(dB) for N=12 is 23.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4, Page 154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "spectrum=12.5*10**6; #in Hz\n",
+ "CHBW=200*10**3;#in Hz\n",
+ "N=4.;#reuse factor\n",
+ "Blocking=0.02; # 2%\n",
+ "callHT=120.;#average call holding time in sec\n",
+ "PPL=4.;#propogation path loss coefficient\n",
+ "CntrlCH=3.; #No of control channels\n",
+ "Ts=8.; # No of voice channels per RF channel\n",
+ "\n",
+ "#Calculations&Results\n",
+ "No_ofVCH=((spectrum*Ts)/(CHBW*N))-CntrlCH;\n",
+ "print 'No of voice channels for N=4 are %d'%(No_ofVCH)\n",
+ "TrafLoad=110.;\n",
+ "CarryLoad=(1-Blocking)*TrafLoad;\n",
+ "Ncall=CarryLoad*3600/callHT;\n",
+ "print 'Calls per hour per cell for N=4 are %d calls/hour/cell \\n '%(round(Ncall));\n",
+ "S_I=10*(PPL/2)*(math.log10(N)-math.log10(1./3)-(2./PPL)*math.log10(6));\n",
+ "print 'Mean S/I(dB) for N=4 is %.1f dB \\n '%(S_I)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No of voice channels for N=4 are 122\n",
+ "Calls per hour per cell for N=4 are 3234 calls/hour/cell \n",
+ " \n",
+ "Mean S/I(dB) for N=4 is 13.8 dB \n",
+ " \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5, Page 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "VCH=395.;#Total allocated voice channels\n",
+ "CHBW=30.; # in kHz\n",
+ "Spectrum=12.5; # in MHz\n",
+ "CallHT=120.; #Average call holding time in sec\n",
+ "Blocking=0.02; # 2%\n",
+ "PL=40.; #slope of path loss in dBperdecade\n",
+ "\n",
+ "#Calculations&Results\n",
+ "print \"We consider only the \ufb01rst tier interferers and neglect the effects of cochannel interference from the second and other higher tiers.\"\n",
+ "#FOR 120degree sectorization\n",
+ "#N=4\n",
+ "VCH11=(VCH/(4*3));\n",
+ "OffLoad11=24.629; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site11=3*OffLoad11;\n",
+ "CarLoad11=(1-Blocking)*Load_site11;\n",
+ "Calls_hr_site11=CarLoad11*3600/CallHT;\n",
+ "R11=math.sqrt(CarLoad11/0.52);\n",
+ "Seff11=CarLoad11/(2.6*Spectrum*R11**2);\n",
+ "S_I11=PL*math.log10(math.sqrt(3*4))-10*math.log10(2);\n",
+ "#N=7\n",
+ "VCH12=(VCH/(3*7));\n",
+ "OffLoad12=12.341; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site12=3*OffLoad12;\n",
+ "CarLoad12=(1-Blocking)*Load_site12;\n",
+ "Calls_hr_site12=CarLoad12*3600/CallHT;\n",
+ "R12=math.sqrt(CarLoad12/0.52);\n",
+ "Seff12=CarLoad12/(2.6*Spectrum*R12**2);\n",
+ "S_I12=PL*math.log10(math.sqrt(3*7))-10*math.log10(2);\n",
+ "#N=12\n",
+ "VCH13=VCH/(3*12);\n",
+ "OffLoad13=5.842; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site13=3*OffLoad13;\n",
+ "CarLoad13=(1-Blocking)*Load_site13;\n",
+ "Calls_hr_site13=CarLoad13*3600/CallHT;\n",
+ "R13=math.sqrt(CarLoad13/0.52);\n",
+ "Seff13=CarLoad13/(2.6*Spectrum*R13**2);\n",
+ "S_I13=PL*math.log10(math.sqrt(3*12))-10*math.log10(2);\n",
+ "#For omnidirectional \n",
+ "#N=4\n",
+ "VCH21=VCH/(4);\n",
+ "OffLoad21=87.004; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site21=OffLoad21;\n",
+ "CarLoad21=(1-Blocking)*Load_site21;\n",
+ "Calls_hr_site21=CarLoad21*3600/CallHT;\n",
+ "R21=math.sqrt(CarLoad21/0.52);\n",
+ "Seff21=CarLoad21/(2.6*Spectrum*R21**2);\n",
+ "S_I21=PL*math.log10(math.sqrt(3*4))-10*math.log10(6);\n",
+ "#N=7\n",
+ "VCH22=VCH/(7);\n",
+ "OffLoad22=46.817; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site22=OffLoad22;\n",
+ "CarLoad22=(1-Blocking)*Load_site22;\n",
+ "Calls_hr_site22=CarLoad22*3600/CallHT;\n",
+ "R22=math.sqrt(CarLoad22/0.52);\n",
+ "Seff22=CarLoad22/(2.6*Spectrum*R22**2);\n",
+ "S_I22=PL*math.log10(math.sqrt(3*7))-10*math.log10(6);\n",
+ "#N=12\n",
+ "VCH23=VCH/(12);\n",
+ "OffLoad23=24.629; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site23=OffLoad23;\n",
+ "CarLoad23=(1-Blocking)*Load_site23;\n",
+ "Calls_hr_site23=CarLoad23*3600/CallHT;\n",
+ "R23=math.sqrt(CarLoad23/0.52);\n",
+ "Seff23=CarLoad23/(2.6*Spectrum*R23**2);\n",
+ "S_I23=PL*math.log10(math.sqrt(3*12))-10*math.log10(6);\n",
+ "# For 60degree Sectorization\n",
+ "#N=3\n",
+ "VCH31=VCH/(6*3);\n",
+ "OffLoad31=14.902; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site31=6*OffLoad31;\n",
+ "CarLoad31=(1-Blocking)*Load_site31;\n",
+ "Calls_hr_site31=CarLoad31*3600/CallHT;\n",
+ "R31=math.sqrt(CarLoad31/0.52);\n",
+ "Seff31=CarLoad31/(2.6*Spectrum*R31**2);\n",
+ "S_I31=PL*math.log10(math.sqrt(3*3))-10*math.log10(1);\n",
+ "#N=4\n",
+ "VCH32=VCH/(6*4);\n",
+ "OffLoad32=10.656; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site32=6*OffLoad32;\n",
+ "CarLoad32=(1-Blocking)*Load_site32;\n",
+ "Calls_hr_site32=CarLoad32*3600/CallHT;\n",
+ "R32=math.sqrt(CarLoad32/0.52);\n",
+ "Seff32=CarLoad32/(2.6*Spectrum*R32**2);\n",
+ "S_I32=PL*math.log10(math.sqrt(3*4))-10*math.log10(1);\n",
+ "#N=7\n",
+ "VCH33=VCH/(6*7);\n",
+ "OffLoad33=5.084; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site33=6*OffLoad33;\n",
+ "CarLoad33=(1-Blocking)*Load_site33;\n",
+ "Calls_hr_site33=CarLoad33*3600/CallHT;\n",
+ "R33=math.sqrt(CarLoad33/0.52);\n",
+ "Seff33=CarLoad33/(2.6*Spectrum*R33**2);\n",
+ "S_I33=PL*math.log10(math.sqrt(3*7))-10*math.log10(1);\n",
+ "#N=12\n",
+ "VCH34=VCH/(6*12);\n",
+ "OffLoad34=2.227; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n",
+ "Load_site34=6*OffLoad34;\n",
+ "CarLoad34=(1-Blocking)*Load_site34;\n",
+ "Calls_hr_site34=CarLoad34*3600/CallHT;\n",
+ "R34=math.sqrt(CarLoad34/0.52);\n",
+ "Seff34=CarLoad34/(2.6*Spectrum*R34**2);\n",
+ "S_I34=PL*math.log10(math.sqrt(3.*12))-10*math.log10(1);\n",
+ "\n",
+ "print 'For Omnidirectional Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency'\n",
+ "print 'For N=4 %d %.1f %.3f\\n'%(Calls_hr_site21,S_I21,Seff21);\n",
+ "print 'For N=7 %d %.1f %.3f\\n'%(Calls_hr_site22,S_I22,Seff22);\n",
+ "print 'For N=12 %d %.1f %.3f\\n'%(Calls_hr_site23,S_I23,Seff23);\n",
+ "\n",
+ "print 'For 120deg sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\\n'\n",
+ "print 'For N=4 %d %.1f %.3f\\n'%(Calls_hr_site11,S_I11,Seff11);\n",
+ "print 'For N=7 %d %.1f %.3f\\n'%(Calls_hr_site12,S_I12,Seff12);\n",
+ "print 'For N=12 %d %.1f %.3f\\n'%(Calls_hr_site13,S_I13,Seff13);\n",
+ "\n",
+ "print 'For 60 deg Sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\\n'\n",
+ "print 'For N=3 %d %.1f %.3f\\n'%(Calls_hr_site31,S_I31,Seff31);\n",
+ "print 'For N=4 %d %.1f %.3f\\n'%(Calls_hr_site32,S_I32,Seff32);\n",
+ "print 'For N=7 %d %.1f %.3f\\n'%(Calls_hr_site33,S_I33,Seff33);\n",
+ "print 'For N=12 %d %.1f %.3f\\n'%(Calls_hr_site34,S_I34,Seff34);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "We consider only the \ufb01rst tier interferers and neglect the effects of cochannel interference from the second and other higher tiers.\n",
+ "For Omnidirectional Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\n",
+ "For N=4 2557 13.8 0.016\n",
+ "\n",
+ "For N=7 1376 18.7 0.016\n",
+ "\n",
+ "For N=12 724 23.3 0.016\n",
+ "\n",
+ "For 120deg sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\n",
+ "\n",
+ "For N=4 2172 18.6 0.016\n",
+ "\n",
+ "For N=7 1088 23.4 0.016\n",
+ "\n",
+ "For N=12 515 28.1 0.016\n",
+ "\n",
+ "For 60 deg Sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\n",
+ "\n",
+ "For N=3 2628 19.1 0.016\n",
+ "\n",
+ "For N=4 1879 21.6 0.016\n",
+ "\n",
+ "For N=7 896 26.4 0.016\n",
+ "\n",
+ "For N=12 392 31.1 0.016\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file