{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 5: Signals and Data Transmission" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.1, Page 71" ] }, { "cell_type": "code", "execution_count": 66, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "An 8-bit word can take 2^8 = 256 values\n", "\n", "An 16-bit word can take 2^16 = 65536 values\n", "\n", "An 32-bit word can take 2^32 = 4.000000 x 10^9 values\n", "\n" ] } ], "source": [ "import math\n", "#Initialisation\n", "n=8 #8 bit\n", "n2=16 #16 bit\n", "n3=32 #32 bit\n", "\n", "#Calculation\n", "c=2**n #value for 8 bit\n", "c2=2**n2 #value for 16 bit\n", "c3=2**n3 #value for 32 bit\n", "\n", "#Result\n", "print'An 8-bit word can take 2^8 = %d values\\n'%c\n", "print'An 16-bit word can take 2^16 = %d values\\n'%c2\n", "print'An 32-bit word can take 2^32 = %f x 10^9 values\\n'%(c3/10**9)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.2, Page 71" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "An 8-bit word resolution = 0.39 percent\n", "\n", "An 16-bit word resolution = 0.0015 percent\n", "\n", "An 32-bit word resolution = 0.000000023 percent\n", "\n" ] } ], "source": [ "import math\n", "#Initialisation\n", "n=8 #8 bit\n", "n2=16 #16 bit\n", "n3=32 #32 bit\n", "\n", "\n", "#Calculation\n", "c=2**n #value for 8 bit\n", "p=(1*c**-1)*100 #percent\n", "c2=2**n2 #value for 16 bit\n", "p2=(1*c2**-1)*100 #percent\n", "c3=2**n3 #value for 32 bit\n", "p3=(1*c3**-1)*100 #percent\n", "\n", "#Result\n", "print'An 8-bit word resolution = %.2f percent\\n'%p\n", "print'An 16-bit word resolution = %.4f percent\\n'%p2\n", "print'An 32-bit word resolution = %.9f percent\\n'%p3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.3, Page 73" ] }, { "cell_type": "code", "execution_count": 64, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG4pJREFUeJzt3X2UXXV97/H3J4RHUxhFGyGQzDINZqHQATSEgs1YCybI\ng7flQaqFgduWpahUdClFbS7qur3Lem2gQBEEQlAKiEpQoMUKU5CHoAlzSZHwUAiEKPEBQoBQGuB7\n/9h7wuZkn5kzk73n/GbO57XWWZy99+/s8z0/fjnfs3/fvfcoIjAzM2s0qd0BmJlZmpwgzMyslBOE\nmZmVcoIwM7NSThBmZlbKCcLMzEo5QZiZWSknCKuUpNWSNkraIOm5/L9vbXdc7SDpaEn3Slov6VeS\n/k3SjJrf81VJb6vzPaxzTG53ADbhBPCBiLh1qEaStomIV8YopjEnaSZwOfDBiOiX9AbgMKDuzzzk\nla8Tvd+tWj6CsDpoixXSjPzX7SmSHgd+nK+fK+kOSc/kv7bnFV7TLalf0rOS/lXSP0q6It82T9Ka\nhvd4TNIf5c8l6UxJj0j6taSrJHU1xHKipMfzX/dnFfYzSdJZ+Ws3SPqppGmSzpP0tYb3XCrp9JI+\n6AEejYh+gIh4ISK+HxFP5q9bKOk7eVwbJP1M0r6F/e4m6do8tv+U9Ilh4ttD0r/nfX9fvv7YwX6S\n9FlJvwQulXSSpNsbPsfmIw9Jl0k6X9KN+VHg7ZKmSvoHSU9L+rmk32/6f98mDCcIG2t/CMwG3i9p\nd+CHwJci4o3AZ4DvSto1b3sl8FPgzcBXgJN4/S/koX4tfxI4CngPsDvwDHBBQ5uDgVnAHwN/K+nt\n+fpPA8cD8yNiZ+AUYCPZEcGHBl+cx/k+4Nsl778CmC3p65J68yOIRkcBVwNvBP4ZuE7SNpIE/AC4\nF9gtf4/TJR06RHwvRMRgct0nInaOiO/ky28FuoDpwF/l6xr7rnH5WOAsY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Y7KpsRWSNgCXjeQDF/df/nEj\nJJ0ALM33f9MQ7f+A7OjlbElfytsdHhFPjSIm60C+3bd1hHxe/rmI+PoYvd/uwC0RMXss3s+sDp5i\nMquYpD8H7iL7gy1m45aPIMzMrJSPIMzMrJQThJmZlXKCMDOzUk4QZmZWygnCzMxKOUGYmVmp/w9Q\n8qp7rMXCBAAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import math\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "#data\n", "x = np.linspace(0, 3, 1)\n", "y=2\n", "\n", "#plotting\n", "\n", "plt.bar(1, y, 0.001*max(x))\n", "\n", "\n", "xlabel(\"Frequency in kHz\")\n", "ylabel(\"Voltage\")\n", "title(\"Frequency Spectrum\")\n", "plt.axis([0, 2, 0, 3])\n", "plt.grid()\n", "plt.show()\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.4, Page 73" ] }, { "cell_type": "code", "execution_count": 65, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG21JREFUeJzt3Xu0ZGV55/HvD9oLymB7G0SQ7hWCslBJK4oYdLqNUcGo\nOImIjgZbJwnL+0RdalDT42UlaxnHIFFjULSBSLwrKJJolBPwBgr0QBRQglxVvCByaYZweeaP2t0U\nxT7n1Dm965zd53w/a9Wi9t5v7XrqZXc99b7P3vukqpAkadQOix2AJKmfTBCSpFYmCElSKxOEJKmV\nCUKS1MoEIUlqZYKQJLUyQahTSS5LsjnJ9UluaP77kMWOazEkOTTJeUmuS/LzJP+aZNWE3/OOJL81\nyffQ8rFisQPQklPAH1TV6TM1SrJjVd2+QDEtuCR7AccDz62qqST3BZ4OTPozz3jl61Lvd3XLEYQm\nIXdbkaxqft2+LMnlwNea9Qcm+WaS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UneALwM2DjGe59aVbcBv0pyDYMv+Z+MtLkn\ng1HTK6vqzKH1lwz30/Aoqlk+CPgTBn/FTRqbCULbo5uGngf466r68HCDJK+d4fW3cef06r1H9vXq\nqvrqyL7WArcMrbqdO//t3G16p6puTvJV4LnAYcD+M8SyxfD+76D93+ZtDOoWBwNntmy/myS7AR8G\nnr3l9tnSuKxBqM/G+ZOT/wK8LMl9AZI8NMmDgTOA5ya5V5L/Ajx76DWXAY9rnh82sq9XNPfVJ8ne\nSe4zw3tfDDwkyf5N+52TbPk3dRxwDIORx2+m28EcFYMRyT5J3ji0froaxArgU8Cbquo/OopBy4gj\nCPXZrGfnVNVXk+wDfHtQguAG4MVVdV6STwHnA9cAZw+97D3Ap5oi9KlD6z/CYOro3Kae8XMGo4DW\nuKrq1iSHA+9PshODusfvM5gaOzfJ9cDH5vKBh/ff/nGrkrwQOLnZ/2kztP9dBqOXtyd5R9PumVX1\ns3nEpGXI231rWWjm5W+oqvcu0Ps9FPh6Ve2zEO8nTYJTTFLHkvwx8G0Gf7BF2m45gpAktXIEIUlq\nZYKQJLUyQUiSWpkgJEmtTBCSpFYmCElSq/8PK/+gYIz8oXAAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import math\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "#data\n", "x = np.linspace(0, 3, 1)\n", "y=2\n", "y1=1\n", "\n", "#plotting\n", "plt.bar(1, y, 0.001*max(x))\n", "plt.bar(1.5, y1, 0.001*max(x))\n", "\n", "\n", "xlabel(\"Frequency in kHz\")\n", "ylabel(\"Voltage\")\n", "title(\"Frequency Spectrum\")\n", "plt.axis([0, 2, 0, 3])\n", "plt.grid()\n", "plt.show()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.5, Page 74" ] }, { "cell_type": "code", "execution_count": 68, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Bandwidth = 7.0 kHz\n" ] } ], "source": [ "import math\n", "#Initialisation\n", "f1=7000 #Human Speech Frequency Upper limit in HZ\n", "f2=50 #Human Speech Frequency Lower limit in Hz\n", "\n", "#Calculation\n", "B=f1-f2 #Bandwidth in Hz\n", "\n", "#Result\n", "print'Bandwidth = %.1f kHz'%(B*1000**-1)" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.10" } }, "nbformat": 4, "nbformat_minor": 0 }