diff options
author | Prashant S | 2020-04-14 10:25:32 +0530 |
---|---|---|
committer | GitHub | 2020-04-14 10:25:32 +0530 |
commit | 06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch) | |
tree | 2b1df110e24ff0174830d7f825f43ff1c134d1af /Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport | |
parent | abb52650288b08a680335531742a7126ad0fb846 (diff) | |
parent | 476705d693c7122d34f9b049fa79b935405c9b49 (diff) | |
download | all-scilab-tbc-books-ipynb-master.tar.gz all-scilab-tbc-books-ipynb-master.tar.bz2 all-scilab-tbc-books-ipynb-master.zip |
Initial commit
Diffstat (limited to 'Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport')
8 files changed, 3080 insertions, 0 deletions
diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/2-Appendix_B_Noise_figure_calculations_for_link_budgets.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/2-Appendix_B_Noise_figure_calculations_for_link_budgets.ipynb new file mode 100644 index 0000000..620a111 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/2-Appendix_B_Noise_figure_calculations_for_link_budgets.ipynb @@ -0,0 +1,179 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Appendix B Noise figure calculations for link budgets" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: To_determine_SNR_at_the_detector_output_stage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no B.1\n", +"// To determine SNR at the detector output stage\n", +"// Page no. 613\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"SNRin=20; // SNR at the receiver antenna input terminal in dB\n", +"F=6; // Noise figure in dB\n", +"\n", +"// SNR at the detector output stage\n", +"SNRout=SNRin-F; // SNR at the detector output stage in dB\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n SNR at the detector output stage = %0.0f dB',SNRout);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: To_compute_noise_figure_of_mobile_receiver_system.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example no B.2\n", +"//To compute noise figure of mobile receiver system\n", +"//Page no. 613\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"//Given data\n", +"F1=3; //Coaxial cable loss in dB\n", +"F1=10^(F1/10); //Coaxial cable loss\n", +"F2=6; //Noise figure of phone in dB\n", +"F2=10^(F2/10); //Noise figure of phone\n", +"\n", +"Fsys=F1+((F2-1)/0.5); //Noise figure of mobile receiver system\n", +"Fsys=10*log10(Fsys); //Noise figure of mobile receiver system in dB\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Noise figure of mobile receiver system = %0.0f dB',Fsys);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: To_determine_average_output_thermal_noise_power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no B.3\n", +"// To determine average output thermal noise power\n", +"// Page no. 614\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"T0=300; // Ambient room temperature in K\n", +"Fsys=8; // Noise figure of the system\n", +"Tant=290; // Effective temperature of antenna in K\n", +"K=1.38*10^-23; // Boltzmann's constant in J/K\n", +"B=30000; // Effective bandwidth in Hz\n", +"\n", +"Te=(Fsys-1)*T0; // Effective noise temperature in K\n", +"Ttotal=Tant+Te; // Overall system noise temperature in K\n", +"\n", +"// To determine average output thermal noise power\n", +"Pn=(1+(Ttotal/T0))*K*T0*B; // Average output thermal noise power in W\n", +"Pn=10*log10(Pn/(10^-3)); // Average output thermal noise power in dBm\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Average output thermal noise power = %0.1f dBm',Pn);\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4: To_determine_average_signal_strength_at_the_antenna_terminal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no B.4\n", +"// To determine average signal strength at the antenna terminal \n", +"// Page no. 614\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Pn=-119.5; // Average output thermal noise power in dBm\n", +"SNR=30; // SNR at the receiver output in dB\n", +"\n", +"// To determine average signal strength at the antenna terminal to provide 30dB SNR\n", +"Ps=SNR+Pn; // Average signal strength at the antenna terminal\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Average signal strength at the antenna terminal to provide 30dB SNR = %0.1f dBm',Ps);\n", +"\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/3-The_cellular_concept_system_design_fundamentals.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/3-The_cellular_concept_system_design_fundamentals.ipynb new file mode 100644 index 0000000..2bf6d37 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/3-The_cellular_concept_system_design_fundamentals.ipynb @@ -0,0 +1,506 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: The cellular concept system design fundamentals" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: EX3_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.1\n", +"// To compute the number of channels available per cell for a)four-cell reuse system a)seven-cell reuse system a)12-cell reuse system\n", +"// Page No.61\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"B=33*10^6; // Total bandwidth allocated to particular FDD system in Hz\n", +"Bc=25*10^3; // Bandwidth per channel in Hz\n", +"Nc=2; // Number of simplex channels\n", +"Bc=Bc*Nc; // Channel bandwidth in Hz\n", +"\n", +"Ntotal=B/Bc; // Total number of channels\n", +"\n", +"//a) To compute the number of channels available per cell for four-cell reuse system\n", +"N=4; // frequency reuse factor\n", +"chpercell=Ntotal/N; // number of channels available per cell for four-cell reuse system\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The number of channels available per cell for 4-cell reuse system = %0.0f channels',chpercell);\n", +"printf('\n One control channel and 160 voice channels would be assigned to each cell.');\n", +"\n", +"// b) To compute the number of channels available per cell for seven-cell reuse system\n", +"N=7; // frequency reuse factor\n", +"chpercell=ceil(Ntotal/N); // number of channels available per cell for seven-cell reuse system\n", +"\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n The number of channels available per cell for 7-cell reuse system = %0.0f channels',chpercell);\n", +"printf('\n Each cell would have one control channel, four cells would have 90 voice channels and three cells would have 91 voice channels.');\n", +"\n", +"// c) To compute the number of channels available per cell for 12-cell reuse system\n", +"N=12; // frequency reuse factor\n", +"chpercell=Ntotal/N; // number of channels available per cell for seven-cell reuse system\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n The number of channels available per cell for 12-cell reuse system = %0.0f channels',chpercell);\n", +"printf('\n Each cell would have one control channel, eight cells would have 53 voice channels and four cells would have 54 voice channels.');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: To_find_frequency_reuse_factor_for_path_loss_exponent_4_and_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.2\n", +"// To find frequency reuse factor for path loss exponent (n) a)n=4 b)n=3\n", +"// Page No.72\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"SIdB=15; // Signal to interference(dB)\n", +"io=6; // Number of cochannel cell\n", +"\n", +"// For n=4\n", +"n1=4; // Path loss exponent\n", +"N1=7; // First consideration: frequency reuse factor N=7\n", +"DR1=sqrt(3*N1); // Co-channel reuse ratio\n", +"si1=(1/io)*(DR1)^n1; // Signal to interference\n", +"sidB1=10*log10(si1); // Signal to interference(dB)\n", +"\n", +"// For n=3\n", +"n2=3; // Path loss exmponent\n", +"si=(1/io)*(DR1)^n2; // Signal to interference for first consideration: frequency reuse factor N=7\n", +"sidB=10*log10(si); // Signal to interference(dB)\n", +"\n", +"N2=12; // second consideration : frequency reuse factor N=12 since sidB<SIdB \n", +"DR2=sqrt(3*N2); // Co-channel reuse ratio\n", +"si2=(1/io)*(DR2)^n2; // Signal to interference\n", +"sidB2=10*log10(si2); // Signal to interference(dB)\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Signal to noise ratio for n=4 with frequency reuse factor N=7 = %0.2f dB',sidB1);\n", +"printf('\n Signal to noise ratio for n=3 with frequency reuse factor N=7 = %0.2f dB',sidB);\n", +"printf('\n Signal to noise ratio for n=3 with frequency reuse factor N=12 = %0.2f dB',sidB2);\n", +"printf('\n Since SIR is for n=3 with frequency reuse factor N=7 greater than the minimum required, so N=12 is used.');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: To_find_number_of_users_for_Number_of_channels_1_and_5_and_10_and_20_and_100.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.4\n", +"// To find number of users for Number of channels (C) a)C=1 b)C=5 c)C=10 d)C=20 e)C=100\n", +"// Page No.80\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"GOS=0.005; //G rade of Service\n", +"Au=0.1; // Traffic intensity per user\n", +"\n", +"// a)To find number of users for C=1\n", +"C1=1; // Number of channels\n", +"A1=0.005; // Total traffic intensity from Erlangs B chart\n", +"U1=(A1/Au); // Number of users\n", +"U1=1; // Since one user could be supported on one channel\n", +"\n", +"// b)To find number of users for C=5\n", +"C2=5; // Number of channels\n", +"A2=1.13; // Total traffic intensity from Erlangs B chart\n", +"U2=round(A2/Au); // Number of users\n", +"\n", +"// c)To find number of users for C=10\n", +"C3=10; // Number of channels\n", +"A3=3.96; // Total traffic intensity from Erlangs B chart\n", +"U3=round(A3/Au); // Number of users\n", +"\n", +"// Answer is varrying due to round off error\n", +"\n", +"// d)To find number of users for C=20\n", +"C4=20; // Number of channels\n", +"A4=11.10; // Total traffic intensity from Erlangs B chart\n", +"U4=round(A4/Au); // Number of users\n", +"\n", +"// Answer is varrying due to round off error\n", +"\n", +"// e)To find number of users for C=100\n", +"C5=100; // Number of channels\n", +"A5=80.9; // Total traffic intensity from Erlangs B chart\n", +"U5=round(A5/Au); // Number of users\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Total number of users for 1 channel = %0.0f',U1);\n", +"printf('\n Total number of users for 5 channel = %0.0f',U2);\n", +"printf('\n Total number of users for 10 channel = %0.0f',U3);\n", +"printf('\n Total number of users for 20 channel = %0.0f',U4);\n", +"printf('\n Total number of users for 100 channel = %0.0f',U5);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: To_find_number_of_users_for_system_A_and_system_B_and_system_C.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.5\n", +"// To find number of users for a)system A b)system B c)system C\n", +"// Page No.83\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"GOS=0.02; // Grade of Service (Probability of bloacking)\n", +"lamda=2; // Average calls per hour\n", +"H=(3/60); // Call duration in seconds\n", +"\n", +"Au=lamda*H; // Traffic intensity per user\n", +"\n", +"// a)To find number of users for System A\n", +"C1=19; // Number of channels used\n", +"A1=12; // Traffic intensity from Erlang B chart\n", +"U1=round(A1/Au); // Number of users per cell\n", +"cells1=394;\n", +"TU1=U1*cells1; // Total number of users\n", +"MP1=TU1/(2*10^6)*100; // Market penetration percentage\n", +"\n", +"// b)To find number of users for System B\n", +"C2=57; // No. of channels used\n", +"A2=45; // Traffic intensity from Erlang B chart\n", +"U2=round(A2/Au); // Number of users per cell\n", +"cells2=98;\n", +"TU2=U2*cells2; // Total no. of users\n", +"MP2=TU2/(2*10^6)*100; // Market penetration percentage\n", +"\n", +"// c)To find number of users for System C\n", +"C3=100; // Number of channels used\n", +"A3=88; // traffic intensity from Erlang B chart\n", +"U3=round(A3/Au); // Number of users per cell\n", +"cells3=49;\n", +"TU3=U3*cells3; // Total no. of users\n", +"MP3=TU3/(2*10^6)*100; // Market penetration percentage\n", +"\n", +"TU=TU1+TU2+TU3; // Total number of users in all 3 systems\n", +"MP=TU/(2*10^6)*100; // Combined Market penetration percentage\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Total number of users in system A = %0.0f',TU1);\n", +"printf('\n The percentage market penetration of system A = %0.2f',MP1);\n", +"printf('\n \n Total number of users in system B = %0.0f',TU2);\n", +"printf('\n The percentage market penetration of system B = %0.3f',MP2);\n", +"printf('\n \n Total number of users in system C = %0.0f',TU3);\n", +"printf('\n The percentage market penetration of system C = %0.3f',MP3);\n", +"printf('\n \n Total number of users in all 3 systems = %0.0f',TU);\n", +"printf('\n The combined Market penetration percentage of all systems = %0.3f',MP);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: EX3_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.6\n", +"// To find a)Number of cells in given area b)Number of channels/cell c)Traffic intensity per cell d)Maximum carried traffic e)Total number of users for 2% GOS f) Number of mobiles per unique channel g)Maximum number of users could be served at one time\n", +"// Page No.84\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"Area=1300; // Total coverage area in m^2\n", +"R=4; // Radius of cell in m\n", +"N=7; // Frequecy reuse factor\n", +"S=40*10^6; // Allocated spectrum in Hz\n", +"Ch=60*10^3; // Channel width in Hz\n", +"\n", +"// a)Number of cells\n", +"CA=2.5981*R^2; // Area of hexagonal cell in m^2\n", +"Nc=round(Area/CA); // Number of cells\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Number of cells in given system = %0.0f cells',Nc);\n", +"\n", +"// b)Number of channels/cell\n", +"C1=round(S/(Ch*N)); // Number of channels\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Number of channels per cell in given system = %0.0f channels/cell',C1);\n", +"\n", +"// c) Traffic intensity per cell\n", +"C1=95; // Number of channels from b)\n", +"GOS=0.02; // Grade of service\n", +"A=84; // Traffic intensity from Erlang B chart\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Traffic intensity in given system = %0.0f Erlangs/cell',A);\n", +"\n", +"// d)Maximum carried traffic\n", +"traffic=Nc*A; // Maximum carried traffic\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Maximum carried traffic in given system = %0.0f Erlangs',traffic);\n", +"\n", +"// e)Total number of users for 2% GOS \n", +"trafficperuser=0.03; // Given traffic per user\n", +"U=traffic/trafficperuser; // Total number of users\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Total number of users = %0.0f users',U);\n", +"\n", +"// f) Number of mobiles per unique channel\n", +"C=666; // Number of channels\n", +"mobilesperchannel=round(U/C); // Number of mobiles per unique channel\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Number of mobiles per unique channel = %0.0f mobiles/channel',mobilesperchannel);\n", +"\n", +"// g)Maximum number of users could be served at one time\n", +"printf('\n \n Theoretically maximum number of served mobiles is the number of available channels in the system.')\n", +"C=C1*Nc; // Maximum number of users could be served at one time\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Theoretical Maximum number of users could be served at one time = %0.0f users',C);\n", +"disp('It is 3.4% of customer base.');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: EX3_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.7\n", +"// To find a)number of users per square km b)probability that delayed call have to wait longer than t=10sec c)probability that call is delayed more than 10 sec\n", +"// Page 85\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"R=1.387; // Radius of cell in m\n", +"Area=2.598*R^2; // Area of hexagonal cell in m^2\n", +"cellpercluster=4; // Number of cells/cluster\n", +"channels=60; // Number of channels\n", +"\n", +"channelspercell=channels/cellpercluster; // Number of channels per cell\n", +"\n", +"// a)To find number of users per square km\n", +"A=0.029; // Traffic intensity per user\n", +"delayprob=0.05; // Grade of service\n", +"traffic=9; // Traffic intensity from Erlang chart C\n", +"U1=traffic/A; // Total number of users in 5sq.km.\n", +"U=round(U1/Area); // Number of users per square km\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Number of users per square km in given system = %0.0f users/sq km',U);\n", +"\n", +"// b)To find the probability that delayed call have to wait longer than t=10sec\n", +"lambda=1; // Holding time\n", +"H1=A/lambda; // Duration of call\n", +"H=H1*3600; // Duration of call in second\n", +"t=10;\n", +"Pr=exp(-(channelspercell-traffic)*t/H)*100; // probability that delayed call have to wait longer than t=10sec.\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Percentage of probability that delayed call have to wait longer than t=10 sec = %0.2f percent',Pr);\n", +"\n", +"// c)To find the probability that call is delayed more than 10 sec\n", +"Pr10=delayprob*Pr; // probability that call is delayed more than 10 sec\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Percentage of probability that call is delayed more than 10 sec = %0.2f percent',Pr10);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: EX3_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.8\n", +"// To find number of channels in 3 km by 3 km square centered around A in Figure 3.9 for a)without use of microcell b)with the use of lettered microcells c)all base stations are replaced by microcells\n", +"// Page 89\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"R=1; // Cell radius in km\n", +"r=0.5; // Micro-cell radius in km\n", +"Nc=60; // Number of channels in base station\n", +"\n", +"// a)To find number of channels without use of microcell\n", +"Nb1=5; // Number of base stations in given area\n", +"N1=Nb1*Nc; // Number of channels without use of microcell\n", +"\n", +"// b)To find number of channels with the use of lettered microcells\n", +"Nb2=6; // Number of lettered microcells\n", +"Nb2=Nb1+Nb2; // Total number of base stations in given area\n", +"N2=Nb2*Nc; // Number of channels with the use of lettered microcells\n", +"\n", +"// c)To find number of channels if all base stations are replaced by microcells\n", +"Nb3=12; // Number of all the microcells\n", +"Nb3=Nb1+Nb3; // Total number of base stations in given area\n", +"N3=Nb3*Nc; // Number of channels if all base stations are replaced by microcells\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Number of channels without use of microcell = %0.0f channels',N1);\n", +"printf('\n \n Number of channels with the use of lettered microcells = %0.0f channels',N2);\n", +"printf('\n \n Number of channels if all base stations are replaced by microcells = %0.0f channels',N3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: To_analyze_trunking_efficiency_capacity_of_sectoring_and_unsectoring.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 3.9\n", +"// To analyze trunking efficiency capacity of sectoring and unsectoring\n", +"// Page 92\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"H=2/60; // Average call duration in hour\n", +"GOS=0.01; // Probability of blocking\n", +"\n", +"// Unsectored system\n", +"C1=57; // Number of traffic channels per cell in unsectored system\n", +"A=44.2; // Carried traffic in unsectored system\n", +"calls1=1326; // Number of calls per hour in unsectored system from Erlangs B table\n", +"\n", +"// 120 degree sectored system\n", +"C2=C1/3; // Number of traffic channels per antenna sector in 120 degree sectored system\n", +"calls2=336; // Number of calls per hour in 120 degree sectored system from Erlangs B table\n", +"Ns1=3; // Number of sectors\n", +"capacity=Ns1*calls2; // Cell capacity or number of calls handled by system per hour\n", +"\n", +"dif=calls1-capacity; // decrease in cell capacity in 120 degree sectored system\n", +"percentdif=(dif/calls1)*100; // decrease in cell capacity in 120 degree sectored system in percentage\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Cell capacity of unsectored system = %0.0f calls/hour',calls1);\n", +"printf('\n \n Cell capacity of 120 degree sectored system = %0.0f calls/hour',capacity);\n", +"printf('\n \n Decrease in cell capacity in 120 degree sectored system = %0.0f percent',percentdif);" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/4-Mobile_radio_propagation_large_scale_path_loss.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/4-Mobile_radio_propagation_large_scale_path_loss.ipynb new file mode 100644 index 0000000..0233f75 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/4-Mobile_radio_propagation_large_scale_path_loss.ipynb @@ -0,0 +1,574 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Mobile radio propagation large scale path loss" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10: To_find_the_power_at_receiver.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 4.10\n", +"// To find the power at receiver\n", +"// Page no. 152\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"d=50*10^3; // Distance between transmitter and receiver in m\n", +"hte=100; // Effective heigth of transmitter in m\n", +"hre=10; // Effective heigth of receiver in m\n", +"EIRP=1*10^3; // Radiated power in Watt\n", +"f=900*10^6; // Operating frequency in Hz\n", +"c=3*10^8; // Speed of ligth in m/s\n", +"lambda=c/f; // operating wavelength in m\n", +"EIRP=20*log10(EIRP); // Radiated power in dB\n", +"Gr=0; // Receiving gain in dB\n", +"\n", +"Lf=-10*log10(lambda^2/(4*%pi*d)^2); // Free space path loss in dB\n", +"Amu=43; // Attenuation relative to free space in dB from Okumuras curve\n", +"Garea=9; // Gain due to type of environment in dB from Okumuras curve\n", +"Ghte=20*log10(hte/200); // Base station antenna heigth gain factor for 1000m > hte > 30m\n", +"Ghre=20*log10(hre/3); // Mobile antenna heigth gain factor for 10m > hre > 3m\n", +"L50=Lf+Amu-Ghte-Ghre-Garea; // Total mean path loss\n", +"\n", +"// The median reeived power\n", +"Pr=EIRP-L50+Gr;\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n The power at receiver = %0.2f dBm',Pr);\n", +"\n", +"//Answer is varrying due to round-off error" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11: To_find_the_mean_path_loss.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 4.11\n", +"// To find the mean path loss\n", +"// Page no. 166\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"d0=1; // Reference distance in m\n", +"d=30; // Distance from transmitter in m\n", +"nSF=3.27; // Exponent value for same floor\n", +"nMF=5.22; // Path loss exponent value for multiple floors\n", +"FAF=24.4; // Floor attenuation factor for specified floor in dB\n", +"n=2; // Number of blocks\n", +"PAF=13; // Particular attenuation factor for paricular obstruction in dB\n", +"PLSFd0=31.5; // Attenuation at reference distance for same floor in dB\n", +"PLMFd0=5.5; // Attenuation at reference distance for multiple floor in dB\n", +"\n", +"//Mean path loss at same floor\n", +"PL1=PLSFd0+10*nSF*log10(d/d0)+FAF+n*PAF;\n", +"\n", +"//Mean path loss at multiple floor\n", +"PL2=PLMFd0+10*nMF*log10(d/d0)+n*PAF;\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n The mean path loss at same floor = %0.1f dB',PL1);\n", +"printf('\n The mean path loss at multiple floor = %0.1f dB',PL2);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: EX4_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 4.1\n", +"// To find far field distance for antenna with maximum dimensions and operating frequency\n", +"// Page No.109\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"D=1; // Maximum dimension in m\n", +"f=900*10^6; // Operating frequency in Hz\n", +"C=3*10^8; // Speed of light in m/sec\n", +"\n", +"lambda=C/f; // Carrier wavelength in m\n", +"\n", +"// To find far field distance\n", +"df=(2*D^2)/lambda; //Far field distance\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n Far field distance = %0.0f meter',df);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: EX4_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 4.2 \n", +"// To find a)transmitter power in dBm b)Transmitter power in dBW and the received power of antenna in dBm at free space distance of 100m from antenna and 10km\n", +"// Page No.109\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Pt=50; // Transmitter power in W\n", +"fc=900*10^6; // Carrier frequency in Hz\n", +"C=3*10^8; // Speed of light in m/s\n", +"\n", +"//a)Transmitter power in dBm\n", +"PtdBm=round(10*log10(Pt/(1*10^(-3)))); //Transmitter power in dBm\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Transmitter power = %0.1f dBm',PtdBm);\n", +"\n", +"//b)Transmitter power in dBW\n", +"PtdBW=round(10*log10(Pt/1)); //Transmitter power in dBW\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Transmitter power = %0.1f dBW',PtdBW);\n", +"\n", +"// To find receiver power at 100m\n", +"Gt=1; //Transmitter gain\n", +"Gr=1; //Receiver gain\n", +"d=100; //Free space distance from antenna in m\n", +"L=1; //System loss factor since no loss in system\n", +"lambda=C/fc; //Carrier wavelength in m\n", +"Pr=(Pt*Gt*Gr*lambda^2)/((4*%pi)^2*d^2*L); //Receiver power in W\n", +"PrdBm=10*log10(Pr/10^(-3)); //Receiver power in dBm\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n Receiver power = %0.1f dBm',PrdBm);\n", +"\n", +"//For Pr(10km)\n", +"d0=100; //Reference distance\n", +"d=10000; //Free space distance from antenna\n", +"Pr10km=PrdBm+20*log10(d0/d); //Received power at 10km from antenna in dBm\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n Receiver power at 10km from antenna = %0.1f dBm',Pr10km);\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: EX4_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example 4.3\n", +"// To find a)power at receiver b)magnitude of E-field at receiver c)rms voltage applied to receiver input\n", +"// Page no. 112\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Pt=50; // Transmitter power in Watt\n", +"fc=900*10^6; // Carrier frequency in Hz\n", +"Gt=1; // Transmitter antenna gain\n", +"Gr=2; // Receiver antenna gain\n", +"Rant=50; // Receiver antenna resistance in ohm\n", +"\n", +"// a)Power at receiver\n", +"d=10*10^3; // Distance from antenna in meter\n", +"lambda=(3*10^8)/fc; // Carrier wavelength in meter\n", +"Prd1=10*log10((Pt*Gt*Gr*lambda^2)/((4*%pi)^2*d^2)); // Power at transmitter in dBW\n", +"Prd=10*log10(((Pt*Gt*Gr*lambda^2)/((4*%pi)^2*d^2))/(10^-3)); // Power at transmitter in dBm\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Power at receiver = %0.1f dBW',Prd1);\n", +"printf('\n Power at receiver = %0.1f dBm',Prd);\n", +"\n", +"// b)Magnitude of E-field at receiver\n", +"Ae=(Gr*lambda^2)/(4*%pi); // Aperture gain\n", +"Pr=10^(Prd1/10); // Receiver power in W\n", +"E=sqrt((Pr*120*%pi)/Ae); // Magnitude of E-field at receiver\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n Magnitude of E-field at receiver = %0.4f V/m',E);\n", +"\n", +"// c)rms voltage applied to receiver input\n", +"Vant=sqrt(Pr*4*Rant)*10^3; // rms voltage applied to receiver input\n", +"//Answer is varrying due to round-off error\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n \n RMS voltage applied to receiver input = %0.3f mV',Vant);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5: To_calculate_the_Brewster_angle.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no. 4.5\n", +"// To calculate the Brewster angle\n", +"// Page no. 119\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Er=4; // Permittivity\n", +"x=sqrt((Er-1)/(Er^2-1)); // Sine of brewster angle\n", +"theta=asind(x); // Brewster angle\n", +"//Answer is varrying due to round off error\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Brewster angle = %0.2f degree',theta);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: EX4_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 4.6\n", +"// To find a)the length and effective aperture of receiving antenna b)the received power at mobile\n", +"// Page no. 125\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"d=5*10^3; // distance of mobile from base station in m\n", +"E0=1*10^-3; // E-field at 1Km from transmitter in V/m\n", +"d0=1*10^3; // Distance from transmitter in m\n", +"f=900*10^6; // Carrier frequency used for the system in Hz\n", +"c=3*10^8; // Speed of ligth in m/s\n", +"gain=2.55; // Gain of receiving antenna in dB\n", +"G=10^(gain/10); // Gain of receiving antenna\n", +"\n", +"// a)To find the length and effective aperture of receiving antenna\n", +"lambda=c/f; // Wavelength\n", +"L=lambda/4; // Length of antenna\n", +"Ae=(G*lambda^2)/(4*%pi); // Effective aperture of receiving antenna\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Length of antenna = %0.4f m',L);\n", +"printf(' = %0.2f cm',L*10^2);\n", +"printf('\n Effective aperture of receiving antenna = %0.3f m^2',Ae);\n", +"\n", +"// b)To find the received power at mobile\n", +"// Given data\n", +"ht=50; // Heigth of transmitting antenna\n", +"hr=1.5; // Heigth of receiving antenna\n", +"ERd=(2*E0*d0*2*%pi*ht*hr)/(d^2*lambda); // Electic field at distance d in V/m\n", +"Prd=((ERd^2/377)*Ae); // The received power at mobile in W\n", +"PrddB=10*log10(Prd); // The received power at mobile in dBW\n", +"PrddBm=10*log10(Prd/10^-3); // The received power at mobile in dBm\n", +"Prd=((ERd^2/377)*Ae)*10^13; // The received power at mobile in 10^-13W\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n \n The received power at mobile = %0.1f X 10^-13 W',Prd);\n", +"printf(' = %0.2f dBW',PrddB);\n", +"printf(' = %0.2f dBm',PrddBm);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: EX4_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 4.7\n", +"// To compute diffraction loss and identify Fresnel zone within which tip of obstruction lies for a)h=25m b)h=0 c)h=-25m\n", +"// Page no. 132\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"lambda=1/3; // Wavelength in meter\n", +"d1=1*10^3; // Distance between transmitter and obstructing screen in m\n", +"d2=1*10^3; // Distance between receiver and obstructing screen in m\n", +"\n", +"// a) For h=25m\n", +"h=25; // Effective heigth of obstruction screen in m\n", +"v=h*sqrt((2*(d1+d2))/(lambda*d1*d2)); // Fresnel diffraction parameter\n", +"printf('\n a) For h=25m Fresnel diffraction parameter v = %0.2f',v);\n", +"printf('\n From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is 22dB.');\n", +"Gd=-20*log10(0.225/v); // Diffraction loss for v>2.4 in dB\n", +"printf('\n Using numerical approximation, diffraction loss for v > 2.4 = %0.1f dB',Gd);\n", +"delta=(h^2/2)*((d1+d2)/(d1*d2)); // Path length difference between direct and diffracted rays\n", +"n=(2*delta)/lambda; // Number of Fresnel zones in which the obstruction lies\n", +"printf('\n Fresnel zone within which tip of obstruction lies = %0.2f',n);\n", +"printf('\n Therefore, the tip of obstruction completely blocks the first three Fresnel zones.');\n", +"\n", +"// b) For h=0\n", +"h=0; // Effective heigth of obstruction screen in m\n", +"v=h*sqrt((2*(d1+d2))/(lambda*d1*d2)); // Fresnel diffraction parameter\n", +"printf('\n \n b) For h=0 Fresnel diffraction parameter v = %0.0f',v);\n", +"printf('\n From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is 6dB.');\n", +"Gd=-20*log10(0.5-0.62*v); // Diffraction loss for v=0 in dB\n", +"printf('\n Using numerical approximation, diffraction loss for v=0 = %0.0f dB',Gd);\n", +"delta=(h^2/2)*((d1+d2)/(d1*d2)); // Path length difference between direct and diffracted rays\n", +"n=(2*delta)/lambda; // Number of Fresnel zones in which the obstruction lies\n", +"printf('\n Fresnel zone within which tip of obstruction lies = %0.0f',n);\n", +"printf('\n Therefore, the tip of obstruction lies in middle of first Fresnel zone.');\n", +"\n", +"// c) For h=-25m\n", +"h=-25; // Effective heigth of obstruction screen in m\n", +"v=h*sqrt((2*(d1+d2))/(lambda*d1*d2)); // Fresnel diffraction parameter\n", +"printf('\n \n c) For h=-25m Fresnel diffraction parameter v = %0.2f',v);\n", +"printf('\n From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is approximately 1dB.');\n", +"Gd=0; // Diffraction loss for v<-1 in dB\n", +"printf('\n Using numerical approximation, diffraction loss for v < -1 = %0.0f in dB',Gd);\n", +"delta=(h^2/2)*((d1+d2)/(d1*d2)); // Path length difference between direct and diffracted rays\n", +"n=(2*delta)/lambda; // Number of Fresnel zones in which the obstruction lies\n", +"printf('\n Fresnel zone within which tip of obstruction lies = %0.2f',n);\n", +"printf('\n Therefore, the tip of obstruction completely blocks the first three Fresnel zones but diffraction loss is negligible.');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8: EX4_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 4.8\n", +"// To determine a)the loss due to knife-edge diffraction b)the heigth of obstacle required to induce 6dB diffraction loss\n", +"// Page no. 133\n", +"\n", +"clc;\n", +"clear;\n", +"\n", +"// Given data\n", +"f=900*10^6; // Operating frequency in Hz\n", +"c=3*10^8; // Speed of ligth in m/s\n", +"hr=25; // Heigth of receiver in m\n", +"ht=50; // Heigth of transmitter in m\n", +"h=100; // Heigth of obstruction in m\n", +"d1=10*10^3; // Distance between transmitter and obstruction in m\n", +"d2=2*10^3; // Distance between receiver and obstruction in m\n", +"\n", +"// a)To determine the loss due to knife-edge diffraction\n", +"lambda=c/f; // Operating wavelength in m\n", +"ht=ht-hr; // Hegth of transmitter after subtracting smallest heigth (hr)\n", +"h=h-hr; // Heigth of obstruction after subtracting smallest heigth (hr)\n", +"bet=atan((h-ht)/d1); // From geometry of environment in rad\n", +"gamm=atan(h/d2); // From geometry of environment in rad\n", +"alpha=bet+gamm; // From geometry of environment in rad\n", +"v=alpha*sqrt((2*d1*d2)/(lambda*(d1+d2))); // Fresnel diffraction parameter\n", +"\n", +"// the loss due to knife-edge diffraction\n", +"Gd=-20*log10(0.225/v); // Diffraction loss for v>2.4 in dB\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The loss due to knife-edge diffraction = %0.1f dB',Gd);\n", +"\n", +"// b)To determine the heigth of obstacle required to induce 6dB diffraction loss\n", +"Gd=6; // Diffraction loss in dB\n", +"v=0; // Fresnel diffraction parameter from the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter\n", +"// v=0 is possible only if alpha=0. Therefore bet=-gamm\n", +"// By considering this situation, the geometry of environment provides (h/d2)=(ht/(d1+d2))\n", +"h=(ht*d2)/(d1+d2); // the heigth of obstacle required to induce 6dB diffraction loss\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The heigth of obstacle required to induce 6dB diffraction loss = %0.2f m',h);\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9: EX4_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 4.9\n", +"// To find a)the minimum mean square error b)the standard deviation about mean value c)received power at d=2 km d)the likelihood that the received signal level at 2 km e) the percentage of area within 2 km \n", +"// Page no. 143\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"d0=100; // First receiver distance in meter\n", +"d1=200; // Second receiver distance in meter\n", +"d2=1000; // Third receiver distance in meter\n", +"d3=3000; // Fourth receiver distance in meter\n", +"p0=0; // Receved power of first receiver in dBm\n", +"p1=-20; // Receved power of second receiver in dBm\n", +"p2=-35; // Receved power of third receiver in dBm\n", +"p3=-70; // Receved power of forth receiver in dBm\n", +"\n", +"// a)To find the minimum mean square error\n", +"n=2887.8/654.306; // Loss exponent after differentiating and equating the squared error function with zero\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Loss exponent = %0.0f',n);\n", +"\n", +"// b)To find the standard deviation about mean value\n", +"P0=-10*n*log10(d0/100); // The estimate of p0 with path loss model\n", +"P1=-10*n*log10(d1/100); // The estimate of p1 with path loss model\n", +"P2=-10*n*log10(d2/100); // The estimate of p2 with path loss model\n", +"P3=-10*n*log10(d3/100); // The estimate of p3 with path loss model\n", +"J=(p0-P0)^2+(p1-P1)^2+(p2-P2)^2+(p3-P3)^2; // Sum of squared error\n", +"SD=sqrt(J/4); // The standard deviation about mean value\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The standard deviation about mean value = %0.2f dB',SD);\n", +"// The decimal point is not given in the answer given in book.\n", +"\n", +"// c)To find received power at d=2 km\n", +"d=2000; // The distance of receiver\n", +"P=-10*n*log10(d/100); // The estimate of p2 with path loss model\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The received power (at d=2 km) = %0.2f dBm',P);\n", +"// Answer is varying due to round off error\n", +"\n", +"// d)To find the likelihood that the received signal level at 2 km\n", +"gam=-60; // The received power at 2km will be greater than this power\n", +"z=(gam-P)/SD;\n", +"Pr=(1/2)*(1-erf(z/sqrt(2))); // The probability that received signal will be greater than -60dBm\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The probability that received signal will be greater than -60dBm = %0.1f percent',Pr*100);\n", +"// Answer is varying due to round off error\n", +"\n", +"// e)To find the percentage of area within 2 km \n", +"A=92; // From figure 4.18, area receives coverage above -60dBm\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The percentage of area within 2 km = %0.0f percent',A);\n", +"\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/5-Mobile_radio_propagation_small_scale_propagation.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/5-Mobile_radio_propagation_small_scale_propagation.ipynb new file mode 100644 index 0000000..125431c --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/5-Mobile_radio_propagation_small_scale_propagation.ipynb @@ -0,0 +1,507 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Mobile radio propagation small scale propagation" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: EX5_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.1\n", +"// To compute received carrier frequency if mobile is moving a)towards the transmitter b)away from the transmitter c)in the direction perpendicular to arrival direction of transmitted signal\n", +"// Page no. 180\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"fc=1850*10^6; // Carrier frequency in Hz\n", +"c=3*10^8; // Speed of ligth in m/s\n", +"v=60; // Speed of receiver (vehicle) in mph\n", +"v=v*0.44704; // Speed of receiver (vehicle) in m/s\n", +"lambda=0.162;//c/f; // Wavelength in m\n", +"\n", +"// a)To compute received carrier frequency if mobile is moving towards the transmitter\n", +"theta=0; // Angle between direction of receiver and transmitter\n", +"fd=(v/lambda)*cos(theta); // Doppler shift\n", +"f=(fc+fd)*10^-6; // Received carrier frequency in MHz\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The received carrier frequency when mobile is moving towards the transmitter = %0.5f MHz',f);\n", +"\n", +"// b)To compute received carrier frequency if mobile is moving away from the transmitter\n", +"theta=180; // Angle between direction of receiver and transmitter\n", +"fd=(v/lambda)*cos(theta); // Doppler shift\n", +"f=(fc+fd)*10^-6; // Received carrier frequency in MHz\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The received carrier frequency when mobile is moving away from the transmitter = %0.6f MHz',f);\n", +"\n", +"// c)To compute received carrier frequency if mobile is moving in the direction perpendicular to arrival direction of transmitted signal\n", +"theta=90; // Angle between direction of receiver and transmitter\n", +"fd=(v/lambda)*cos(theta); // Doppler shift\n", +"f=(fc+fd)*10^-6; // Received carrier frequency in MHz\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The received carrier frequency when mobile is moving in the direction perpendicular to arrival direction of transmitted signal = %0.0f MHz',f);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: To_find_time_delay_width_and_maximum_RF_bandwidth.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.2\n", +"// To find a)time delay width (deltat) b)maximum RF bandwidth\n", +"// Page no. 189\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"tN1=100*10^-6; // Excess delays for RF radio channels\n", +"tN2=4*10^-6; // Excess delays for microcellular channels\n", +"tN3=500*10^-9; // Excess delays for indoor channels\n", +"N=64; // Number of multipath bins\n", +"\n", +"// a)To find time delay width (deltat)\n", +"deltat1=(tN1/N)*10^6; // Time delay width for RF radio channels\n", +"deltat2=(tN2/N)*10^9; // Time delay width for microcellular channels\n", +"deltat3=(tN3/N)*10^9; // Time delay width for indoor channels\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The time delay width for RF radio channels = %0.4f microsecond',deltat1);\n", +"printf('\n The time delay width for microcellular channels = %0.1f nanosecond',deltat2);\n", +"printf('\n The time delay width for indoor channels = %0.4f nanosecond',deltat3);\n", +"\n", +"//b)To find maximum RF bandwidth\n", +"bandwidth1=(2/deltat1); //Maximum RF bandwidth for RF radio channels in MHZ\n", +"bandwidth2=(2/deltat2)*10^3; //Maximum RF bandwidth for microcellular channels in MHZ\n", +"bandwidth3=(2/deltat3)*10^3; //Maximum RF bandwidth for indoor channels in MHZ\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n The maximum RF bandwidth for RF radio channels = %0.2f MHz',bandwidth1);\n", +"printf('\n The maximum RF bandwidth for microcellular channels = %0.0f MHz',bandwidth2);\n", +"printf('\n The maximum RF bandwidth for indoor channels = %0.0f MHz',bandwidth3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: EX5_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.3\n", +"// To find average narrowband power & to compare average narrow band and wideband power\n", +"// Page no. 190\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"v=10; // Velocity of moving mobile\n", +"f=1000*10^6; // Carrier frequency in Hz\n", +"c=3*10^8; // Speed of ligth in air (m/s)\n", +"P1=-70; // Received power of first component in dBm\n", +"P2=P1-3; // Received power of second component in dBm\n", +"theta=0; // Initial phase for both component\n", +"P1=(10^(P1/10))*10^-3; // Received power of first component in Watt\n", +"P2=(10^(P2/10))*10^-3; // Received power of second component in Watt\n", +"lambda=c/f; // Wavelength\n", +"\n", +"// Narrowband instantaneous power \n", +"rt2=(sqrt(P1)*cosd(0)+sqrt(P2)*cosd(0))^2; // Narrowband instantaneous power in pW\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The narrowband instantaneous power = %0.0f pW',rt2*10^12);\n", +"\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// To find average narrowband instantaneous power \n", +"t=0.1; // Time interval in seconds\n", +"theta=((2*%pi*v*t)/lambda)/10; // Phase interval in rad\n", +"theta=theta*(180/%pi); // Phase interval in degree\n", +"theta1=theta; // Phase of first component at t=0.1s\n", +"theta2=-theta; // Phase of second component at t=0.1s\n", +"rt21=(sqrt(P1)*(complex(cosd(theta1),sind(theta1)))+sqrt(P2)*(complex(cosd(theta2),sind(theta2))))^2; // Narrowband instantaneous power in pW at t=0.1s\n", +"mgrt21=sqrt((real(rt21))^2+(imag(rt21))^2);\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The narrowband instantaneous power (at t=0.1s) = %0.1f pW',mgrt21*10^12);\n", +"\n", +"theta1=theta1+theta; // Phase of first component at t=0.2s\n", +"theta2=theta2-theta; // Phase of second component at t=0.2s\n", +"rt22=(sqrt(P1)*(complex(cosd(theta1),sind(theta1)))+sqrt(P2)*(complex(cosd(theta2),sind(theta2))))^2; // Narrowband instantaneous power in pW at t=0.2s\n", +"mgrt22=sqrt((real(rt22))^2+(imag(rt22))^2);\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The narrowband instantaneous power (at t=0.2s) = %0.1f pW',mgrt22*10^12);\n", +"\n", +"theta1=theta1+theta; // Phase of first component at t=0.3s\n", +"theta2=theta2-theta; // Phase of second component at t=0.3s\n", +"rt23=(sqrt(P1)*(complex(cosd(theta1),sind(theta1)))+sqrt(P2)*(complex(cosd(theta2),sind(theta2))))^2; //Narrowband instantaneous power in pW at t=0.3s\n", +"mgrt23=sqrt((real(rt23))^2+(imag(rt23))^2);\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The narrowband instantaneous power (at t=0.3s) = %0.0f pW',mgrt23*10^12);\n", +"\n", +"mgrt24=mgrt21; // Narrowband instantaneous power in pW at t=0.4s due to repeating phase\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The narrowband instantaneous power (at t=0.4s) = %0.1f pW',mgrt24*10^12);\n", +"\n", +"mgrt25=mgrt22; // Narrowband instantaneous power in pW at t=0.5s due to repeating phase\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The narrowband instantaneous power (at t=0.5s) = %0.1f pW',mgrt25*10^12);\n", +"\n", +"rt=(rt2+mgrt21+mgrt22+mgrt23+mgrt24+mgrt25)/6; // The average narrowband instantaneous power in pW\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n An average narrowband instantaneous power = %0.0f pW',rt*10^12);\n", +"\n", +"// Wideband power\n", +"Pwb=(P1+P2); // Widebnd received power in pW\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The wideband received power = %0.0f pW',Pwb*10^12);\n", +"\n", +"printf('\n Comparing narrowband and wideband received power, it is observed that they are vertually identical. But CW signal fades over observation interval (0-0.5S)');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4: To_compute_RMS_delay_spread_and_maximum_bit_rate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Example no 5.4\n", +"//To compute a)RMS delay spread b)maximum bit rate\n", +"//Page no. 201\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"//Given data\n", +"t1=0; //Excess delay of first signal\n", +"a1=0; //Power level of first signal in dB\n", +"t2=1*10^-6; //Excess delay of second signal\n", +"a2=0; //Power level of second signal in dB\n", +"a1=10^(a1); //Power level of first signal in Watt\n", +"a2=10^(a2); //Power level of second signal in Watt\n", +"\n", +"//a)To compute RMS delay spread\n", +"t=((a1*t1+a2*t2)/(a1+a2))*10^6; //Mean excess delay\n", +"t2=((a1*t1^2+a2*t2^2)/(a1+a2))*10^12; //Mean square excess delay\n", +"sigmat=sqrt(t2-t^2); //RMS delay spread in microseconds\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n The RMS delay spread = %0.1f microseconds',sigmat);\n", +"\n", +"//b)To compute maximum bit rate\n", +"Ts=(sigmat*10^-6)/0.1; //Sampling time of BPSK modulated signal\n", +"Rs=(1/Ts)*10^-3; //Maximum bit rate in kbps\n", +"\n", +"//Displaying the result in command window\n", +"printf('\n The maximum bit rate = %0.0f kbps',Rs);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5: To_calculate_mean_excess_delay_rms_delay_spread_and_maximum_excess_delay.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.5\n", +"// To calculate mean excess delay, rms delay spread and maximum excess delay \n", +"// Page no. 202\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"t10dB=5*10^-6; // By definition of maximum excess delay (10dB)\n", +"t1=0; // Excess delay of first signal in seconds\n", +"a1=-20; // Power level of first signal in dB\n", +"t2=1*10^-6; // Excess delay of second signal in seconds\n", +"a2=-10; // Power level of second signal in dB\n", +"t3=2*10^-6; // Excess delay of third signal in seconds\n", +"a3=-10; // Power level of third signal in dB\n", +"t4=5*10^-6; // Excess delay of fourth signal in seconds\n", +"a4=0; // Power level of fourth signal in dB\n", +"a1=10^(a1/10); // Power level of first signal in Watt\n", +"a2=10^(a2/10); // Power level of second signal in Watt\n", +"a3=10^(a3/10); // Power level of third signal in Watt\n", +"a4=10^(a4/10); // Power level of fourth signal in Watt\n", +"\n", +"// Mean excess delay\n", +"t=((a1*t1+a2*t2+a3*t3+a4*t4)/(a1+a2+a3+a4)); // Mean excess delay in seconds\n", +"tsquare=((a1*t1^2+a2*t2^2+a3*t3^2+a4*t4^2)/(a1+a2+a3+a4)); // Mean square excess delay\n", +"\n", +"// RMS delay spread\n", +"sigmat=sqrt(tsquare-t^2); // RMS delay spread\n", +"\n", +"// Coherence bandwidth\n", +"Bc=1/(5*sigmat); // 50% Coherence bandwidth\n", +"// The answer is varrying due to round-off error\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The maximum excess delay (10 dB) = %0.0f microsecond',t10dB*10^6);\n", +"printf('\n The mean excess delay = %0.2f microsecond',t*10^6);\n", +"printf('\n The RMS delay spread = %0.2f microsecond',sigmat*10^6);\n", +"printf('\n The coherence bandwidth = %0.0f KHz',Bc*10^-3);\n", +"printf('\n Since coherence bandwidth is greater than 30 KHz, AMPS will work without an equalizer. However, GSM requires 200 KHz bandwidth which exceeds coherence bandwidth,\n thus an equalizer would be needed for this channel');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.6: EX5_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.6\n", +"// To determine proper spatial sampling interval for small scale propagation, number of samples required over 10m, time required to make these measurements and Doppler spread for this channel\n", +"// Page no. 204\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"fc=1900*10^6; // Carrier frequency in Hz\n", +"v=50; // Velocity of propagation in m/s\n", +"c=3*10^8; // Speed of ligth in air in m/s\n", +"Tc=(9*c)/(16*%pi*v*fc); // Coherence time\n", +"\n", +"// The spatial sampling interval\n", +"deltax=(v*Tc)/2; // Spatial sampling interval in meter\n", +"\n", +"// The number of samples required over 10m travel distance\n", +"d=10; // Distance to be travelled\n", +"Nx=d/deltax; // Number of samples required over 10m\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// The time required to make these measurements\n", +"t=d/v; // Time required to make these measurements\n", +"\n", +"// Doppler spread for this channel\n", +"BD=(v*fc)/c; // Doppler spread for this channel\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The proper spatial sampling interval for small scale propagation = %0.2f cm',deltax*10^2);\n", +"printf('\n The number of samples required over 10m travel distance = %0.0f',Nx);\n", +"printf('\n The time required to make these measurements = %0.1f seconds',t);\n", +"printf('\n The Doppler spread for this channel = %0.2f Hz',BD);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.7: To_compute_the_positive_going_lvel_crossing_rate_and_maximum_velocity_of_mobile.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.7\n", +"// To compute the positive-going lvel crossing rate and maximum velocity of mobile\n", +"// Page no. 224\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"rho=1; // Value of normalized level of fading amplitude to rms amplitude\n", +"fm=20; // Maximum Doppler frequency in Hz\n", +"fc=900*10^6; // Carrier frequency in Hz\n", +"c=3*10^8; // Speed of ligth in air in m/s\n", +"\n", +"// The positive-going level crossing rate\n", +"NR=sqrt(2*%pi)*fm*rho*exp(-rho^2); // Number of zero level crossings per second\n", +"lambda=c/fc; // Carrier wavelength\n", +"\n", +"// The maximum velocity of mobile\n", +"v=fm*lambda; // Maximum velocity of mobile in m/s\n", +"v=v*(18/5); // Maximum velocity of mobile in km/hr\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The positive-going level crossing rate = %0.2f crossings per second',NR);\n", +"printf('\n The maximum velocity of mobile = %0.0f Km/Hr',v);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.8: To_find_the_average_fade_duration.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.8\n", +"// To find the average fade duration\n", +"// Page no. 225\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"rho1=0.01; // Threshold level\n", +"rho2=0.1; // Threshold level\n", +"rho3=1; // Threshold level\n", +"fm=200; // Doppler frequency\n", +"\n", +"t1=(exp(rho1^2)-1)/(rho1*fm*sqrt(2*%pi)); // The average fade duration\n", +"t2=(exp(rho2^2)-1)/(rho2*fm*sqrt(2*%pi)); // The average fade duration\n", +"t3=(exp(rho3^2)-1)/(rho3*fm*sqrt(2*%pi)); // The average fade duration\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The average fade duration (for rho = 0.01) = %0.1f microseconds',t1*10^6);\n", +"printf('\n The average fade duration (for rho = 0.1) = %0.0f microseconds',t2*10^6);\n", +"printf('\n The average fade duration (for rho = 1) = %0.2f microseconds',t3*10^3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.9: EX5_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 5.9\n", +"// To find the average fade duration and average number of bit errors per second. & to determine whether the fading is slow or fast.\n", +"// Page no. 225\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"rho=0.707; // Threshold level\n", +"fm=20; // Doppler frequency\n", +"datarate=50; // Bit duration of binary digital modulation in bps\n", +"errho=0.1; // Threshold level below which bit error occurs\n", +"\n", +"t=(exp(rho^2)-1)/(rho*fm*sqrt(2*%pi)); // The average fade duration \n", +"tb=1/datarate; // Bit period\n", +"t1=(exp(errho^2)-1)/(errho*fm*sqrt(2*%pi)); // The average fade duration \n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The average fade duration (for rho = 0.707) = %0.1f ms',t*10^3);\n", +"printf('\n The bit period = %0.0f ms',tb*10^3);\n", +"printf('\n Since the bit period is greater than average fade duration, for 50bps datarate the signal undergoes fast Rayleigh fading.');\n", +"printf('\n \n The average fade duration of the threshold level below which bit error occurs (for rho = 0.1) = %0.3f',t1);\n", +"printf('\n Since the average fade duration of the threshold level below which bit error occurs is less than duration of one bit,\n only one bit on average will be lost');" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/6-Modulation_techniques_for_mobile_radio.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/6-Modulation_techniques_for_mobile_radio.ipynb new file mode 100644 index 0000000..4f07190 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/6-Modulation_techniques_for_mobile_radio.ipynb @@ -0,0 +1,544 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Modulation techniques for mobile radio" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: EX6_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.10\n", +"// To demonstrate how the received signal is detected properly using baseband differential detector.\n", +"// Page no. 310\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"x1=-0.707;\n", +"y1=-0.707;\n", +"x2=0.707;\n", +"y2=-0.707;\n", +"x3=0.707;\n", +"y3=0.707;\n", +"\n", +"if x1<0 then // Applying decision rule\n", +"printf('S1 = 0');\n", +"else\n", +"printf('\n S1 = 1'); \n", +"end \n", +"if y1<0 then\n", +"printf('\n S2 = 0');\n", +"else\n", +"printf('\n S2 = 1'); \n", +"end \n", +"if x2<0 then\n", +"printf('\n S3 = 0');\n", +"else\n", +"printf('\n S3 = 1'); \n", +"end \n", +"if y2<0 then\n", +"printf('\n S4 = 0');\n", +"else\n", +"printf('\n S4 = 1'); \n", +"end \n", +"if x3<0 then\n", +"printf('\n S5 = 0');\n", +"else\n", +"printf('\n S5 = 1'); \n", +"end \n", +"if y3<0 then\n", +"printf('\n S6 = 0');\n", +"else\n", +"printf('\n S6 = 1'); \n", +"end " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11: EX6_11.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.11\n", +"// To find 3-dB bandwidth for gaussian low pass filter to produce 0.25GMSK, 90% power bandwidth.\n", +"// Page no. 321\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Rb=270*10^3; // Channel data rate in bps\n", +"BT=0.25; // 3-dB bandwidth-bit duration product\n", +"\n", +"T=1/Rb; // Time\n", +"B=BT/T; // 3-dB bandwidth in Hz\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// 90% power bandwidth\n", +"B1=0.57*Rb; // The 90% power bandwidth\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The 3-dB bandwidth-bit duration product = %0.3f kHz',B*10^-3);\n", +"printf('\n The 90 percent power bandwidth = %0.1f kHz',B1*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: EX6_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.1\n", +"// To compute the carrier power, percentage of total power in carrier power and power in each sideband.\n", +"// Page no. 260\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"PAM=10*10^3; // Power of transmitted AM signal\n", +"k=0.6; // Modulation index\n", +"\n", +"// To compute the carrier power\n", +"Pc=PAM/(1+k^2/2); // The carrier power\n", +"\n", +"// To compute percentage of total power in carrier power\n", +"PercentPc=(Pc/PAM)*100; // Percentage of total power in carrier power\n", +"\n", +"// To compute power in each sideband\n", +"Psideband=(PAM-Pc)/2; // The power in each sideband\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The carrier power = %0.2f kW',Pc*10^-3);\n", +"printf('\n The percentage of total power in carrier power = %0.1f percentage',PercentPc);\n", +"printf('\n The power in each sideband = %0.3f kW',Psideband*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: To_compute_the_peak_frequency_deviation_and_the_modulation_index.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.2\n", +"// To compute a)the peak frequency deviation b)the modulation index.\n", +"// Page no. 265\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"kf=10*10^3; // Frequency deviation constant gain in Hz/V\n", +"fm=4*10^3; // Modulating frequency in Hz\n", +"A=4; // Maximum instantaneous value of input signal in V\n", +"\n", +"// To compute the peak frequency deviation\n", +"deltaf=A*kf; // The peak frequency deviation in Hz\n", +"\n", +"// To compute the modulation index\n", +"betaf=deltaf/fm; // The modulation index\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The peak frequency deviation = %0.0f kHz',deltaf*10^-3);\n", +"printf('\n The modulation index = %0.0f',betaf);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: To_determine_the_IF_bandwidth_necessary_to_pass_the_given_signal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.3\n", +"// To determine the IF bandwidth necessary to pass the given signal.\n", +"// Page no. 267\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"fm=100*10^3; // Modulating frequency in Hz\n", +"deltaf=500*10^3; // Peak frequency deviation in Hz\n", +"betaf=deltaf/fm; // Modulation index\n", +"\n", +"// The IF bandwidth occupied by FM signal using Carson's rule\n", +"BT=2*(betaf+1)*fm; // The IF bandwidth necessary to pass the given signal\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Using Carson rule, the IF bandwidth occupied by FM signal = %0.0f kHz',BT*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: To_design_an_RLC_network_that_implements_an_IF_quadrature_FM_detector.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.4\n", +"// To design an RLC network that implements an IF quadrature FM detector \n", +"// Page no. 273\n", +"\n", +"clc;\n", +"clear all;\n", +"close;\n", +"\n", +"// Given data\n", +"fc=10.7*10^6; //Cut-off frequency in Hz\n", +"B=500*10^3; //Bandwidth in Hz\n", +"phi=5; //phase shift for good system in degree\n", +"Q=tand(phi)/((fc+B/2)/fc-fc/(fc+B/2)); //Q-factor\n", +"L=10*10^(-6); //Chosen value of inductor\n", +"R=Q*2*%pi*fc*L; //Value of Resistor\n", +"c1=12.13*10^(-12); //Chosen value of C1\n", +"c=(Q/(R*2*%pi*fc))-c1; //Value of capacitor\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Value of Resistor required for RLC circuit = %0.3f kohm',R*10^(-3));\n", +"printf('\n Value of Inductor required for RLC circuit = %0.0f microH',L*10^(6));\n", +"printf('\n Value of Capacitor required for RLC circuit = %0.0f pF',c*10^(12));\n", +"\n", +"// Magnitude plot\n", +"f=0.95*10^7:0.05*10^7:1.2*10^7; // Frequency range for plotting in Hz\n", +"mgh=(2*%pi*f*R*c1)/sqrt(1+Q^2*((f^2-fc^2)/(f*fc))^2); // Magnitude transfer function\n", +"subplot(211);\n", +"plot(f,mgh);\n", +"a=gca();\n", +"a.data_bounds=[0.95*10^7 0;1.2*10^7 2]; // To see the vertical line hiddden by the y axis\n", +"xlabel('Frequency','color','blue');\n", +"ylabel('Magnitude','color','blue');\n", +"title('Magnitude response','fontsize','6','color','red');\n", +"\n", +"// Phase plot\n", +"f=0.95*10^7 // Initial frequency for plotting\n", +"for i=1:6\n", +" if f<1.25*10^7 then\n", +" phH(i)=(%pi/2)+atan(Q*((f^2-fc^2)/(f*fc))); // Phase transfer function\n", +" f=f+0.05*10^7;\n", +" end\n", +"end\n", +"\n", +"f=0.95*10^7:0.05*10^7:1.2*10^7;\n", +"subplot(212);\n", +"plot(f,phH);\n", +"a=gca();\n", +"a.data_bounds=[0.95*10^7 1.2;1.2*10^7 2]; // To see the vertical line hiddden by the y axis\n", +"xlabel('Frequency','color','blue');\n", +"ylabel('Phase','color','blue');\n", +"title('Phase response','fontsize','10','color','red');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: EX6_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.5\n", +"// To determine the analog bandwidth, output SNR improvement if modulation index is increased from 3 to 5 and tradeoff bandwidth for this improvement.\n", +"// Page no. 277\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"fm=5*10^3; // Audio bandwidth of FM signal\n", +"betaf1=3; // Initial modulation index\n", +"betaf2=5; // Final modulation index\n", +"\n", +"// To determine analog bandwidth\n", +"BT1=2*(betaf1+1)*fm; // The analog bandwidth\n", +"BT2=2*(betaf2+1)*fm; // The analog bandwidth\n", +"\n", +"// To determine output SNR improvement factor\n", +"SNR1=3*betaf1^3+3*betaf1^2; // Output SNR factor for modulation index=3\n", +"SNR1=10*log10(SNR1); // Output SNR factor for modulation index=3 in dB\n", +"SNR2=3*betaf2^3+3*betaf2^2; // Output SNR factor for modulation index=3\n", +"SNR2=10*log10(SNR2); // Output SNR factor for modulation index=3 in dB\n", +"\n", +"// To determine improvement in output SNR by increasing modulation index\n", +"improvedSNR=SNR2-SNR1; // Improvement in output SNR by increasing modulation index\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Using Carson rule, the analog bandwidth at 3 modulation index occupied by FM signal = %0.0f KHz',BT1*10^-3);\n", +"printf('\n Using Carson rule, the analog bandwidth at 5 modulation index occupied by FM signal = %0.0f KHz',BT2*10^-3);\n", +"printf('\n Improvement in output SNR by increasing modulation index = %0.1f dB',improvedSNR);\n", +"printf('\n \n This improvement is achieved at the expenses of bandwidth. For modulation index = 3, a bandwidth of 40kHz is needed,\n while for modulation index = 5 requires bandwidth = 60kHz.');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: EX6_6.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.6\n", +"// To determine the maximum theoretical datarate and to compare this rate to US digital cellular standard\n", +"// Page no. 280\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"SNR=20; // Signal to noise ratio of wireless communication link in dB\n", +"B=30*10^3; // RF bandwidth in Hz\n", +"SNR=10^(SNR/10); // Signal to noise ratio of wireless communication link\n", +"\n", +"// To determine the maximum theoretical datarate \n", +"C=B*(log10(1+SNR)/log10(2)); // The maximum theoretical datarate in bps\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The maximum theoretical datarate = %0.2f kbps',C*10^-3);\n", +"printf('\n The USDC data rate is 48.6 kbps, which is only about one fourth the theoretical limit under 20dB SNR condition.');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7: EX6_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.7\n", +"// To determine the maximum theoretical datarate and to compare this rate to GSM standard\n", +"// Page no. 280\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"SNR1=10; // Signal to noise ratio in dB\n", +"SNR2=30; // Signal to noise ratio in dB\n", +"B=200*10^3; // RF bandwidth of channel in Hz\n", +"\n", +"SNR1=10^(SNR1/10); // Signal to noise ratio\n", +"SNR2=10^(SNR2/10); // Signal to noise ratio\n", +"\n", +"// To determine the maximum theoretical datarate\n", +"C1=B*(log10(1+SNR1)/log10(2)); // The maximum theoretical datarate for SNR=10dB\n", +"C2=B*(log10(1+SNR2)/log10(2)); // The maximum theoretical datarate for SNR=30dB\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The maximum theoretical datarate for 10dB SNR = %0.3f kbps',C1*10^-3);\n", +"printf('\n The maximum theoretical datarate for 30dB SNR = %0.2f Mbps',C2*10^-6);\n", +"printf('\n \n The GSM data rate is 270.833 kbps, which is only about 40 percent of the theoretical limit of 10dB SNR condition\n and about 14 percent of theoretical limit of 30dB SNR condition');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8: EX6_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.8\n", +"// To find the first zero-crossing RF bandwidth of rectangular pulse and compare to raised cosine filter pulse\n", +"// Page no. 291\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"RectTs=41.06*10^-6; // Symbol period of rectangular pulse\n", +"cosineTs=41.06*10^-6; // Symbol period of cosine filter pulse\n", +"alpha=0.35; // Rolloff factor of cosine filter pulse\n", +"\n", +"// To find the first zero-crossing RF bandwidth of rectangular pulse\n", +"B1=2/RectTs; // The first zero-crossing RF bandwidth of rectangular pulse\n", +"\n", +"// The first zero-crossing RF bandwidth of cosine filter pulse\n", +"B2=(1/cosineTs)*(1+alpha); // The first zero-crossing RF bandwidth of cosine filter pulse\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The first zero-crossing RF bandwidth of rectangular pulse = %0.2f kHz',B1*10^-3);\n", +"printf('\n The first zero-crossing RF bandwidth of cosine filter pulse = %0.2f kHz',B2*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9: EX6_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 6.9\n", +"// To determine phase and values of Ik and Qk during transmission of bit stream 001011 using pi/4 DQPSK.\n", +"// Page no. 307\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"theta0=0; // Initial phase in rad\n", +"phi1=%pi/4; // Carrier phase shift for the input bit pair 11 [Feh91], [Rap91b]\n", +"phi2=(3*%pi)/4; // Carrier phase shift for the input bit pair 01 [Feh91], [Rap91b]\n", +"phi3=(-3*%pi)/4; // Carrier phase shift for the input bit pair 00 [Feh91], [Rap91b]\n", +"phi4=-%pi/4; // Carrier phase shift for the input bit pair 10 [Feh91], [Rap91b]\n", +"\n", +"// For transmission of first pair of bits 00\n", +"theta1=theta0+phi3; // Phase of signal during transmission of first bit pair 00\n", +"I1=cos(theta1); // In-phase pulse produced at the output of signal mapping\n", +"Q1=sin(theta1); // Quadrature pulse produced at the output of signal mapping\n", +"\n", +"// For transmission of second pair of bits 10\n", +"theta2=theta1+phi4; // Phase of signal during transmission of second bit pair 10\n", +"I2=cos(theta2); // In-phase pulse produced at the output of signal mapping\n", +"Q2=sin(theta2); // Quadrature pulse produced at the output of signal mapping\n", +"\n", +"// For transmission of third pair of bits 11\n", +"theta3=theta2+phi1; // Phase of signal during transmission of third bit pair 11\n", +"I3=cos(theta3); // In-phase pulse produced at the output of signal mapping\n", +"Q3=sin(theta3); // Quadrature pulse produced at the output of signal mapping\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Phase of signal during transmission of first bit pair 00 = %0.0f degree',theta1*(180/%pi));\n", +"printf('\n In-phase pulse produced during transmission of first bit pair 00 = %0.3f',I1);\n", +"printf('\n Quadrature pulse produced during transmission of first bit pair 00 = %0.3f',Q1);\n", +"\n", +"printf('\n \n Phase of signal during transmission of second bit pair 10 = %0.0f degree',theta2*(180/%pi));\n", +"printf('\n In-phase pulse produced during transmission of second bit pair 10 = %0.0f',I2);\n", +"printf('\n Quadrature pulse produced during transmission of second bit pair 10 = %0.0f',Q2);\n", +"\n", +"printf('\n \n Phase of signal during transmission of third bit pair 11 = %0.0f degree',theta3*(180/%pi));\n", +"printf('\n In-phase pulse produced during transmission of third bit pair 11 = %0.3f',I3);\n", +"printf('\n Quadrature pulse produced during transmission of third bit pair 11 = %0.3f',Q3);" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/7-Equalization_diversity_and_channel_coding.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/7-Equalization_diversity_and_channel_coding.ipynb new file mode 100644 index 0000000..05f3834 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/7-Equalization_diversity_and_channel_coding.ipynb @@ -0,0 +1,121 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Equalization diversity and channel coding" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: EX7_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 7.3\n", +"// To determine a)the maximum Doppler shift b)the coherence time of the channel c)the maximum number of symbolsthat could be transmitted\n", +"// Page no. 373\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"//Given data\n", +"f=900*10^6; // Carrier frequency in Hz\n", +"c=3*10^8; // Speed of ligth in air (m/s)\n", +"v=80; // Velocity of mobile in km/hr\n", +"v=v*(5/18); // Velocity of mobile in m/s\n", +"lambda=c/f; // Carrier wavelength in meter\n", +"\n", +"// a)To determine the maximum Doppler shift\n", +"fd=v/lambda; // The maximum Doppler shift in Hz\n", +"\n", +"// b)To determine the coherence time of the channel\n", +"Tc=sqrt(9/(16*%pi*fd^2)); // The coherence time of the channel\n", +"// Answer is varrying due to round-off error\n", +"\n", +"// c)To determine the maximum number of symbols that could be transmitted with symbol rate 24.3 ksymbols/sec\n", +"Rs=24.3*10^3; // Symbol rate in symbols/sec\n", +"Nb=Tc*Rs; // The maximum number of transmitted symbols\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The maximum Doppler shift = %0.2f Hz',fd);\n", +"printf('\n The coherence time of the channel = %0.2f ms',Tc*10^3);\n", +"printf('\n The maximum number of symbols that could be transmitted with symbol rate 24.3 ksymbols/sec = %0.0f symbols',Nb);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: To_determine_probability_that_the_SNR_will_drop_below_threshold_SNR.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 7.4\n", +"// To determine probability that the SNR will drop below threshold SNR\n", +"// Page no. 383\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"M1=4; // Number of branch diversity\n", +"M2=1; // Number of branch diversity\n", +"gamm=10; // Specified SNR threshold in dB\n", +"gamm=10^(gamm/10); // Specified SNR threshold\n", +"Gamma=20; // Average SNR in dB\n", +"Gamma=10^(Gamma/10); // Average SNR\n", +"\n", +"// Probability that the SNR will drop below 10dB when 4 branch diversity is used\n", +"P4=(1-exp(-gamm/Gamma))^M1; // Probability that the SNR will drop below 10dB\n", +"\n", +"// Probability that the SNR will drop below 10dB when single branch diversity is used\n", +"P1=(1-exp(-gamm/Gamma))^M2; // Probability that the SNR will drop below 10dB\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Probability that the SNR will drop below 10dB when 4 branch diversity is used = %0.6f',P4);\n", +"printf('\n Probability that the SNR will drop below 10dB when single branch diversity is used = %0.3f',P1);\n", +"printf('\n \n From above results, it is observed that without diversity the SNR drops below the specified threshold with a probability that is three orders of magnitude greater \n than if four branch diversity is used.')" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/8-Speech_coding.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/8-Speech_coding.ipynb new file mode 100644 index 0000000..aa06717 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/8-Speech_coding.ipynb @@ -0,0 +1,266 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Speech coding" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: EX8_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 8.1\n", +"// To compute the mean square error distortion and output signal-to-distortion ratio.\n", +"// Page no. 420\n", +"\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"//Given data\n", +"l1=1; // 1st Quantization level\n", +"l2=3; // 2nd Quantization level\n", +"l3=5; // 3rd Quantization level\n", +"l4=7; // 4th Quantization level\n", +"\n", +"U1=(l1+l2)/2; // upper boundary of 1st level\n", +"U2=(l2+l3)/2; // upper boundary of 2nd level\n", +"U3=(l3+l4)/2; // upper boundary of 3rd level\n", +"U4=l4+(U1-l1); // upper boundary of 4th level\n", +"L1=l1-(U1-l1); // Lower boundary of 1st level\n", +"\n", +"D1=integrate('(x^3-2*x^2+x)/32','x',L1,U1); // Mean square error distortion of 1st level\n", +"D2=integrate('(x^3-6*x^2+9*x)/32','x',U1,U2); // Mean square error distortion of 2nd level\n", +"D3=integrate('(x^3-10*x^2+25*x)/32','x',U2,U3); // Mean square error distortion of 3rd level\n", +"D4=integrate('(x^3-14*x^2+49*x)/32','x',U3,U4); // Mean square error distortion of 4th level\n", +"D=D1+D2+D3+D4; // Total square error distortion\n", +"\n", +"P=integrate('x^3/32','x',L1,U4); // Signal power\n", +"\n", +"SDR=10*log10(P/D); // Output signal-to-distortion ratio.\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The mean square error distortion = %0.3f',D);\n", +"printf('\n The output signal-to-distortion ratio = %0.2f dB',SDR);\n", +"printf('\n To minimize the distortion, we need to place the quantization levels closer at amplitudes close to 8 and farther at amplitudes close to zero.');\n", +"printf('\n This quantizer would be optimal for an input with a uniform pdf.');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: EX8_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 8.2\n", +"// To compute transmission bit rate, average and peak signal to quantization noise ratio\n", +"// Page no. 424\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"fs=8*10^3; // Sampling frequency in Hz\n", +"n=8; // Number of bits per sample\n", +"stepsize=10*10^-3; // Time after which step size is recomputed\n", +"overhead=5; // Number of overhead bits\n", +"\n", +"N=fs*n; // Number of information bits pe second\n", +"Toverhead=overhead/stepsize; // The number of overhead bits/second\n", +"\n", +"// Effective transmission bit rate\n", +"bitrate=N+Toverhead; // Transmission bit rate in bps\n", +"\n", +"// Peak signal to quantization noise ratio\n", +"PSQNR=6.02*n+4.77; // Peak signal to quantization noise ratio in dB\n", +"\n", +"// Average signal to quantization noise ratio\n", +"ASQNR=6.02*n; // Average signal to quantization noise ratio in dB\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Effective transmission bit rate = %0.1f kbps',bitrate*10^-3);\n", +"printf('\n Peak signal to quantization noise ratio = %0.2f dB',PSQNR);\n", +"printf('\n Average signal to quantization noise ratio = %0.2f dB',ASQNR);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: To_compute_the_minimum_encoding_rateof_given_4_sub_band_coder.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 8.3\n", +"// To compute the minimum encoding rateof given 4 sub-band coder\n", +"// Page no. 427\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"N=4; // Total number of sub-bands\n", +"L1=225; // Lower limit of first sub-band\n", +"U1=450; // Lower limit of first sub-band\n", +"L2=450; // Lower limit of second sub-band\n", +"U2=900; // Lower limit of second sub-band\n", +"L3=1000; // Lower limit of third sub-band\n", +"U3=1500; // Lower limit of third sub-band\n", +"L4=1800; // Lower limit of fourth sub-band\n", +"U4=2700; // Lower limit of fourth sub-band\n", +"E1=4; // Encoding bit of first sub-band\n", +"E2=3; // Encoding bit of second sub-band\n", +"E3=2; // Encoding bit of third sub-band\n", +"E4=1; // Encoding bit of fourth sub-band\n", +"\n", +"// Sampling rate of the sub-bands according to Nyquist theorem\n", +"sr1=2*(U1-L1); // Sampling rate of first sub-band in samples/second\n", +"sr2=2*(U2-L2); // Sampling rate of second sub-band in samples/second\n", +"sr3=2*(U3-L3); // Sampling rate of third sub-band in samples/second\n", +"sr4=2*(U4-L4); // Sampling rate of fourth sub-band in samples/second\n", +"\n", +"// Total encoding rate\n", +"SR=sr1*E1+sr2*E2+sr3*E3+sr4*E4; // Total encoding rate in bps\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Total encoding rate = %0.1f kbps',SR*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: To_find_the_upper_bound_of_the_transmission_bit_rate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 8.4\n", +"// To find the upper bound of the transmission bit rate\n", +"// Page no. 439\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"FL=810*10^6; // Lower limit of forward channel frequency band\n", +"FU=826*10^6; // Upper limit of forward channel frequency band\n", +"N=1150; // Number of simultaneous users;\n", +"SE=1.68; // Spectral efficiency in bps/Hz\n", +"CR=0.5; // Coder rate\n", +"bandused=90/100; // 90% bandwidth is used\n", +"\n", +"bandwidth=bandused*(FU-FL); // Total bandwidth available for traffic channels in Hz\n", +"Cbandwidth=bandwidth/N; // Maximum channel bandwidth in Hz\n", +"ChannelDR=SE*Cbandwidth; // Maximum channel data rate in bps\n", +"DR=ChannelDR*CR; // Maximum net data rate in bps\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Maximum net data rate = %0.1f kbps',DR*10^-3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5: To_compute_the_gross_channel_data_rate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 8.5\n", +"// To compute the gross channel data rate\n", +"// Page no. 439\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"t=20*10^-3; // Duration of encoding of one block in second\n", +"B1=50; // The first bits in Type-1 channel\n", +"CRC1=10; // Number of CRC bits in Type-1 channel\n", +"FEC=0.5; // FEC rate for Type-1 channel\n", +"B2=132; // Next bits in Type-2 channel\n", +"CRC2=5; // Number of CRC bits in Type-2 channel\n", +"B3=78; // The last bits in Type-3 channel\n", +"\n", +"N1=(B1+CRC1)/FEC; // Total number of bits transmitted in Type-1 channel\n", +"N2=(B2+CRC2); // Total number of bits transmitted in Type-2 channel\n", +"N3=B3; // Total number of bits transmitted in Type-3 channel\n", +"N=N1+N2+N3; // Total number of channel bits transmitted enery t seconda\n", +"\n", +"// The gross channel data rate\n", +"BR=N/t; // The gross channel data rate in bps\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The gross channel bit rate = %0.2f kbps',BR*10^-3);" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/9-Multiple_access_techniques_for_wireless_communications.ipynb b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/9-Multiple_access_techniques_for_wireless_communications.ipynb new file mode 100644 index 0000000..43b22f2 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T_S_Rappaport/9-Multiple_access_techniques_for_wireless_communications.ipynb @@ -0,0 +1,383 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Multiple access techniques for wireless communications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: To_find_the_intermodulation_frequencies_generated.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.1\n", +"// To find the intermodulation frequencies generated \n", +"// Page no. 451\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"f1=1930; // First carrier frequency\n", +"f2=1932; // second carrier frequency\n", +"F1=1920; // Lower frequency of the band\n", +"F2=1940; // Upper frequency of the band\n", +"\n", +"for n=0:3\n", +" x1=(2*n+1)*f1-2*n*f2\n", +" if x1 < = F2 then\n", +" printf('\n IF frequency %0.0f MHz lies inside the band',x1);\n", +" else\n", +" printf('\n IF frequency %0.0f MHz lies outside the band',x1);\n", +" end\n", +"end\n", +"\n", +"for n=0:3\n", +" x2=(2*n+2)*f1-(2*n+1)*f2\n", +" if x2 < = F2 then\n", +" printf('\n IF frequency %0.0f MHz lies inside the band',x2);\n", +" else\n", +" printf('\n IF frequency %0.0f MHz lies outside the band',x2);\n", +" end\n", +"end\n", +"\n", +"for n=0:3\n", +" x3=(2*n+1)*f2-2*n*f1\n", +" if x3 < = F2 then\n", +" printf('\n IF frequency %0.0f MHz lies inside the band',x3);\n", +" else\n", +" printf('\n IF frequency %0.0f MHz lies outside the band',x3);\n", +" end\n", +"end\n", +"\n", +"for n=0:3\n", +" x4=(2*n+2)*f2-(2*n+1)*f1\n", +" if x4 < = F2 then\n", +" printf('\n IF frequency %0.0f MHz lies inside the band',x4);\n", +" else\n", +" printf('\n IF frequency %0.0f MHz lies outside the band',x4);\n", +" end\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: To_find_number_of_channels_available.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.2\n", +"// To find number of channels available\n", +"// Page no. 452\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Bt=12.5*10^6; // Total spectrum allocation in Hz\n", +"Bguard=10*10^3; // Guard band allocated in Hz\n", +"Bc=30*10^3; // Channel bandwidth in Hz\n", +"\n", +"// The number of channels available\n", +"N=(Bt-2*Bguard)/Bc; // The number of channels available\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The number of channels available in FDMA system = %0.0f',N);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: To_find_number_of_simultaneous_users_accommodated_in_GSM.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.3\n", +"// To find number of simultaneous users accommodated in GSm\n", +"// Page no. 455\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"m=8; // Maximum speech channels supported by single radio channel\n", +"Bc=200*10^3; // Radio channel bandwidth in Hz\n", +"Bt=25*10^6; // Total spectrum allocated for forward link\n", +"Bguard=0; // Guard band allocated in Hz\n", +"\n", +"// The number of simultaneous users accommodated in GSm\n", +"N=(m*(Bt-2*Bguard))/Bc; // The number of simultaneous users\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The number of simultaneous users accommodated in GSM system = %0.0f',N);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: EX9_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.4\n", +"// To find a)the time duration of a bit b)the time duration of a slot c)the time duration of a frame d)how long must a user occupying single time slot wait between two successive transmission\n", +"// Page no. 456\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"N=8; // Number of time slots in each frame\n", +"Nb=156.25; // Number of in each time slot\n", +"DR=270.833*10^3; // Data rate of transmission in channel\n", +"\n", +"// a)To find the time duration of a bit \n", +"Tb=1/DR; // The time duration of a bit in sec\n", +"\n", +"// b)To find the time duration of a slot\n", +"Tslot=Nb*Tb; // The time duration of a slot\n", +"\n", +"// c)To find the time duration of a frame\n", +"Tf=N*Tslot; // The time duration of a frame\n", +"\n", +"//d) The waiting time between two successive transmission\n", +"Tw=Tf; // The arrival time of new frame for its next transmission\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The time duration of a bit = %0.3f microseconds',Tb*10^6);\n", +"printf('\n The time duration of a slot = %0.3f ms',Tslot*10^3);\n", +"printf('\n The time duration of a frame = %0.3f ms',Tf*10^3);\n", +"printf('\n The arrival time of new frame for its next transmission = %0.3f ms',Tw*10^3);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5: To_find_the_frame_efficiency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.5\n", +"// To find the frame efficiency\n", +"// Page no. 456\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"Btrail=6; // Number of trailing bits per slot\n", +"Bg=8.25; // Number of guard bits per slot\n", +"Btrain=26; // Number of training bits per slot\n", +"Nb=2; // Number of burst\n", +"Bburst=58; // Number of bits in each burst\n", +"Nslot=8; // Number of slots in each frame\n", +"\n", +"N=Btrail+Bg+Btrain+2*Bburst; // Total number of bits in each slot\n", +"Nf=Nslot*N; // Total number of bits in a frame\n", +"bOH=Nslot*Btrail+Nslot*Bg+Nslot*Btrain; // Number of overhead bits per frame\n", +"\n", +"// To find the frame efficiency\n", +"nf=(1-(bOH/Nf))*100; // Frame efficiency\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The frame efficiency = %0.2f percentage',nf);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: To_determine_the_maximum_throughput_using_ALOHA_and_slotted_ALOHA.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.6\n", +"// To determine the maximum throughput using ALOHA and slotted ALOHA\n", +"// Page no. 466\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"//The maximum throughput using ALOHA\n", +"Rmax=1/2; //Maximum rate of arrival calculated by equating ALOHA throughput formula derivative to zero\n", +"T=Rmax*exp(-1); //The maximum throughput using ALOHA\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The maximum throughput using ALOHA = %0.4f',T);\n", +"\n", +"//The maximum throughput using slotted ALOHA\n", +"Rmax=1; //Maximum rate of arrival calculated by equating slotted ALOHA throughput formula derivative to zero\n", +"T=Rmax*exp(-1); //The maximum throughput using slotted ALOHA\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n The maximum throughput using slotted ALOHA = %0.4f',T);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: EX9_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.7\n", +"// To evaluate 4 different radio standards and to choose the one with maximum capacity\n", +"// Page no. 472\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"ABc=30*10^3; // Channel bandwidth of system A\n", +"ACImin=18; // The tolerable value of carrier to interference ratio for system A\n", +"BBc=25*10^3; // Channel bandwidth of system B\n", +"BCImin=14; // The tolerable value of carrier to interference ratio for system B\n", +"CBc=12.5*10^3; // Channel bandwidth of system C\n", +"CCImin=12; // The tolerable value of carrier to interference ratio for system C // Value of CCImin is given wrong in book\n", +"DBc=6.25*10^3; // Channel bandwidth of system D\n", +"DCImin=9; // The tolerable value of carrier to interference ratio for system D\n", +"Bc=6.25*10^3; // Bandwidth of particular system\n", +"\n", +"ACIeq=ACImin+20*log10(Bc/ABc); // Minimum C/I for system A when compared to the (C/I)min for particular system\n", +"BCIeq=BCImin+20*log10(Bc/BBc); // Minimum C/I for system B when compared to the (C/I)min for particular system\n", +"CCIeq=CCImin+20*log10(Bc/CBc); // Minimum C/I for system C when compared to the (C/I)min for particular system\n", +"DCIeq=DCImin+20*log10(Bc/DBc); // Minimum C/I for system D when compared to the (C/I)min for particular system\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Minimum C/I for system A when compared to the (C/I)min for particular system = %0.3f dB',ACIeq);\n", +"printf('\n Minimum C/I for system B when compared to the (C/I)min for particular system = %0.2f dB',BCIeq);\n", +"printf('\n Minimum C/I for system C when compared to the (C/I)min for particular system = %0.0f dB',CCIeq); \n", +"printf('\n Minimum C/I for system D when compared to the (C/I)min for particular system = %0.0f dB',DCIeq);\n", +"printf('\n \n Based on comparison, the smallest value of C/I should be selected for maximum capacity. So, System B offers the best capacity.')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: EX9_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Example no 9.9\n", +"// To determine the maximum number of users using a)omnidirectional base station antenna and no voice activity b)three-sectors at the base station and voice activity detection\n", +"// Page no. 472\n", +"\n", +"clc;\n", +"clear all;\n", +"\n", +"// Given data\n", +"W=1.25*10^6; // Total RF bandwidth in Hz\n", +"R=9600; // Baseband information bit rate in bps\n", +"EbNo=10; // Minimum acceptable SNR in dB\n", +"\n", +"// a)Maximum number of users using omnidirectional base station antenna and no voice activity\n", +"N1=1+(W/R)/EbNo; // Maximum number of users using omnidirectional\n", +"\n", +"// b)Maximum number of users using three-sectors at the base station antenna and voice activity with alpha=3/8\n", +"alpha=3/8; // Voice activity factor\n", +"Ns=1+(1/alpha)*((W/R)/EbNo); // Maximum number of users\n", +"N2=3*Ns; // Maximum number of users using three-sectors\n", +"\n", +"// Displaying the result in command window\n", +"printf('\n Maximum number of users using omnidirectional base station antenna and no voice activity = %0.0f',N1);\n", +"printf('\n Maximum number of users using three-sectors at the base station antenna and voice activity (with alpha=3/8) = %0.0f',N2);" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |