{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ch-11 : Frequency Response of Amplifiers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Page No. 380 Example 11.2."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BW = 0.35 / tr =35.00 MHz\n"
     ]
    }
   ],
   "source": [
    "tr=10*10**-9\n",
    "BW=0.35/tr\n",
    "x1=BW*10**-6\n",
    "print \"BW = 0.35 / tr =%0.2f MHz\"%x1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Page No. 382 Example 11.3."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "AV = (-hfe*RL) / (RS + hie + ((hie*RS)/RB)) =-145.70 MF\n",
      "Lower 3-dB point,\n",
      "f1 = (1+hfe) / ((RS+hie)*2*pi*CE) =120.42\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "hfe=400.\n",
    "hie=10*10**3\n",
    "Rs=600.\n",
    "RL=5*10**3\n",
    "RE=1*10**3\n",
    "VCC=12.\n",
    "R1=15*10**3\n",
    "R2=2.2*10**3\n",
    "CE=50*10**-6\n",
    "RB=(R1*R2)/(R1+R2)\n",
    "Av=(-hfe*RL)/(Rs+hie+((hie*Rs)/RB))\n",
    "print \"AV = (-hfe*RL) / (RS + hie + ((hie*RS)/RB)) =%0.2f MF\"%Av\n",
    "print \"Lower 3-dB point,\"\n",
    "f1=(1.+hfe)/((Rs+hie)*2*pi*CE)\n",
    "print \"f1 = (1+hfe) / ((RS+hie)*2*pi*CE) =%0.2f\"%f1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Page No. 386 Example 11.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The lower 3 dB frequency, f1 = 1 / (2*pi*(RS+R1dash)*CC)\n",
      "(a)    R1'' = R1 || R2 || hie =500.00 ohm \n",
      "       CC = 1 / (2*pi*f1*(RS+R1'')) =1.16 uF\n",
      "(b)    R1''(ohm) = R1 || R2 || [hie+((1+hfe)*RCE)] =716.31 ohm\n",
      "       CC = 1 / (2*pi*f1*(RS+R1'')) =0.97 uF\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "RS=600.\n",
    "hie=1*10**3\n",
    "hfe=60.\n",
    "R1=5*10**3\n",
    "R2=1.25*10**3\n",
    "RCE=25.\n",
    "f1=125.\n",
    "print \"The lower 3 dB frequency, f1 = 1 / (2*pi*(RS+R1dash)*CC)\"\n",
    "R1dash=(R1*R2*hie)/((R2*hie)+(R1*hie)+(R1*R2))\n",
    "CC=1 / (2*pi*f1*(RS+R1dash))\n",
    "x1=CC*10**6\n",
    "print \"(a)    R1'' = R1 || R2 || hie =%0.2f ohm \"%R1dash\n",
    "print \"       CC = 1 / (2*pi*f1*(RS+R1'')) =%0.2f uF\"%x1\n",
    "x2=hie+((1.+hfe)*RCE)\n",
    "R1dash=(R1*R2*x2)/((R2*x2)+(R1*x2)+(R1*R2))\n",
    "CC=1 / (2*pi*f1*(RS+R1dash))\n",
    "x3=CC*10**6\n",
    "print \"(b)    R1''(ohm) = R1 || R2 || [hie+((1+hfe)*RCE)] =%0.2f ohm\"%R1dash\n",
    "print \"       CC = 1 / (2*pi*f1*(RS+R1'')) =%0.2f uF\"%x3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Page No. 390 Example 11.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  gm = IC(mA)/26mV = 1/26 =38.46 m-mho\n",
      "  rb''e = hfe / gm =5.82 kohm\n",
      "  rbb'' = hie - rb''e = 6000-5824 =176.00 ohm\n",
      "  cb''e(pF) = gm/2*pi*fT - Cb''c =64.51 pF\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "gm=1./26 #mho\n",
    "x1=gm*10**3  #m-mho\n",
    "print \"  gm = IC(mA)/26mV = 1/26 =%0.2f m-mho\"%x1\n",
    "rbe=224./(38.46*10**-3)\n",
    "x2=rbe*10**-3 #k-ohm\n",
    "print \"  rb''e = hfe / gm =%0.2f kohm\"%x2\n",
    "rbb=6000.-5824. #ohm\n",
    "print \"  rbb'' = hie - rb''e = 6000-5824 =%0.2f ohm\"%rbb\n",
    "cbe=((38.46*10**-3)/(2*pi*(80*10**6)))-(12*10**-12) # farad\n",
    "x3=cbe*10**12 #pF\n",
    "print \"  cb''e(pF) = gm/2*pi*fT - Cb''c =%0.2f pF\"%x3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Page No. 392 Example 11.6."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  f_alpha = hfe / 2*pi*rb''e*Cb''e =95.91 MHz\n",
      "  f_beta = 1 / 2*pi*rb''e*(Cb''e+Cb''c) =0.36 MHz\n",
      "  fT = gm / 2*pi*(Cb''e+Cb''c) =80.64 MHz\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "alpha=224./(2*pi*(5.9*10**3)*(63*10**-12)) #Hz\n",
    "x1=alpha*10**-6 #MHz\n",
    "print \"  f_alpha = hfe / 2*pi*rb''e*Cb''e =%0.2f MHz\"%x1\n",
    "beta=1/(2*pi*(5.9*10**3)*((63*10**-12)+(12*10**-12)))\n",
    "x2=beta*10**-6\n",
    "print \"  f_beta = 1 / 2*pi*rb''e*(Cb''e+Cb''c) =%0.2f MHz\"%x2\n",
    "fT=(38*10**-3)/(2*pi*((63*10**-12)+(12*10**-12)))\n",
    "x3=fT*10**-6\n",
    "print \"  fT = gm / 2*pi*(Cb''e+Cb''c) =%0.2f MHz\"%x3"
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
