{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 11:Digital Signal Processing"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex11.1:pg-509"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " The number of the taps =  47.0\n"
     ]
    }
   ],
   "source": [
    "# Example 11.1\n",
    "# Calculation of the minimum number of taps needed to compensate for the fiber dispersion\n",
    "# Page no 509\n",
    "\n",
    "import math\n",
    "\n",
    "# Given data\n",
    "b=22*10**-27;                 # Power launched in port 1\n",
    "l=800*10**3;                  # Power launched in port 2\n",
    "T=50*10**-12;                # Power launched in port 3 \n",
    "\n",
    "\n",
    "# Bit rate of communication system\n",
    "k=math.ceil((math.pi*b*l)/T**2);\n",
    "n=(2*k)+1;\n",
    "\n",
    "\n",
    "# Displaying results in the command window            \n",
    "print \"\\n The number of the taps = \",round(n,3)\n",
    "# The answers vary due to round off error\n"
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
