{ "metadata": { "name": "", "signature": "sha256:0567df6d143de5413d3406fc62e3bde7360c6adec18cda1ddb49a1255bcf929f" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "chapter 5: Communication Techniques" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.1, page no-174 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "import math\n", "\n", "\n", "\n", "\n", "#Variable Declaration\n", "m=0.5 #modulation index\n", "\n", "#Calculation\n", "#for AM\n", "pt1=(1+(m**2)/2.0)\n", "#for SSBSC\n", "pt2=(m**2)/4.0\n", "#% power saving\n", "p=(pt1-pt2)*100/pt1\n", "p=math.floor(p*10)/10\n", "\n", "#Result\n", "print(\"Percentage power saving is %.1f%%\"%p)\n", "\n", "#for case (b)\n", "\n", "#Variable Declaration\n", "m=1 #modulation index\n", "\n", "#Calculation\n", "#for AM\n", "pt1=(1+(m**2)/2.0)\n", "#for SSBSC\n", "pt2=(m**2)/4.0\n", "#% power saving\n", "p=(pt1-pt2)*100/pt1\n", "p=math.floor(p*10)/10\n", "\n", "#Result\n", "print(\"\\n Percentage power saving is %.1f%%\"%p)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Percentage power saving is 94.4%\n", "\n", " Percentage power saving is 83.3%\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.2, page no-174 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Variable Declaration\n", "pc=500 #energy of carrier signal\n", "m=0.6 #AM modulation index\n", "\n", "\n", "#Calculation\n", "\n", "#for (a)\n", "pt=pc*(1+(m**2)/2)\n", "\n", "#for (b)\n", "pt2=pc*(m**2)/4\n", "\n", "\n", "#Result\n", "print(\"(a)\\n A3E is the double side band AM with full carrier.\\n Therefore, Pt= %.0f W\\n\\n (b)\\n J3E is an SSBSC system.\\n Therefore, Pt= %.0f W\"%(pt,pt2))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)\n", " A3E is the double side band AM with full carrier.\n", " Therefore, Pt= 590 W\n", "\n", " (b)\n", " J3E is an SSBSC system.\n", " Therefore, Pt= 45 W\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.3, page no-175 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#Variable Declaration\n", "m=0.6 #60% modulation\n", "\n", "\n", "#Calculation\n", "#for A3E\n", "pt1=(1+(m**2)/2)\n", "#for J3E\n", "pt2=(m**2)/4\n", "#% power saving\n", "p=(pt1-pt2)*100/pt1\n", "p=math.ceil(p*10)/10\n", "\n", "#Result\n", "print(\"Percentage power saving is %.2f%%\"%p)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Percentage power saving is 92.40%\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.4, page no-175 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Variable Declaration\n", "\n", "bw=0.5/100 #bw is 0.5% of carrier freq. \n", "\n", "\n", "#Calculation\n", "wc=2/bw\n", "\n", "#Result\n", "print(\"Wc = %.0f*Wm\"%wc)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Wc = 400*Wm\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.5, page no-190 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Variable Declaration\n", "\n", "m=6.0 #Modulation Index\n", "wc=7.8*10**8 #unmodulated carrier frequency\n", "wm=1450 #Modulating frequency\n", "\n", "\n", "#Calculation\n", "fc=wc/(2*math.pi)\n", "fm=wm/(2*math.pi)\n", "\n", "\n", "#Result\n", "print(\"Unmodulated carrier frequency, fc = %.2f MHz \\n The modulation index m = %d \\n Modulating frequency, fm = %.2f Hz\"%(fc/10**6,m,fm))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Unmodulated carrier frequency, fc = 124.14 MHz \n", " The modulation index m = 6 \n", " Modulating frequency, fm = 230.77 Hz\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.7, page no-191 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "mf=150 #modulation index\n", "fm=1 # modulating frequency in KHz\n", "\n", "\n", "#Calculation\n", "fd=mf*fm\n", "bw=2*(mf+1)*fm\n", "\n", "#Result\n", "print(\"frequency deviation = %.0f kHz\\n Bandwidth = %.0f kHz \\n\\n Expression for instantaneous frequency is given by, \\n f = 10^8-150*(10^3)*sin(2*3.14*10^3*t)\"%(fd,bw))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "frequency deviation = 150 kHz\n", " Bandwidth = 302 kHz \n", "\n", " Expression for instantaneous frequency is given by, \n", " f = 10^8-150*(10^3)*sin(2*3.14*10^3*t)\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.8, page no-191 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Variable Declaration\n", "fd=50 #frequency deviation in kHz\n", "fm=1.0 #modulating frequency in kHz for case 1\n", "fm2=100.0 #modulating frequency in kHz for case 2\n", "\n", "\n", "#Calculation\n", "#for case 1\n", "m=fd/fm\n", "bw=2*(m+1)*fm\n", "#for case 2\n", "m2=fd/fm2\n", "bw2=2*(m2+1)*fm2\n", "\n", "\n", "#Result\n", "print(\"For first case\\n Modulation index = %.0f \\n Bandwidth = %.0f kHz \\n\\n For second case\\n Modulation index = %.1f \\n Bandwidth = %.0f kHz\"%(m,bw,m2,bw2))\n" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.9, page no-192 " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Variable Declaration\n", "bw=20*10**3 #bandwidth in Hz\n", "fm=1* 10**3 #modulating frequency in Hz\n", "\n", "\n", "#Calculation\n", "mf=(bw/(2*fm))-1\n", "new_mf=mf*6\n", "new_fm=0.5 #kHz\n", "new_bw=2*(new_mf+1)*new_fm\n", "\n", "#Result\n", "print(\"mf=%.0f\\n New modulation index = %.0f\\n New bandwidth = %.0f kHz\"%(mf,new_mf,new_bw))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "mf=9\n", " New modulation index = 54\n", " New bandwidth = 55 kHz\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.10, page no-192" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "#Variable Declaration\n", "fd=75.0 #Maximum allowed frequency deviation in kHz\n", "fm=15.0 #Highest modulating frequency in kHz\n", "\n", "\n", "#Calculation\n", "D=fd/fm\n", "bw=2*(D+1)*fm\n", "\n", "#Result\n", "print(\"Deviation Ratio, D = %.0f\\n Bandwidth = %.0f kHz\"%(D,bw))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Deviation Ratio, D = 5\n", " Bandwidth = 180 kHz\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.11, page no-199" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Variable Declaration\n", "fm=3200.0 #highest frequency component in message signal\n", "k=48000.0 #channel capacity in b/s\n", "\n", "#Calculation\n", "fs=2*fm\n", "n=k/fs\n", "n=math.floor(n)\n", "\n", "#Result\n", "print(\"n = %.0f\\n L = 2^7 = %.0f\\n fs = %.3f kHz\"%(n,2**7,(k/7)/1000))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "n = 7\n", " L = 2^7 = 128\n", " fs = 6.857 kHz\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.12, page no-199" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "f=2500 #Highest frequency component in the signal in Hz\n", "\n", "#result\n", "print(\"Nyquist rate = 2 x f\\n\\t = %.0f Hz = %.0f kHz\"%(2*f,2*f/1000))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Nyquist rate = 2 x f\n", "\t = 5000 Hz = 5 kHz\n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.13, page no-199" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#Variable Declaration\n", "l=128 #no of Quantizing levels\n", "fs=10000.0 #sampling frequency in Hz\n", "\n", "\n", "#Calculation\n", "n=7 #math.log2(l)\n", "t=1/(n*fs)\n", "\n", "#Result\n", "print(\"Number of bits per sample (n) = %.0f\\n Time duration of one bit of binary encoded signal is %.3f micro second\"%(n,t*10**6))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Number of bits per sample (n) = 7\n", " Time duration of one bit of binary encoded signal is 14.286 micro second\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.15, page no-208" ] }, { "cell_type": "code", "collapsed": false, "input": [ "f1=2.4 #first signal frequency\n", "f2=3.2 #2nd signal frequency\n", "f3=3.4 #3rd signal frequency\n", "\n", "t\n", "\n", "\n", "sr=3*(f3*2)\n", "st=10**6/(sr*10**3)\n", "print(\"Sampling rate of the composite signal = %.1f kHz \\nSampling interval of the composite signal = %.0f micro second\"%(sr,st))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Sampling rate of the composite signal = 20.4 kHz \n", "Sampling interval of the composite signal = 49 micro second\n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 5.16, page no-209" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "bw=3.2 # voice channel band limited frequency in kHz\n", "r=1.2 # 1.2 times the Nyquist rate\n", "n=24.0 # no of voice channel\n", "b=8.0 # 8-bit PCM\n", "sr=2*bw*r\n", "p=10**6/(sr*10**3)\n", "N=(n*b)+1\n", "bit_d=p/N\n", "bit_d=math.ceil(bit_d*1000)/1000\n", "tr=1/bit_d\n", "\n", "print(\"Number of bits in each frame = %.0f \\nBit duration = %.3f micro second \\nTransmission rate = %.3f Mbps\"%(N,bit_d,math.ceil(tr*1000)/1000))\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Number of bits in each frame = 193 \n", "Bit duration = 0.675 micro second \n", "Transmission rate = 1.482 Mbps\n" ] } ], "prompt_number": 21 } ], "metadata": {} } ] }