{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter18 Fascimile and Television"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.2.1,Pg.no.671"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The index of co−operation is 1105.84\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import pi\n",
    "#given\n",
    "D=70.4\n",
    "P=0.2   \n",
    "#Determination of index of co−operation\n",
    "IOC_CCITT=D/P\n",
    "IOC_IEEE=IOC_CCITT*(pi)\n",
    "IOC_IEEE=round(IOC_IEEE,2)\n",
    "print 'The index of co−operation is',IOC_IEEE"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.2.2,Pg.no.676"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The no . of pixels in scan line is 826.0 pixels/line \n",
      "The scan rate is 2 lines/sec \n",
      "The pixel rate is 1652.0 pixels/sec\n",
      "The document Transmission time is 8 sec\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import pi\n",
    "D=68.4\n",
    "P=0.26\n",
    "rpm=120\n",
    "n=1075\n",
    "#Determination of no . of pixels scan\n",
    "Npx=(pi)*(D/P)\n",
    "Npx=round(Npx,0)\n",
    "print 'The no . of pixels in scan line is',Npx,'pixels/line ' \n",
    "#Determination of scan rate\n",
    "Rs=rpm/60\n",
    "print 'The scan rate is',Rs,'lines/sec '\n",
    "#Determination of pixel rate is\n",
    "Rpx=Npx*Rs\n",
    "Rpx=round(Rpx,0)\n",
    "print 'The pixel rate is',Rpx,'pixels/sec'\n",
    "f_max=Rpx/2\n",
    "#Determination of document Tx time\n",
    "td=n/(60*Rs)\n",
    "print 'The document Transmission time is',td,'sec'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.3.1,Pg.no.693"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The no . of pixel periods in line period is 485 lines\n",
      "The picture height is 485 pixels\n",
      "The picture length is 580.8 pixels\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "a=(4/3)          #aspect ratio\n",
    "N=525            #no . of line periods per frame\n",
    "Ns=40            #no . of suppressed lines\n",
    "#Determination of no . of pixel periods in line period\n",
    "Nv=N-Ns\n",
    "print 'The no . of pixel periods in line period is',Nv,'lines'\n",
    "#Determination of picture height and width\n",
    "Nh=a*Nv\n",
    "print 'The picture height is',Nh,'pixels'\n",
    "Nl=(Nh/0.835)\n",
    "Nl=round(Nl,1)\n",
    "print 'The picture length is',Nl,'pixels'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.3.2,Pg.no.694"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The horizontal frequency is 15750.0 Hz\n",
      "The vertical frequency is 60.0 Hz\n",
      "The time required to scan one line is 6.35e-05 sec\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "N=525.0\n",
    "P=30.0\n",
    "#Determination of horizontal and vertical synchhronization freq .\n",
    "fh=N*P\n",
    "print 'The horizontal frequency is',fh,'Hz'\n",
    "fv=2*P\n",
    "print 'The vertical frequency is',fv,'Hz'\n",
    "#Determination of time reqd to scan one line\n",
    "Th=((fh)**-1)*10**5\n",
    "Th=round(Th,2)*10**-5\n",
    "print 'The time required to scan one line is',Th,'sec'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.3.3,Pg.no.695"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the band width is 4272187.5 Hz\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "fh=15750\n",
    "Nl=775\n",
    "#Determination of video bandwidth\n",
    "Bv=0.35*fh*Nl\n",
    "Bv=round(Bv,1)\n",
    "print 'the band width is',Bv,'Hz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.7.1,Pg.no.706"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The viewing angle is 10.78 degrees\n",
      "The min.viewing dist is -0.14 m\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import sqrt\n",
    "a=4/3                #aspect ratio\n",
    "D=48.26*10**-2       #CRT tube diagonal\n",
    "Nh=647.0\n",
    "H=sqrt((a**2)*(D**2)/(1+a**2))\n",
    "#Determination of viewing angle & minimum distance\n",
    "w=H/Nh\n",
    "theta=Nh*(1/60.0)     #As each pixel subtend 1 minute of arc\n",
    "theta=round(theta,2)\n",
    "print 'The viewing angle is',theta,'degrees' \n",
    "X=H/(2*math.tan(theta/2))\n",
    "X=round(X,2)\n",
    "print 'The min.viewing dist is',X,'m'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 18.7.2,Pg.no.707"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The viewing angle is 30.67 degrees\n",
      "The viewing dist is -1.27 m\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import sqrt\n",
    "a=16/9\n",
    "D=1.40\n",
    "Nh=1840.0         #Assuming square pixel\n",
    "H=sqrt((a**2)*(D**2)/(1+a**2))\n",
    "#Determination of viewing angle\n",
    "theta=Nh*(1/60.0)\n",
    "theta=round(theta,2)\n",
    "print 'The viewing angle is',theta,'degrees'\n",
    "#Determination of viewing dist\n",
    "X=H/(2*math.tan(theta/2));\n",
    "X=round(X,2)\n",
    "print 'The viewing dist is',X,'m'"
   ]
  }
 ],
 "metadata": {
  "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
}