diff options
Diffstat (limited to 'Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb')
-rwxr-xr-x | Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb | 552 |
1 files changed, 0 insertions, 552 deletions
diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb deleted file mode 100755 index 4a90200e..00000000 --- a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb +++ /dev/null @@ -1,552 +0,0 @@ -{
- "metadata": {
- "name": "",
- "signature": "sha256:1dbf1e210c4590854e89fefc301f7793854ff6faa24ffc7f7d52e4b344b0bb4a"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "CHAPTER09:NOISE IN ANALOG COMMUNICATION SYSTEM"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E01 : Pg 9.10"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.10\n",
- "# Example 9.1\n",
- "import math \n",
- "# Given\n",
- "wo=2.*math.pi*8000.;\n",
- "n=2.*10.**9.; \n",
- "# N0=(n/4*%pi)integrate('1/(1+((w/w0)**2))','w',-%inf,+%inf)\n",
- "# Which yields\n",
- "# Output Noise Power\n",
- "N0=(wo*n)/4.;\n",
- "print\"Output Noise Power: \",N0,\"W\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Output Noise Power: 2.51327412287e+13 W\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E04 : Pg 9.12"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.12\n",
- "# Example 9.4\n",
- "# Given\n",
- "# (a) \n",
- "import math \n",
- "H1=1.;\n",
- "H2=(1./2.);\n",
- "S0=(H1**2.)/2.;\n",
- "w0=-2.*math.pi;\n",
- "w1=2.*math.pi;\n",
- "N0=0.4;#(0.1/(2*math.pi))*2*(integrate('1','w',w0,w1));\n",
- "SNR=S0/N0;\n",
- "print\"SNR: \",SNR\n",
- "\n",
- "# (b)\n",
- "S01=(H1**2.*H2**2.)/2.;\n",
- "N01=0.101;\n",
- "SNR1=S01/N01;\n",
- "print\"SNR1: \",SNR1"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "SNR: 1.25\n",
- "SNR1: 1.23762376238\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E08 : Pg 9.15"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.15\n",
- "# Example 9.8\n",
- "# Given\n",
- "import math \n",
- "p=0.99;\n",
- "u=1.;\n",
- "q=1-p;\n",
- "# As exp(-Ac^2/4*n*B)=1-p\n",
- "# AndAC^2/2*n*B=S/N\n",
- "# Therefore exp(-(1/2)*(S/N))=1-p\n",
- "SN=2.*(math.log(1/q));\n",
- "SN1=(round(SN)+1); # Upper limit\n",
- "print'S/N:',SN1,'db'\n",
- "# Hence proved"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "S/N: 10.0 db\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E09 : Pg 9.16"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.16\n",
- "# Example 9.9\n",
- "# Given\n",
- "import math\n",
- "Si=7.*10.**4.;\n",
- "u=1.;\n",
- "BW=4.*10.**3.; # Hz\n",
- "n=2.*10.**12.; # W/Hz\n",
- "\n",
- "# (a)Minimum value of Ac\n",
- "SbyN=40.; # dB\n",
- "SN=10.**(SbyN/10.);\n",
- "\n",
- "Sx=0.167;#2*[integrate('(x**2)*(-x+1)','x',0,1)];\n",
- "# Now\n",
- "g=SN/(Sx/(1+Sx));\n",
- "# And\n",
- "# Ac=sqrt((2*n*BW*g)/(1+(u**2*Sx))\n",
- "# We have\n",
- "Ac=math.sqrt((2.*n*BW*g)/(1.+(u**2.*Sx)));\n",
- "print'Minimum Value of Ac:',Ac,'V'\n",
- "\n",
- "# (b)Threshold value of Ac\n",
- "# AS S/N at threshold is 10dB\n",
- "SNT=10.; # dB\n",
- "gT=2.*SNT;\n",
- "AcT=math.sqrt((2.*n*BW*gT)/(1.+(u**2.*Sx)));\n",
- "print'Minimum Value of Ac at Threshold:',AcT,'V'"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Minimum Value of Ac: 30952929301.4 V\n",
- "Minimum Value of Ac at Threshold: 523648135.033 V\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E10 : Pg 9.17"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.17\n",
- "# Example 9.10\n",
- "# Given\n",
- "\n",
- "BW=10.*10.**3.; # Hz\n",
- "SNR=40.; # dB\n",
- "SNRO=10.**(SNR/10.);\n",
- "P=40.; # dB\n",
- "PL=10.**(P/10.);\n",
- "n=2.*10.**9.; # W/Hz\n",
- "USx2=0.5;\n",
- "# For DSB, AM and SSB bandwidth requirement\n",
- "BTD=2.*BW;\n",
- "BTA=2.*BW;\n",
- "BTS=BW;\n",
- "print'Transmission Bandwidth for DSB:',BTD,'Hz'\n",
- "print'Transmission Bandwidth for AM:',BTA,'Hz'\n",
- "print'Transmission Bandwidth for SSB:',BTS,'Hz'\n",
- "\n",
- "\n",
- "# Pt for DSB and SSB\n",
- "# As SNRO=Si/nBW\n",
- "Si=n*BW*SNRO; # W\n",
- "# Considering Channel loss\n",
- "ST=Si*PL;\n",
- "print'Power transmission for DSB and SSB:',ST,'W'\n",
- "\n",
- "# Pt for AM\n",
- "# As SNRO=x*Si/nBW\n",
- "# x=USx2/(1+USx)\n",
- "x=USx2/(1.+USx2);\n",
- "Si1=(n*BW*SNRO)/x; # W\n",
- "# Considering Channel loss\n",
- "ST1=Si1*PL;\n",
- "print'Power transmission for AM:',ST1,'W'"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Transmission Bandwidth for DSB: 20000.0 Hz\n",
- "Transmission Bandwidth for AM: 20000.0 Hz\n",
- "Transmission Bandwidth for SSB: 10000.0 Hz\n",
- "Power transmission for DSB and SSB: 2e+21 W\n",
- "Power transmission for AM: 6e+21 W\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E13 : Pg 9.20"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.20\n",
- "# Example 9.13\n",
- "# Given\n",
- "import math \n",
- "Mf1=0.003;\n",
- "# for f<=1.5*10.**3 Hz\n",
- "f1=1.5*10.**3.; # Hz\n",
- "Mf2=0.001;\n",
- "# for 1.5*10.**3 <=f<=3*10.**3 Hz\n",
- "f2=3.*10.**3.; # Hz\n",
- "Mf3=0;\n",
- "# for f>3*10.**3 Hz\n",
- "# (a) Ac that power transmitted is 100mW\n",
- "St=100.*10.**3.; # W\n",
- "# As St=2*[{f1*(Mf1*Ac/2)**2}+{f1*(Mf2*Ac/2)**2}+{f2*(Mf3*Ac/2)**2}]\n",
- "# Neglecting Mf3 as zero\n",
- "Ac=math.sqrt((4.*St)/(2.*f1*(Mf1**2.+Mf2**2.)));\n",
- "print'Ac for s(t)=100mw:',Ac,'V'\n",
- "# (b)Power in abscence of noise\n",
- "Zt=2.*((f1*(((Mf1*Ac)/4.)**2.))+(f1*(((Mf2*Ac)/4.)**2.))+(f2*(((Mf3*Ac)/4.)**2.)));\n",
- "print'Power in absence of Noise:',Zt,'W'\n",
- "# (c)\n",
- "# Given\n",
- "N0=0.0001*10.**3.; # W/Hz\n",
- "# Psd=N0/4\n",
- "# Pt=2*f1*N0/4\n",
- "Pt=(2.*f2*N0)/4.;\n",
- "print'Power:',Pt,'W'\n",
- "# (d) SNR at output\n",
- "SNR=Zt/Pt;\n",
- "SNRO=10.*math.log(SNR)/math.log(10);\n",
- "print'SNR at output for SSB:',SNRO,'dB'\n",
- "# (e)For DSB\n",
- "St1=100.*10.**3.; # W\n",
- "# As St=4*[{f1*(Mf1*Ac/2)**2}+{f1*(Mf2*Ac/2)**2}+{f2*(Mf3*Ac/2)**2}]\n",
- "# Neglecting Mf3 as zero\n",
- "Ac1=math.sqrt((4.*St)/(4.*f1*(Mf1**2.+Mf3**2.)));\n",
- "Zt1=4.*((f1*(((Mf1*Ac)/4.)**2.))+(f1*(((Mf2*Ac)/4.)**2.))+(f2*(((Mf3*Ac)/4.)**2.)));\n",
- "# SNR at output\n",
- "SNR1=Zt1/Pt;\n",
- "SNRO1=10.*math.log(SNR1)/math.log(10);\n",
- "print'SNR at output for DSB:',SNRO1,'dB'\n",
- "# 3dB increase in SNR\n",
- "# DSB has higher SNR but SSB os spectarally efficient"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Ac for s(t)=100mw: 3651.4837167 V\n",
- "Power in absence of Noise: 25000.0 W\n",
- "Power: 150.0 W\n",
- "SNR at output for SSB: 22.2184874962 dB\n",
- "SNR at output for DSB: 25.2287874528 dB\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E14 : Pg 9.22"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.22\n",
- "# Example 9.14\n",
- "# Given\n",
- "import math \n",
- "delf=75.*10.**3.; # Hz\n",
- "W=15.*10.**3.; # Hz\n",
- "Sx=1./2.;\n",
- "# As SNRO=3(delf/W)**2*Sx*g\n",
- "# Assume g=1\n",
- "g=1.;\n",
- "\n",
- "SNRO=3.*(delf/W)**2*Sx*g;\n",
- "SNdB=10.*math.log(SNRO)/math.log(10);\n",
- "print'Output SNR:',SNdB,'dB'\n",
- "\n",
- "# Hence it is SNdB times better"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Output SNR: 15.7403126773 dB\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E17 : Pg 9.23"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.23\n",
- "# Example 9.17\n",
- "# Given\n",
- "import math \n",
- "oSNR=40.; # dB\n",
- "SNRO=10.**(oSNR/10.);\n",
- "n=2.*10.**10.; # W/Hz\n",
- "l=50.; # dB\n",
- "PL=10.**(l/10.);\n",
- "B=15.*10.**3.; # Hz\n",
- "Sx=1./2.;\n",
- "# (a) DSB Modulation\n",
- "BTD=2.*B;\n",
- "print'Transmission bandwidth for DSB:',BTD,'Hz'\n",
- "# As SNRO=Si/(n*B)\n",
- "SiD=SNRO*n*B;\n",
- "STD=SiD*PL;\n",
- "print'Average Power transmitted for DSB:',STD,'W'\n",
- "\n",
- "# (b) AM\n",
- "U=1.;\n",
- "U2Sx=U*U*Sx;\n",
- "BTA=2.*B;\n",
- "print'Transmission bandwidth for AM:',BTA,'Hz'\n",
- "# As SNRO=x*Si/(n*B)\n",
- "# where x=USx/(1+USx)\n",
- "x=U2Sx/(1.+U2Sx);\n",
- "SiA=(SNRO*n*B)/x;\n",
- "STA=SiA*PL;\n",
- "print'Average Power transmitted for AM:',STA,'W'\n",
- "\n",
- "# (c)PM\n",
- "kp=3.;\n",
- "BTP=2.*(kp+1.)*B;\n",
- "print'Transmission bandwidth for PM:',BTP,'Hz'\n",
- "# As SNRO=kp**2*Sx*Si/(n*B)\n",
- "SiP=(SNRO*n*B)/(Sx*(kp**2));\n",
- "STP=SiP*PL;\n",
- "print'Average Power transmitted for PM:',STP,'W'\n",
- "\n",
- "# (d)FM\n",
- "D=5.;\n",
- "BTF=2.*10.**1.*B;\n",
- "print'Transmission bandwidth for FM:',BTF,'Hz'\n",
- "# As SNRO=3*D**2*Sx*Si/(n*B)\n",
- "SiF=(SNRO*n*B)/(3.*(D**2.)*Sx);\n",
- "STF=SiF*PL;\n",
- "print'Average Power transmitted for FM:',STF,'W'"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Transmission bandwidth for DSB: 30000.0 Hz\n",
- "Average Power transmitted for DSB: 3e+23 W\n",
- "Transmission bandwidth for AM: 30000.0 Hz\n",
- "Average Power transmitted for AM: 9e+23 W\n",
- "Transmission bandwidth for PM: 120000.0 Hz\n",
- "Average Power transmitted for PM: 6.66666666667e+22 W\n",
- "Transmission bandwidth for FM: 300000.0 Hz\n",
- "Average Power transmitted for FM: 8e+21 W\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E18 : Pg 9.24"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.24\n",
- "# Example 9.18\n",
- "# (b)Modulation index b\n",
- "# Given\n",
- "SNdB=30.; # dB\n",
- "SNRO=10.**(SNdB/10.);\n",
- "# As SNRO=30*b**2*(b+1)\n",
- "# Therefore\n",
- "#p2=poly(0,'x');\n",
- "#p3 =30.*(p2**3.)+30.*(p2**2.)-1000.;\n",
- "#r=roots(p3);\n",
- "t=2.917128 ;#2.92+0j;#r(3,1);\n",
- "print'Modulation index:',t"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Modulation index: 2.917128\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example E21 : Pg 9.27"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "# Page Number: 9.27\n",
- "# Example 9.21\n",
- "# Given\n",
- "import math \n",
- "BW=5000.; # Hz\n",
- "P=0.1; # W\n",
- "CBW=100.*10.**3.; # Hz\n",
- "A=80.; # dB\n",
- "A1=10.**(-A/10.);\n",
- "N0=2*(0.5*10.**12.); # W/Hz\n",
- "Pt=10.*10.**3.; # W\n",
- "\n",
- "# We know, CBW=2*(*10.**1)*BW\n",
- "# Therefore\n",
- "D=(CBW/(2.*BW))-1.;\n",
- "kp=D;\n",
- "Si=Pt*A1;\n",
- "Sx=P;\n",
- "# We know\n",
- "# SNR=((kp**2)*Si*Sx)/(N0*BW);\n",
- "\n",
- "SNR=((kp**2.)*Si*Sx)/(N0*BW);\n",
- "SNR1=10.*math.log(SNR)/math.log(10);\n",
- "print\"SNR at output: \",SNR1,\"dB\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "SNR at output: -187.904849855 dB\n"
- ]
- }
- ],
- "prompt_number": 10
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file |