diff options
Diffstat (limited to 'Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb')
-rwxr-xr-x | Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb | 338 |
1 files changed, 338 insertions, 0 deletions
diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb new file mode 100755 index 00000000..6a6cd416 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb @@ -0,0 +1,338 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d1cbcab673c40d252caf601352e39b3f6fb5df10eada02ad15211795afd1b59f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4: An Overview of Digital Communication and Transmission" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1, Page 93" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Fm=20; # in KHz\n", + "\n", + "#Calculations\n", + "print \"An Engineering version of the Nyquist sampling rate : fs>=2.2*fm.\"\n", + "print 'Therefore sampling rate of >= %d ksps should be used '%(2.2*Fm); \n", + "print \"The sampling rate for a compact disc digital audio player = 44.1 ksps and for a studio quality audio player = 48 ksps are used.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "An Engineering version of the Nyquist sampling rate : fs>=2.2*fm.\n", + "Therefore sampling rate of >= 44 ksps should be used \n", + "The sampling rate for a compact disc digital audio player = 44.1 ksps and for a studio quality audio player = 48 ksps are used.\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2, Page 96" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Rt=1; #Resistance(ohm)\n", + "#L= Number of quantization values\n", + "L1=32;\n", + "L2=64;\n", + "L3=128;\n", + "L4=256;\n", + "\n", + "#Calculations\n", + "# L=2**R i.e R=math.log2(L);\n", + "R1=math.log(L1,2);\n", + "R2=math.log(L2,2);\n", + "R3=math.log(L3,2);\n", + "R4=math.log(L4,2);\n", + "\n", + "#P=A**2/2; #average power of signal\n", + "#sig**2=0.333*A**2*2**(-2*Rt); #Avg quantization noise power\n", + "#SNR=P/sig**2;\n", + "# SNR(dB)=1.8+ 6R;\n", + "\n", + "SNR1=1.8+6*R1;\n", + "SNR2=1.8+6*R2;\n", + "SNR3=1.8+6*R3;\n", + "SNR4=1.8+6*R4;\n", + "\n", + "#Result\n", + "print 'For L=32, SNR is %.1f dB\\n '%SNR1\n", + "print 'For L=64, SNR is %.1f dB\\n '%SNR2\n", + "print 'For L=128, SNR is %.1f dB\\n '%SNR3\n", + "print 'For L=256, SNR is %.1f dB\\n '%SNR4" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For L=32, SNR is 31.8 dB\n", + " \n", + "For L=64, SNR is 37.8 dB\n", + " \n", + "For L=128, SNR is 43.8 dB\n", + " \n", + "For L=256, SNR is 49.8 dB\n", + " \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3, Page 99" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Fs=8*10**3; #in Hz\n", + "Fm=3.4*10**3; # in Hz\n", + "VCH=24; #voice channels\n", + "SCH=1; #sunchronization channel\n", + "PDur=1; #extra pulse duration in microsec\n", + "\n", + "#Calculations&Results\n", + "Ts=1/(Fs);\n", + "TimeCH=Ts/(VCH+SCH)*10**6; # in microsec\n", + "print 'Time between the pulses is %d microsec\\n'%(TimeCH-PDur);\n", + "#Now by using the engineering version of Nyquist rate sampling\n", + "NyquistRate=2.2*Fm;\n", + "Ts1_microsec=1/NyquistRate*10**6;\n", + "Tc=round(Ts1_microsec)/(VCH+SCH);\n", + "print \"Time between the pulses by using engineering version of Nyquist rate sampling is %.2f microsec\\n\"%(Tc-PDur);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time between the pulses is -1 microsec\n", + "\n", + "Time between the pulses by using engineering version of Nyquist rate sampling is 4.36 microsec\n", + "\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4, Page 101" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Fm=3000; #highest modulating frequency in signal(Hz)\n", + "M=32; # number of pulse levels \n", + "b=5; #bits per symbol \n", + "p=0.01; #Quantization distortion\n", + "\n", + "#Calculations\n", + "#2**R = L >= 1/2P\n", + "# where R is the number of bits required to represent quantization levels L\n", + "R=math.log10(1./(2*p))/math.log10(2);\n", + "Fs=2*Fm; # Nyquist sampling criteria (samples per second)\n", + "fs=round(R)*Fs;\n", + "Rs=fs/b;\n", + "\n", + "#Result\n", + "print 'The minimum number of bits/sample or bits/PCM word that should be used are %d'%(round(R));\n", + "print 'The minimum sampling rate is %d samples per second\\n '%Fs;\n", + "print 'The resulting transmission rate is %d bps\\n '%fs;\n", + "print 'The PCM pulse or symbol transmission rate is %d symbols/sec\\n'%Rs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum number of bits/sample or bits/PCM word that should be used are 6\n", + "The minimum sampling rate is 6000 samples per second\n", + " \n", + "The resulting transmission rate is 36000 bps\n", + " \n", + "The PCM pulse or symbol transmission rate is 7200 symbols/sec\n", + "\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5, Page 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "S_No=53.; #dB-Hz\n", + "R=9.6*10**3; #bps\n", + "BW=4.8*10**3; #Khz\n", + "Pb=10**-5; #BER<=10**-5;\n", + "\n", + "#Calculations\n", + "print \"Since the required data rate of 9.6 kbps is more than the available bandwidth of 4.8 kHz, the channel is bandwidth-limited.\"\n", + "Eb_No=S_No-10*math.log10(R); #dB\n", + "# Try for 8-PSK modulation scheme\n", + "M=8;\n", + "Ps=math.log(M,2)*Pb; #Max ps\n", + "Es_No=math.log(M,2)*10**(0.1*Eb_No);\n", + "#Ps(8)=2*Q(math.sqrt(2*Es_No)*sin(math.pi/8));\n", + "#2*Q(math.sqrt(2*Eb_No))=erfc(math.sqrt(Eb_No)); #Refer EQn C(7) from appendix C\n", + "\n", + "Ps8=math.erfc(math.sqrt(Es_No)*math.sin(math.pi/8));\n", + "\n", + "#Result\n", + "print 'Symbol error rate is given as %.5f \\n '%Ps\n", + "print 'The ratio of signal energy to noise is %.2f \\n '%Es_No;\n", + "print 'Symbol error rate for 8-PSK is %.5f \\n '%Ps8;\n", + "print \"As symbol error rate for 8-PSK modulation is lower than threshold value. so, We can use 8-PSK modulation.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since the required data rate of 9.6 kbps is more than the available bandwidth of 4.8 kHz, the channel is bandwidth-limited.\n", + "Symbol error rate is given as 0.00003 \n", + " \n", + "The ratio of signal energy to noise is 62.35 \n", + " \n", + "Symbol error rate for 8-PSK is 0.00002 \n", + " \n", + "As symbol error rate for 8-PSK modulation is lower than threshold value. so, We can use 8-PSK modulation.\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6, Page 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "SNR=48.; #dB-Hz\n", + "BW=45.*10**3; #in Hz\n", + "R=9.6*10**3; #bps\n", + "Pb=10**-5; #Bit error rate\n", + "e=2.71828; #Natural exponent e\n", + "\n", + "#Calculations&Results\n", + "print \"since the available bandwidth of 45 kHz is more than adequate to support the required data rate of 9.6 kbps.\";\n", + "print \"So, the channel is not bandwidth limited \";\n", + "Eb_No=SNR-10*math.log10(R);\n", + "#We try the 16-FSK modulation scheme\n", + "M=16;\n", + "\n", + "Es_No=math.log(M,2)*Eb_No;\n", + "Ps=(M-1)/2*e**(-Es_No/2);\n", + "#For orthogonal signalling\n", + "Ps16=(2**M-1)/(2**(M-1))*Pb;\n", + "print \"\"\n", + "print 'The maximum symbol error probability is %0.5f \\n '%Ps16\n", + "print 'The symbol error probability achieved by 16-PSK is %.9f \\n '%Ps;\n", + "print \"As achieved symbol error probability is far less than maximum tolerable value\";\n", + "print \"So, we can meet the given speci\ufb01cations for this power-limited channel with a 16-FSK modulation scheme without any error-correction coding\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "since the available bandwidth of 45 kHz is more than adequate to support the required data rate of 9.6 kbps.\n", + "So, the channel is not bandwidth limited \n", + "\n", + "The maximum symbol error probability is 0.00001 \n", + " \n", + "The symbol error probability achieved by 16-PSK is 0.000000553 \n", + " \n", + "As achieved symbol error probability is far less than maximum tolerable value\n", + "So, we can meet the given speci\ufb01cations for this power-limited channel with a 16-FSK modulation scheme without any error-correction coding\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |