{
 "metadata": {
  "name": "",
  "signature": "sha256:fc6706355245368084174ebaf68c877ff8fa2581b1104eec814db836f65c5c69"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 15 Filters"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Example 15.1 Page no 547"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "fH=2000                         #Hz\n",
      "C=0.01*10**-6                   #F\n",
      "Af=2                            #gain\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "R=1/(2.0*math.pi*fH*C)\n",
      "Rf=Af-1\n",
      "\n",
      "#Result\n",
      "print\"In this case R1=Rf=10 Kohm is selected.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In this case R1=Rf=10 Kohm is selected.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.2 Page no 547"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "wc=20.0                          #K radian/s\n",
      "C=0.01                          #micro F\n",
      "\n",
      "#Calculation\n",
      "R=1/(wc*C)\n",
      "\n",
      "#Result\n",
      "print\"The value of resistance is \", R,\"K ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of resistance is  5.0 K ohm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.3 Page no 550"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "fh=2000                         #Hz\n",
      "C2=0.0033*10**-6                #F\n",
      "C3=0.0033*10**-6                #F\n",
      "R0=0.586                        #ohm\n",
      "R1=10000                        #ohm\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "R=1/(2*math.pi*fh*C2)\n",
      "Rf=R0*R1\n",
      "\n",
      "#Result\n",
      "print\" R2=R3=\",round(R*10**-3,0),\"Kohm \\n C2=C3=\",C2 ,\"micro F \\n Rf=\",Rf*10**-3,\"Kohm \\n R1=\",R1*10**-3,\"Kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " R2=R3= 24.0 Kohm \n",
        " C2=C3= 3.3e-09 micro F \n",
        " Rf= 5.86 Kohm \n",
        " R1= 10.0 Kohm\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.4 Page no 553"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R=47*10**3                      #ohm\n",
      "C=0.0022*10**-6                 #F\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "fl=1/(2.0*math.pi*R*C)\n",
      "\n",
      "#Result\n",
      "print\"The cutoff frequency is \", round(fl*10**-3,2),\"KHz\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The cutoff frequency is  1.54 KHz\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.5 Page no 557"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "C=0.01*10**-6                         #f\n",
      "fh=1000                                #Hz\n",
      "fl=100\n",
      "\n",
      "#Calculation\n",
      "R=1/(2.0*math.pi*fh*C)\n",
      "R1=1/(2.0*math.pi*fl*C)\n",
      "fc=math.sqrt(fl*fh)\n",
      "Q=fc/(fh-fl)\n",
      "\n",
      "#Result\n",
      "print\"(i) Resistance is \", round(R1*10**-3,0),\"Kohm\"\n",
      "print\"(ii) The value of Q is \",round(Q,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Resistance is  159.0 Kohm\n",
        "(ii) The value of Q is  0.35\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.6 Page no 561"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "C=0.01                          #F\n",
      "Q=5\n",
      "Fc=1000                              #Hz\n",
      "Av0=8\n",
      "a=1000                             #Hz\n",
      "b=1.5*10**3                         #Hz\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "R1=Q/(2.0*math.pi*C*Av0)\n",
      "R2=(Q/(2.0*math.pi*Fc*C*(2*Q**2-Av0)))*10**3\n",
      "R3=Q/(math.pi*Fc*C)\n",
      "Rk=R2*((a/b)**2)\n",
      "\n",
      "#Result\n",
      "print\"(i) Resistances are \\n R1=\",round(R1,0),\"Kohm \\n R2=\",round(R2,0),\"Kohm \\n R3=\",round(R3*10**3,0),\"Kohm\"\n",
      "print\"(ii) The value of resistance is \", round(Rk*10**3,0),\"ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Resistances are \n",
        " R1= 10.0 Kohm \n",
        " R2= 2.0 Kohm \n",
        " R3= 159.0 Kohm\n",
        "(ii) The value of resistance is  842.0 ohm\n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.7 Page no 563"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "fl=100                            #Hz\n",
      "fh=1000                            #Hz\n",
      "R=159                       #Kohm, for low pass filter\n",
      "C=0.1                     #micro F , for low pass filter\n",
      "R1=15.9                      # K ohm, for high pass filter\n",
      "C1=0.01                   #micro F ,  for high pass filter\n",
      "R2=10.0                        #K ohm\n",
      "R3=10.0                     #K ohm\n",
      "R4=10.0                        #K ohm\n",
      "\n",
      "#Calculation\n",
      "Rom=(R2*R3*R4)/(R2+R3+R4)*10**-1\n",
      "\n",
      "#Result\n",
      "print\"Value of resistance is \", round(Rom,1),\"Kohm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of resistance is  3.3 Kohm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.8 Page no 564"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "C=0.047                   #micro F\n",
      "fn=50                             #Hz\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "R=1/(2.0*math.pi*fn*C)\n",
      "\n",
      "#Result\n",
      "print\"The value of resistance is \", round(R*10**3,0),\"Kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of resistance is  68.0 Kohm\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.9 Page no 566"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "C=0.01                      #micro F\n",
      "R=15                        #K ohm\n",
      "f=2.5                        #K ohm\n",
      "\n",
      "import math\n",
      "b=2*math.pi*f*C*R\n",
      "a=-(2*math.atan(b)*180/3.14)\n",
      "\n",
      "#Result\n",
      "print\"Phase angle is \", round(a,0)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Phase angle is  -134.0\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.10 Page no 570"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "R=316.0                 #ohm\n",
      "a=10.0\n",
      "R1=100                              #ohm\n",
      "F1=1.5 *10**3                       #Hz\n",
      "c=5.03*10**7\n",
      "R6=1.8*10**3\n",
      "\n",
      "#Calculation\n",
      "R2=R/a\n",
      "R3=R1/(R*a-1)\n",
      "R4=c/F1\n",
      "R7=6*R6 \n",
      "R8=(R6*R7)/(R6+R7)\n",
      "\n",
      "print\"value of external component are \\n R2=\",R2,\"Kohm \\n R3=\",round(R3*10**2,1),\"Kohm \\n R4=R5=\", round(R4*10**-3,2)\n",
      "print\" R7=\",R7*10**-3,\"Kohm \\n R8=\", round(R8*10**-3,3),\"Kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of external component are \n",
        " R2= 31.6 Kohm \n",
        " R3= 3.2 Kohm \n",
        " R4=R5= 33.53\n",
        " R7= 10.8 Kohm \n",
        " R8= 1.543 Kohm\n"
       ]
      }
     ],
     "prompt_number": 60
    }
   ],
   "metadata": {}
  }
 ]
}