diff options
Diffstat (limited to 'OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter7.ipynb')
-rw-r--r-- | OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter7.ipynb | 1543 |
1 files changed, 1543 insertions, 0 deletions
diff --git a/OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter7.ipynb b/OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter7.ipynb new file mode 100644 index 00000000..924541b2 --- /dev/null +++ b/OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter7.ipynb @@ -0,0 +1,1543 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Chapter 7: Active Filters and Oscillators" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.1" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R is 15.9 kOhms\n", + "Use 20 kohm POT as R\n", + "Resistance R1 is 10.0 kilo ohms\n", + "Resistance Rf is 10.0 kilo ohms\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.1\n", + "#Design a low pass filter at a cutoff frequency of 1kHz\n", + "#with a passband gain of 2\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fh=1*10**3 #Cut-off frequency\n", + "C=0.01*10**-6 #Assumption\n", + "R1=10*10**3 #Assumption\n", + "Rf=R1 #Since passband gain is 2,R1 and Rf must be equal\n", + "\n", + "\n", + "#calculation\n", + "R=1/(2*math.pi*fh*C)\n", + "\n", + "#result\n", + "print \"Resistance R is\",round(R/10**3,1),\"kOhms\"\n", + "print \"Use 20 kohm POT as R\"\n", + "print \"Resistance R1 is\",round(R1/10**3),\"kilo ohms\"\n", + "print \"Resistance Rf is\",round(Rf/10**3),\"kilo ohms\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.2" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "New Resistance Rnew is 9937.5 Ohms\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.2\n", + "#Using the frequency scaling technique,convert the 1 kHz cutoff frequency of the\n", + "#lowpass filter of example 7-1 to a cutoff frequency of 1.6 kHz.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fc0=1*10**3 #Original cut-off frequency\n", + "fc1=1.6*10**3 #New cut-off frequency\n", + "R=15.9*10**3 #Original resistance value\n", + "\n", + "#calculation\n", + "k=fc0/fc1\n", + "Rnew=R*k\n", + "\n", + "#result\n", + "print \"New Resistance Rnew is\",Rnew,\"Ohms\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.3" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEfCAYAAABSy/GnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu8VXP+x/HXUShKN6JQJ5ViUkqSkdokd9PkltAdhcEM\noTDTiXEbufxyHyJFURq5RzgbuUSp5NKoo1CaiKR00eX8/vis3V5nt885++zbd1/ez8djP85aa6+9\n1md/H7U++/v9rvX9goiIiIiIiIiIiIiIiIiIiIiIiIiIiIikUStgHvAr8BfHsYiISAYbC9zpOggR\nic9OrgOQvNIU+KKC9/Pp32OB9xIRkQhvAVuADViTVEtgHPAg8AqwDjgWaAxMBX4AvgYu8x2jpveZ\nn4HPgauB73zvbwMO8K2PA27yrZ+KNYmtBt4DDvG9txS4CpgP/AI8Dezqe7+n99k1wGLgBOAsYHbE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M+DYiO1fY01fzbHbc6uqLTaj\nmp7BEBEREREREREREREREREREREREREREUm+/wf1RctJBunj/AAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f1f62117f50>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain magnitude av1 at f1 2.0\n", + "Gain magnitude av2 at f2 1.99\n", + "Gain magnitude av2 at f2 1.96\n", + "Gain magnitude av2 at f2 1.64\n", + "Gain magnitude av2 at f2 1.41\n", + "Gain magnitude av2 at f2 0.63\n", + "Gain magnitude av2 at f2 0.28\n", + "Gain magnitude av2 at f2 0.2\n", + "Gain magnitude av2 at f2 0.07\n", + "Gain magnitude av2 at f2 0.02\n" + ] + } + ], + "source": [ + "#Example 7.3\n", + "#Plot the frequency response of the lowpass filter of example 7.1\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "%matplotlib inline\n", + "\n", + "from scipy import pi\n", + "from matplotlib.pyplot import ylabel, xlabel, title, plot, show, clf, semilogx\n", + "import math\n", + "import numpy as np\n", + "\n", + "#Variable declaration\n", + "Af=2 #Passband gain of the filter\n", + "fh=1000 #Cut-off frequency\n", + "\n", + "f1=10\n", + "f2=100\n", + "f3=200\n", + "f4=700\n", + "f5=1000\n", + "f6=3000\n", + "f7=7000\n", + "f8=10000\n", + "f9=30000\n", + "f10=100000\n", + "\n", + "\n", + "#calculation\n", + "av1=Af/math.sqrt(1+(f1/fh)**2)\n", + "av2=Af/math.sqrt(1+(f2/fh)**2)\n", + "av3=Af/math.sqrt(1+(f3/fh)**2)\n", + "av4=Af/math.sqrt(1+(f4/fh)**2)\n", + "av5=Af/math.sqrt(1+(f5/fh)**2)\n", + "av6=Af/math.sqrt(1+(f6/fh)**2)\n", + "av7=Af/math.sqrt(1+(f7/fh)**2)\n", + "av8=Af/math.sqrt(1+(f8/fh)**2)\n", + "av9=Af/math.sqrt(1+(f9/fh)**2)\n", + "av10=Af/math.sqrt(1+(f10/fh)**2)\n", + "\n", + "#Magnitude plot\n", + "f=np.arange(0,100000)\n", + "s=2.0j*pi*f\n", + "p=2.0*pi*fh\n", + "A=Af*p/(s+p)\n", + "\n", + "clf() #clear the figure\n", + "plot()\n", + "title('frequency response')\n", + "semilogx(f,20*np.log10(abs(A)))\n", + "ylabel('Voltage gain(dB)')\n", + "xlabel('frequency(Hz)')\n", + "show()\n", + "\n", + "\n", + "#result\n", + "print \"Gain magnitude av1 at f1\",round(av1,2)\n", + "print \"Gain magnitude av2 at f2\",round(av2,2)\n", + "print \"Gain magnitude av2 at f2\",round(av3,2)\n", + "print \"Gain magnitude av2 at f2\",round(av4,2)\n", + "print \"Gain magnitude av2 at f2\",round(av5,2)\n", + "print \"Gain magnitude av2 at f2\",round(av6,2)\n", + "print \"Gain magnitude av2 at f2\",round(av7,2)\n", + "print \"Gain magnitude av2 at f2\",round(av8,2)\n", + "print \"Gain magnitude av2 at f2\",round(av9,2)\n", + "print \"Gain magnitude av2 at f2\",round(av10,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.4.a" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R2 is 33.86 kOhm\n", + "Resistance R3 is 33.86 kOhm\n", + "Resistance Rf is 15.82 kOhm\n", + " Use 20 kohm POT as Rf\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.4.a\n", + "#Design a second order low-pass filter at a high cutoff frequency of 1 kHz.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fh=1*10**3 # Cut-off frequency\n", + "C2=0.0047*10**-6 # Assumption\n", + "C3=C2\n", + "R1=27*10**3 # Assumption\n", + "\n", + "#calculation\n", + "R2=1/(2*math.pi*fh*C2)\n", + "R3=R2\n", + "Rf=0.586*R1\n", + "\n", + "\n", + "#result\n", + "print \"Resistance R2 is\",round(R2/10**3,2),\"kOhm\"\n", + "print \"Resistance R3 is\",round(R3/10**3,2),\"kOhm\"\n", + "print \"Resistance Rf is\",round(Rf/10**3,2),\"kOhm\"\n", + "print \" Use 20 kohm POT as Rf\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.4.b" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEfCAYAAABSy/GnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8VfP+x/HXqUSIBjSpTmkgVKRwKVsZwnXjGpLhFn6F\nriG6aPDT6cqVoSvDL9Igoch4M0VimxVpQl2VTpwGJaW6LhrO74/P2u11dnufs885e+/vHt7Px2M/\n9lprr73W53xlffb3+13r+wURERERERERERERERERERERERERERERSaHWwHxgM3Ct41hERCSNTQBG\nuQ5CRCqmiusAJKc0Bb4u5fNc+veY571ERCTCO8B24L9Yk1RLYBLwCPA6sBXoCjQEXgDWAd8C1/mO\nUcP7zk/AV8DNwPe+z3cCzX3rk4A7fOt/xJrENgIfAUf6PisEBgILgE3AM8Cevs97eN/9GVgGnA5c\nAHwe8XfeBLwcvQgIAiO8c//ixXooMBPYACzxjhlypvd3bgaKvPgAAt76YGA9sAK42Pe9/YHJWBkW\nAkMJJ6c+wIfAvVg5fgt09323D7DcO+e3Ece9Akv4PwEzgCYx/k4RkUp7F7vohEzCLs7He+s1gLnA\nbUA1oBl28TrN+3wk8B5QCzgY+BL4zne8yITxOPB3b/ko4AegI3bx/At2od3D+3wF8ClQH6iNXRiv\n8j7r5MXZzVtviPXHVMcu9If6zjkPODfG3x/ELuCHYbWp/bGE19tbb48lgNDx1gAneMv7e38DWMLY\nBtznxd8FS7itvM8nAy8B+2C1un8TLvc+wO/AlV45XA2s8j7bB0uILb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ExhH+NZ9PyXF4/gYM\n85YPwWbw+xx4H2jtbZ+ETVD0ETZmz3m+79+KXcjnA//w4pzr+7ylb/0iYHrE35YXY/l1YJ732oTN\nbY8X3wWIiEhMK7AL/jDgM8JTTk4BTvCWm2DNVgAPYvN9g828tpPoCWMgcLu3PAurBQAc662DJYxn\nveXDsBkPwcbv+QjYy1uv5b2/A7Tzlv8B/NVbfgM42nfuQizZhBLDUnZPKB2wZFTTWz/ZF4tIwqhJ\nSrJN6Bf4dGzwNYBTKDkyZ02s2aczNkUl2K/1jWUcdx+sdvKcb3t1770YeNlbXgzU8517IvCrt77J\nex+PDQp3E3Ah0NHb3hRY4zt+MdZv8ZO3fhJW4wk5AKtNXQBs8batwZKeSEIpYUi2+sW3nIfVBn6P\nsl9elG3bKdlcWwO7cFfBkspRMc7pP37ouMUxzvECVhN6B2uO8ieraPtH+6wqNjLpcMK1ptA+mjxI\nEk59GJIL3sLuoAoJNQW9D1zsLZ8B1PaWf8A6jetgzVp/9LZvwZq9zvfW87C7kkozE6tJ1PDWQ+f4\nDXgTeASrgYSsBBqU9Qd5RmLNVdMitjfwjiOSUEoYkk2KYyxfDxwDLAC+Aq7ytg8HumCd3ucC33nb\ntwF/xzrI36Lkr/dLgCuxPoMvgT+Vcf43seaxz7E+iIG+faZg/SZv+bZ96MUa7Zih9dC2gcCphPs3\nQomtE5YMRUQkSUKd5qnyNyxp+TUHXqvkcYNYDUkkodSHIRKWynb/l4BmQNeI7d9iTV+HYLfnlldb\nbEY1PYMhIiIiIiIiIiIiIiIiIiIiIiIiIiIiknj/Dz31z/sMKjRSAAAAAElFTkSuQmCC\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f1f625aac10>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain magnitude av1 at f1 1.59\n", + "Gain magnitude av2 at f2 1.59\n", + "Gain magnitude av2 at f2 1.58\n", + "Gain magnitude av2 at f2 1.42\n", + "Gain magnitude av2 at f2 1.12\n", + "Gain magnitude av2 at f2 0.18\n", + "Gain magnitude av2 at f2 0.03\n", + "Gain magnitude av2 at f2 0.02\n", + "Gain magnitude av2 at f2 1.76 *10^-3\n", + "Gain magnitude av2 at f2 0.16 *10^-3\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.4.b\n", + "#Draw the frequency response of the network in example 7.4.a\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "%matplotlib inline\n", + "\n", + "from scipy import pi\n", + "from matplotlib.pyplot import ylabel, xlabel, title, plot, show, clf, semilogx\n", + "import math\n", + "import numpy as np\n", + "#Variable declaration\n", + "Af=1.586 #Passband gain of the filter\n", + "fh=1000 #Cut-off frequency\n", + "\n", + "f1=10\n", + "f2=100\n", + "f3=200\n", + "f4=700\n", + "f5=1000\n", + "f6=3000\n", + "f7=7000\n", + "f8=10000\n", + "f9=30000\n", + "f10=100000\n", + "\n", + "\n", + "#calculation\n", + "av1=Af/math.sqrt(1+(f1/fh)**4)\n", + "av2=Af/math.sqrt(1+(f2/fh)**4)\n", + "av3=Af/math.sqrt(1+(f3/fh)**4)\n", + "av4=Af/math.sqrt(1+(f4/fh)**4)\n", + "av5=Af/math.sqrt(1+(f5/fh)**4)\n", + "av6=Af/math.sqrt(1+(f6/fh)**4)\n", + "av7=Af/math.sqrt(1+(f7/fh)**4)\n", + "av8=Af/math.sqrt(1+(f8/fh)**4)\n", + "av9=Af/math.sqrt(1+(f9/fh)**4)\n", + "av10=Af/math.sqrt(1+(f10/fh)**4)\n", + "\n", + "#Magnitude plot\n", + "f=np.arange(0,100000) #frequency range\n", + "s=2.0j*pi*f**2\n", + "p=2.0*pi*fh**2\n", + "A=Af*p/(s+p)\n", + "\n", + "clf() #clear the figure\n", + "plot()\n", + "title('frequency response')\n", + "semilogx(f,20*np.log10(abs(A)))\n", + "ylabel('Voltage gain(dB)')\n", + "xlabel('frequency(Hz)')\n", + "show()\n", + "\n", + "\n", + "#result\n", + "print \"Gain magnitude av1 at f1\",round(av1,2)\n", + "print \"Gain magnitude av2 at f2\",round(av2,2)\n", + "print \"Gain magnitude av2 at f2\",round(av3,2)\n", + "print \"Gain magnitude av2 at f2\",round(av4,2)\n", + "print \"Gain magnitude av2 at f2\",round(av5,2)\n", + "print \"Gain magnitude av2 at f2\",round(av6,2)\n", + "print \"Gain magnitude av2 at f2\",round(av7,2)\n", + "print \"Gain magnitude av2 at f2\",round(av8,2)\n", + "print \"Gain magnitude av2 at f2\",round(av9*10**3,2),\"*10^-3\"\n", + "print \"Gain magnitude av2 at f2\",round(av10*10**3,2),\"*10^-3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.5.a" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R is 15.92 kOhm\n", + "Resistance R1 is 10.0 kOhm\n", + "Resistance Rf is 10.0 kOhm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.5.a\n", + "#Design a high pass filter at a cutoff frequency of 1 kHz with a passband gain\n", + "#of 2.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fh=1*10**3 #Cut-off frequency\n", + "C=0.01*10**-6 #Assumption\n", + "Af=2\n", + "\n", + "#calculation\n", + "R=1/(2*math.pi*fh*C)\n", + "R1=10*10**3\n", + "Rf=R1 #since passband gain is 2\n", + "\n", + "\n", + "#result\n", + "print \"Resistance R is\",round(R/10**3,2),\"kOhm\"\n", + "print \"Resistance R1 is\",round(R1/10**3,2),\"kOhm\"\n", + "print \"Resistance Rf is\",round(Rf/10**3,2),\"kOhm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.5.b" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KG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fYS3+17gJTQLQ+Ysvnbt40/kTERERERERERERERERERERERER\nERERERERkbzpBczEHjkZZ88A7b3peUBL37oE8O8sn90bGBJKVFLymrgOQCSPLsYeovWtb1kTYI2b\ncHKyI/aM7NRz6dMHjatrELlPsEdttga+y29oUuriNvigSG0ewH6VjwV+Bh4DxgOPAq2AZ4GJ3usg\n7zObA68C04GHqP41X07NcXiuAPp40ztgj5KdBLwN7OItfwR7CNS72Jg9p/g+fxV2IZ8K9PPinOxb\nv5Nv/lRgdNp3K6tl+mVgivf6GTjTWz4G6IqIiNRqLnbB7wN8CGzgLX8K6ORNb4dVWwHcA1zvTR8L\nrCNzwuh944DWAAAB/ElEQVQN/K83/QZWCgA40JsHSxjPeNO7YY/BBBu/511gQ2++uff+JvA7b7of\ncKk3PQbY13fseViySSWG2fw2oeyHJaNNvPnDfLGI5I2qpKTYpH6Bj8YGXwP4IzVH5twEq/bpjD2i\nEuzX+k917LcZVjrxP/t4fe89iT3TGuBToI3v2EOBld78z977YGxQuMuBvwAHeMvbAQt9+09i7RY/\nevOHYiWelFZYaaorsMxbthBLeiJ5pYQhxeoX33QZVhpYnWG7sgzL1lCzurYpduFuhCWVfWo5pn//\nqf0maznGc1hJ6E2sOsqfrDJtn2ldY2xk0r5Ul5pS2+iBR5J3asOQUvAqdgdVSqoq6G3gdG/6GKCF\nN70YazRuiVVrHe8tX4ZVe/3Zmy/D7krK5jWsJNHUm08dYxXwCnA/VgJJmQ9sVdcX8tyKVVcNT1u+\nlbcfkbxSwpBikqxluhewP/AxMAO4yFveFzgEa/Q+CfjKW14F3Ig1kL9KzV/v3YHzsTaD6cCJdRz/\nFax6bBLWBtHbt81TWLvJq75l471YM+0zNZ9a1hs4gur2jVRi64glQxERCUmq0TwqV2BJy6898FID\n91uJlZBE8kptGCLVoqz3HwlsD/whbfmXWNXXDtjtufW1N/ZENfXBEBERERERERERERERERERERER\nEREREcm//wehVjGzCowgOwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f1f6224dcd0>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain magnitude av1 at f1 0.2\n", + "Gain magnitude av2 at f2 0.39\n", + "Gain magnitude av2 at f2 0.74\n", + "Gain magnitude av2 at f2 1.15\n", + "Gain magnitude av2 at f2 1.41\n", + "Gain magnitude av2 at f2 1.9\n", + "Gain magnitude av2 at f2 1.98\n", + "Gain magnitude av2 at f2 1.99\n", + "Gain magnitude av2 at f2 2.0\n", + "Gain magnitude av2 at f2 2.0\n" + ] + } + ], + "source": [ + "#Example 7.5.b\n", + "#The circuit of figure 6-17,for the indicated value of resistors\n", + "#determine the full scale range for the input voltage.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "%matplotlib inline\n", + "import numpy as np\n", + "from scipy import pi\n", + "from matplotlib.pyplot import ylabel, xlabel, title, plot, show, clf, semilogx\n", + "import matplotlib.pyplot as plt\n", + "import math\n", + "\n", + "#Variable declaration\n", + "Af=2 #Passband gain of the filter\n", + "fl=1000 #Cut-off frequency\n", + "\n", + "f1=100\n", + "f2=200\n", + "f3=400\n", + "f4=700\n", + "f5=1000\n", + "f6=3000\n", + "f7=7000\n", + "f8=10000\n", + "f9=30000\n", + "f10=100000\n", + "\n", + "\n", + "#calculation\n", + "av1=(Af*(f1/fl))/math.sqrt(1+(f1/fl)**2)\n", + "av2=(Af*(f2/fl))/math.sqrt(1+(f2/fl)**2)\n", + "av3=(Af*(f3/fl))/math.sqrt(1+(f3/fl)**2)\n", + "av4=(Af*(f4/fl))/math.sqrt(1+(f4/fl)**2)\n", + "av5=(Af*(f5/fl))/math.sqrt(1+(f5/fl)**2)\n", + "av6=(Af*(f6/fl))/math.sqrt(1+(f6/fl)**2)\n", + "av7=(Af*(f7/fl))/math.sqrt(1+(f7/fl)**2)\n", + "av8=(Af*(f8/fl))/math.sqrt(1+(f8/fl)**2)\n", + "av9=(Af*(f9/fl))/math.sqrt(1+(f9/fl)**2)\n", + "av10=(Af*(f10/fl))/math.sqrt(1+(f10/fl)**2)\n", + "\n", + "#Magnitude plot\n", + "f=np.arange(100,100000)\n", + "s=2.0j*pi*f\n", + "p=2.0*pi*fl\n", + "A=Af*s/(s+p)\n", + "\n", + "clf() #clear the figure\n", + "plt.plot()\n", + "plt.title('frequency response')\n", + "semilogx(f,20*np.log10(abs(A)))\n", + "plt.ylabel('Voltage gain(dB)')\n", + "plt.xlabel('frequency(Hz)')\n", + "plt.show()\n", + "\n", + "\n", + "#result\n", + "print \"Gain magnitude av1 at f1\",round(av1,2)\n", + "print \"Gain magnitude av2 at f2\",round(av2,2)\n", + "print \"Gain magnitude av2 at f2\",round(av3,2)\n", + "print \"Gain magnitude av2 at f2\",round(av4,2)\n", + "print \"Gain magnitude av2 at f2\",round(av5,2)\n", + "print \"Gain magnitude av2 at f2\",round(av6,2)\n", + "print \"Gain magnitude av2 at f2\",round(av7,2)\n", + "print \"Gain magnitude av2 at f2\",round(av8,2)\n", + "print \"Gain magnitude av2 at f2\",round(av9,2)\n", + "print \"Gain magnitude av2 at f2\",round(av10,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.6.a" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Lower cutoff frequency fl is 1.0 kHz\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.6.a\n", + "#Determine the low cutoff frequency fl of the filter shown in figure 7-8(a)\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "R2=33*10**3 #Resistance in ohms\n", + "R3=R2\n", + "C2=0.0047*10**-6 #Capacitance in Farads\n", + "C3=C2\n", + "\n", + "#calculation\n", + "fl=1/(2*math.pi*math.sqrt(R2*R3*C2*C3))\n", + "\n", + "\n", + "#result\n", + "print \"Lower cutoff frequency fl is\",round(fl/10**3,0),\"kHz\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.6.b" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEfCAYAAABSy/GnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcE/X9x/EXoHgAKlbrgcAiVW4VD5QqmGq1XoWfVYut\ntShKUSteqFz+YNGqeIFWK/UWT6T6E8UL1iOCJ6BAAQU5BDm8UEEQ0IXN74/PxJ0N2exsNsl3kryf\nj0cemZlMZj5h2HzyPeb7BRERERERERERERERERERERERERERERHJoTbALOB74GLHsYiISIg9ANzm\nOggRSU991wFIUWkJfJTi9WL6/1jPe4iISILXgc3ARqxKaj/gYWAM8BKwHjgG2Bt4BvgKWAL09x1j\nB+893wLzgKuA5b7XK4B9fesPA9f51k/BqsS+A94GOvleWwoMAGYDa4BxwHa+13t6710LLAJ+B5wB\nzEj4nFcAE5L/ExAF/uGde4MXa1ugDPgGmO8dM+4k73N+D6zw4gOIeOuDga+BT4E/+963M/AI9m+4\nFBhKZXI6B3gLuAX7d1wCnOB77znAYu+cSxKO2wdL+N8CrwAtqvmcIiJ19gb2pRP3MPbl3NVb3wH4\nALgG2AZohX15He+9PhJ4E9gF2AeYC3zmO15iwngIuNZb7gx8CRyGfXn+Ffui3dZ7/VPgPWBPoCn2\nxdjPe62LF+ex3vreWHtMQ+yLvq3vnDOBU6v5/FHsC7wdVpraGUt4vb31g7AEED/e58CR3vLO3mcA\nSxjlwK1e/N2xhLu/9/ojwLNAI6xUt4DKf/dzgJ+A87x/hwuAld5rjbCEuJ+3vgfQ3lvuCSz0Pnd9\nLAm9Xc3nFBGpszewL6q4h7CkEXc4sCzhPYOBB71lf/IA6EvqEoY/YYzxLcfNB7p5y4m/0m/y3gNw\nD9W3vYzB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0LvFjH40axEpJIRqkNQ6RSLuv9nwVaAcckbF+CVX21xrrn1tYB2IxqugdD\nREREREREREREREREREREREREREREJPP+H8OfoWq60nwKAAAAAElFTkSuQmCC\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f1f8840ec50>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain magnitude av1 at f1 0.0159\n", + "Gain magnitude av2 at f2 0.0634\n", + "Gain magnitude av2 at f2 0.2506\n", + "Gain magnitude av2 at f2 0.6979\n", + "Gain magnitude av2 at f2 1.1215\n", + "Gain magnitude av2 at f2 1.5763\n", + "Gain magnitude av2 at f2 1.5857\n", + "Gain magnitude av2 at f2 1.5859\n", + "Gain magnitude av2 at f2 1.586\n", + "Gain magnitude av2 at f2 1.586\n" + ] + } + ], + "source": [ + "#Example 7.6.b\n", + "#Draw the frequency response plot of the filter in example 7.6.a\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "%matplotlib inline\n", + "\n", + "from scipy import pi\n", + "from matplotlib.pyplot import ylabel, xlabel, title, plot, show, clf, semilogx\n", + "import math\n", + "import numpy as np\n", + "#Variable declaration\n", + "Af=1.586 #Passband gain of the filter\n", + "fl=1000 #Cut-off frequency\n", + "\n", + "f1=100\n", + "f2=200\n", + "f3=400\n", + "f4=700\n", + "f5=1000\n", + "f6=3000\n", + "f7=7000\n", + "f8=10000\n", + "f9=30000\n", + "f10=100000\n", + "\n", + "\n", + "#calculation\n", + "av1=Af/math.sqrt(1+(fl/f1)**4)\n", + "av2=Af/math.sqrt(1+(fl/f2)**4)\n", + "av3=Af/math.sqrt(1+(fl/f3)**4)\n", + "av4=Af/math.sqrt(1+(fl/f4)**4)\n", + "av5=Af/math.sqrt(1+(fl/f5)**4)\n", + "av6=Af/math.sqrt(1+(fl/f6)**4)\n", + "av7=Af/math.sqrt(1+(fl/f7)**4)\n", + "av8=Af/math.sqrt(1+(fl/f8)**4)\n", + "av9=Af/math.sqrt(1+(fl/f9)**4)\n", + "av10=Af/math.sqrt(1+(fl/f10)**4)\n", + "\n", + "#Magnitude plot\n", + "f=np.arange(100,100000)\n", + "s=2.0j*pi*fl**2\n", + "p=2.0*pi*f**2\n", + "A=Af*p/(s+p)\n", + "\n", + "\n", + "clf() #clear the figure\n", + "plot()\n", + "title('frequency response')\n", + "semilogx(f,20*np.log10(abs(A)))\n", + "ylabel('Voltage gain(dB)')\n", + "xlabel('frequency(Hz)')\n", + "show()\n", + "\n", + "\n", + "#result\n", + "print \"Gain magnitude av1 at f1\",round(av1,4)\n", + "print \"Gain magnitude av2 at f2\",round(av2,4)\n", + "print \"Gain magnitude av2 at f2\",round(av3,4)\n", + "print \"Gain magnitude av2 at f2\",round(av4,4)\n", + "print \"Gain magnitude av2 at f2\",round(av5,4)\n", + "print \"Gain magnitude av2 at f2\",round(av6,4)\n", + "print \"Gain magnitude av2 at f2\",round(av7,4)\n", + "print \"Gain magnitude av2 at f2\",round(av8,4)\n", + "print \"Gain magnitude av2 at f2\",round(av9,4)\n", + "print \"Gain magnitude av2 at f2\",round(av10,4)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.7.a" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R1 is 10.0 kOhm\n", + "Resistance R is 15.92 kOhm\n", + "Bandpass Gain Af is 4\n", + "Resistance Rf is 10.0 kOhm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.7.a\n", + "#Design a wide band pass filter with fl=200 Hz, fh=1 kHz and passband gain=4.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fl=200 #Low cutoff freq in Hz\n", + "fh=1*10**3 #High cutoff freq in Hz\n", + "C=0.05*10**-6\n", + "\n", + "#calculation\n", + "R=1/(2*math.pi*fl*C)\n", + "R1=10*10**3\n", + "Rf=R1 #Since passband gain is 2,R1 and Rf must be equal\n", + "\n", + "\n", + "#result\n", + "print \"Resistance R1 is\",round(R1/10**3,2),\"kOhm\"\n", + "print \"Resistance R is\",round(R/10**3,2),\"kOhm\"\n", + "print \"Bandpass Gain Af is 4\"\n", + "print \"Resistance Rf is\",round(Rf/10**3,2),\"kOhm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.7.b" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEfCAYAAABSy/GnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XeUVOUZx/Hv0qtAxEIRFhTFFkUMFkRGASVRpKmgWEkA\naxRLFBuLmkQl9oLECAakCCIoKF1GpIiCgIqiVGmWKFUBKTv547kjs+uW2dk78075fc6Zwy0zc5+5\nZ5ln3g4iIiIiIiIiIiIiIiIiIiIiIiIiIiIikkDHAEuA7cBNjmMREZEk9jLwuOsgRCQ2ZVwHIBml\nIfB5Eecz6e8xy3uIiEg+7wL7gF1YlVQT4BVgEPAO8BNwLlAXGAd8D6wGbo54j8reazYDy4A7gfUR\n53OBxhH7rwAPRexfiFWJbQHmAidGnFsL3A4sBbYCo4GKEec7eq/dBqwEzgcuARbm+5y3ARMKvgUE\ngYe9a+/0Ym0KTAd+BJZ77xn2J+9zbgc2ePEBBLz9fsD/gDXA5RGvqwEMw+7hWuBeDiSna4A5wEDs\nPq4G2ke89hpglXfN1fnetyeW8DcDU4AGhXxOEZFSm4V96YS9gn05n+HtVwYWAfcB5YBG2JfXed75\nR4D3gJpAfeAzYF3E++VPGEOBB73tZsB3wB+wL8+rsC/a8t75NcAHwOFALeyLsY93roUXZxtvvy7W\nHlMB+6JvGnHNxUDnQj5/EPsCPxYrTdXAEt7V3v7JWAIIv983QE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9++7wEne9j+AG73tycApEddeiyWbcGJYwW8TSnMsGVX3\n9s+JiEXEN6qSknQT/gX+Fjb5GkBb8s7MWR2r9mmFLVEJ9mt9SzHvWxUrnYyNOF7B+zcETPC2vwAO\ni7j2EGC3t7/V+/c/2KRwtwGXAn/wjjcEvol4/xDWbrHZ22+NlXjCamOlqUuAHd6xb7CkJ+IrJQxJ\nVzsjtrOw0sCeAp6XVcCxfeStrq2MfXGXwZJKs0KuGfn+4fcNFXKNcVhJ6F2sOioyWRX0/ILOlcVm\nJh3AgVJT+DlagEh8pzYMyQTTsB5UYeGqoNnA5d72H4Fa3vZ3WKPx77BqrQu94zuwaq+Lvf0srFdS\nUaZjJYnK3n74Gr8AU4FBWAkk7GugTnEfyPMIVl01Jt/xOt77iPhKCUPSSaiQ7b8CpwJLgWVAH+/4\nAOBsrNG7M7DOO74XeBBrIJ9G3l/vPYA/Y20GnwEXFXP9qVj12EKsDeL2iOeMxNpNpkUcm+PFWtB7\nhvfDx24H2nGgfSOc2FpgyVBEROIk3GieKHdgSStSY+DtUr5vECshifhKbRgiBySy3n880Ag4N9/x\n1VjV15FY99yS+j22oprGYIiIiIiIiIiIiIiIiIiIiIiIiIiIiIj47/8rMuTJbEhORQAAAABJRU5E\nrkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f1f802ccc10>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain magnitude av1 at f1 0.1997\n", + "Gain magnitude av2 at f2 0.5931\n", + "Gain magnitude av2 at f2 1.78\n", + "Gain magnitude av2 at f2 2.7735\n", + "Gain magnitude av2 at f2 3.3333\n", + "Gain magnitude av2 at f2 3.1508\n", + "Gain magnitude av2 at f2 2.7735\n", + "Gain magnitude av2 at f2 1.78\n", + "Gain magnitude av2 at f2 0.5655\n", + "Gain magnitude av2 at f2 0.3979\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.7.b\n", + "#Draw the frequency response plot for the filter in example 7.7.a\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "%matplotlib inline\n", + "\n", + "from scipy import pi\n", + "from matplotlib.pyplot import ylabel, xlabel, title, plot, show, clf, semilogx\n", + "import math\n", + "import numpy as np\n", + "#Variable declaration\n", + "Af=4 #Passband gain of the filter\n", + "fl=200 #Cut-off frequency\n", + "fh=1000 #Higher Cut-off frequency\n", + "\n", + "f1=10\n", + "f2=30\n", + "f3=100\n", + "f4=200\n", + "f5=447.2\n", + "f6=700\n", + "f7=1000\n", + "f8=2000\n", + "f9=7000\n", + "f10=10000\n", + "\n", + "\n", + "#calculation\n", + "av1=(Af*(f1/fl))/math.sqrt((1+(f1/fl)**2)*(1+(f1/fh)**2))\n", + "av2=(Af*(f2/fl))/math.sqrt((1+(f2/fl)**2)*(1+(f2/fh)**2))\n", + "av3=(Af*(f3/fl))/math.sqrt((1+(f3/fl)**2)*(1+(f3/fh)**2))\n", + "av4=(Af*(f4/fl))/math.sqrt((1+(f4/fl)**2)*(1+(f4/fh)**2))\n", + "av5=(Af*(f5/fl))/math.sqrt((1+(f5/fl)**2)*(1+(f5/fh)**2))\n", + "av6=(Af*(f6/fl))/math.sqrt((1+(f6/fl)**2)*(1+(f6/fh)**2))\n", + "av7=(Af*(f7/fl))/math.sqrt((1+(f7/fl)**2)*(1+(f7/fh)**2))\n", + "av8=(Af*(f8/fl))/math.sqrt((1+(f8/fl)**2)*(1+(f8/fh)**2))\n", + "av9=(Af*(f9/fl))/math.sqrt((1+(f9/fl)**2)*(1+(f9/fh)**2))\n", + "av10=(Af*(f10/fl))/math.sqrt((1+(f10/fl)**2)*(1+(f10/fh)**2))\n", + "\n", + "#Magnitude plot\n", + "f=np.arange(10,100000)\n", + "s=2.0j*pi*f\n", + "p1=2.0*pi*fl\n", + "p2=2.0*pi*fh\n", + "A=(Af*s)*p2/((s+p1)*(s+p2))\n", + "\n", + "clf() #clear the figure\n", + "plot()\n", + "title('frequency response')\n", + "semilogx(f,20*np.log10(abs(A)))\n", + "ylabel('Voltage gain(dB)')\n", + "xlabel('frequency(Hz)')\n", + "show()\n", + "\n", + "\n", + "#result\n", + "print \"Gain magnitude av1 at f1\",round(av1,4)\n", + "print \"Gain magnitude av2 at f2\",round(av2,4)\n", + "print \"Gain magnitude av2 at f2\",round(av3,4)\n", + "print \"Gain magnitude av2 at f2\",round(av4,4)\n", + "print \"Gain magnitude av2 at f2\",round(av5,4)\n", + "print \"Gain magnitude av2 at f2\",round(av6,4)\n", + "print \"Gain magnitude av2 at f2\",round(av7,4)\n", + "print \"Gain magnitude av2 at f2\",round(av8,4)\n", + "print \"Gain magnitude av2 at f2\",round(av9,4)\n", + "print \"Gain magnitude av2 at f2\",round(av10,4)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.7.c" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Center frequency fc is 447.21 Hz\n", + "Quality factor Q is 0.56\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.7.c\n", + "#Calculate the value of Q for the filter.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fh=1*10**3 #Higher cut-off frequency\n", + "fl=200 #Lower cut-off frequency\n", + "\n", + "\n", + "#calculation\n", + "fc=math.sqrt(fl*fh) #Center frequency\n", + "Q=fc/(fh-fl) #Quality factor\n", + "\n", + "\n", + "\n", + "#result\n", + "print \"Center frequency fc is\",round(fc,2),\"Hz\"\n", + "print \"Quality factor Q is\",round(Q,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.8.a" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R1 is 4.77 kilo ohm\n", + "Resistance R2 is 5.97 kilo ohm\n", + "Resistance R3 is 95.49 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.8.a\n", + "#Design the bandpass filter shown in figure 7-13(a) so that fc=1 kHz, Q=3 and\n", + "#Af=10.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fc=1*10**3 #Center frequency\n", + "Q=3 #Quality factor\n", + "Af=10 #Passband gain\n", + "C1=0.01*10**-6 #Assumption\n", + "\n", + "#calculation\n", + "C2=C1\n", + "R1=Q/(2*math.pi*fc*C1*Af)\n", + "R2=Q/(2*math.pi*fc*C1*(2*Q**2-Af))\n", + "R3=Q/(math.pi*fc*C1)\n", + "\n", + "#result\n", + "print \"Resistance R1 is\",round(R1/10**3,2),\"kilo ohm\"\n", + "print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n", + "print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.8.b" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R1 is 2.65 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.8.b\n", + "#Change the centre frequency of example 7.8.a to 1.5 kHz, keeping Af and\n", + "#bandwidth constant.\n", + "\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fc0=1*10**3 #Original center frequency\n", + "fc1=1.5*10**3 #New center frequency\n", + "R2=5.97*10**3 #Original resistance\n", + "\n", + "\n", + "\n", + "#calculation\n", + "R2new=R2*(fc0/fc1)**2\n", + "\n", + "#result\n", + "print \"Resistance R1 is\",round(R2new/10**3,2),\"kilo ohm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.9" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R2 of highpass section is 15.92 kilo ohm\n", + "Resistance R of lowpass section is 15.92 kilo ohm\n", + "Bandpass Gain Af is 4\n", + "Resistance R1 is 10.0 kilo ohm\n", + "Resistance Rf is 10.0 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.9\n", + "#Design a wide-band reject filter having fh=200 Hz and fl=1 KHz.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fh=200 # Low cutoff freq in Hz\n", + "fl=1*10**3 # High cutoff freq in Hz\n", + "C2=0.01*10**-6 # Assumption\n", + "R2=1/(2*math.pi*fl*C2)\n", + "C=0.05*10**-6\n", + "R1=10*10**3 # Assumption\n", + "Rf=R1 # Since passband gain is 2,R1 and Rf must be equal\n", + "Af=4 # Since gain of high pass and lowpass is set to 2\n", + "\n", + "\n", + "#calculation\n", + "R2=1/(2*math.pi*fl*C2)\n", + "R=1/(2*math.pi*fh*C)\n", + "\n", + "\n", + "#result\n", + "print \"Resistance R2 of highpass section is\",round(R2/10**3,2),\"kilo ohm\"\n", + "print \"Resistance R of lowpass section is\",round(R/10**3,2),\"kilo ohm\"\n", + "print \"Bandpass Gain Af is\",Af\n", + "print \"Resistance R1 is\",round(R1/10**3),\"kilo ohm\"\n", + "print \"Resistance Rf is\",round(Rf/10**3),\"kilo ohm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.10" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R is 39.01 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.10\n", + "#Design a 60 Hz active notch filter.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fn=60 #Notch-out frequency in Hz\n", + "C=0.068*10**-6 #Assumption\n", + "\n", + "\n", + "\n", + "#calculation\n", + "R=1/(2*math.pi*fn*C)\n", + "\n", + "\n", + "#result\n", + "print \"Resistance R is\",round(R/10**3,2),\"kilo ohm\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.11" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Phase angle phi is -90.0 degree\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.11\n", + "#For the all-pass filter of figure 7-16(a),find the phase angle phi if the\n", + "#frequency of vin is 1 kHz.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "f=1*10**3 #Input frequency in Hz\n", + "C=0.01*10**-6 \n", + "R=15.9*10**3 #Resistance in ohms\n", + "\n", + "\n", + "\n", + "#calculation\n", + "phi=math.atan(2*math.pi*f*C*R) #Phase angle\n", + "phi1=-2*phi*180/math.pi\n", + "\n", + "#result\n", + "print \"Phase angle phi is\",round(phi1),\"degree\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.12" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R is 3.3 kilo ohm\n", + "Use Resistance R as 3.3 kohm\n", + "Resistance Rf is 957.0 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.12\n", + "#Design the phase shift oscillator of figure 7-18 so that fo=200 Hz.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fo=200 # Frequency of oscillation\n", + "C=0.1*10**-6 # Assumption\n", + "R=3.3*10**3\n", + "\n", + "#calculation\n", + "R=0.065/(fo*C)\n", + "R=3.3*10**3 #Using rounded value\n", + "R1=10*R # To prevent loading of amplifier\n", + "Rf=29*R1\n", + "\n", + "#result\n", + "print \"Resistance R is\",round(R/10**3,1),\"kilo ohm\"\n", + "print \"Use Resistance R as 3.3 kohm\"\n", + "print \"Resistance Rf is\",round(Rf/10**3),\"kilo ohm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.13" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R is 3.3 kilo ohm\n", + "Resistance Rf is 24.0 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.13\n", + "#Design the wein bridge oscillator of figure 7-19 so that fo=965 Hz.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fo=965 # Frequency of oscillation\n", + "C=0.05*10**-6 # Assumption\n", + "R1=12*10**3 # Assumption\n", + "\n", + "#calculation\n", + "R=0.159/(fo*C)\n", + "Rf=2*R1\n", + "\n", + "#result\n", + "print \"Resistance R is\",round(R/10**3,1),\"kilo ohm\"\n", + "print \"Resistance Rf is\",round(Rf/10**3),\"kilo ohm\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.14" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance values R1,R2,R3 is 100.0 kilo ohm\n", + "Capacitance values C1,C2,C3 is 0.01 uF\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.14\n", + "#Design the quadrature oscillator of figure 7-20 so that fo=159 Hz.\n", + "#The opamp is the 1458/772.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fo=159 # Frequency of oscillation\n", + "C=0.01*10**-6 # Assumption\n", + "\n", + "#calculation\n", + "R=0.159/(fo*C)\n", + "\n", + "#result\n", + "print \"Resistance values R1,R2,R3 is\",round(R/10**3,1),\"kilo ohm\"\n", + "print \"Capacitance values C1,C2,C3 is\",round(C*10**6,2),\"uF\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.15" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R2 is 11.6 kilo ohm\n", + "Resistance R is 10.0 ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.15\n", + "#Design the square wave oscillator of figure 7-21(a) so that fo=1 kHz.\n", + "#The opamp is 741 with dc supply voltages = 15, -15 V.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fo=1*10**3 # Frequency of oscillation\n", + "C=0.05*10**-6 # Assumption\n", + "R1=10*10**3 # Assumption\n", + "\n", + "#calculation\n", + "R=1/(2*fo*C)\n", + "R2=1.16*R1\n", + "\n", + "#result\n", + "print \"Resistance R2 is\",round(R2/10**3,1),\"kilo ohm\"\n", + "print \"Resistance R is\",round(R/10**3),\"ohm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.16" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resistance R2 is 10.0 kilo ohm\n", + "Resistance R1 is 10.0 kilo ohm\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.16\n", + "#Design the triangular wave generator of figure 7-23 so that fo=2 kHz and\n", + "#Vo(pp)=7V. The opamp is a 1458/772 and supply voltages =15,-15 V.\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "fo=2*10**3 # Frequency of oscillation\n", + "vo=7 #Output voltage\n", + "Vsat=14 #Saturation voltage for opamp 1458\n", + "R3=40*10**3 #Assumption\n", + "C1=0.05*10**-6 #Assumption\n", + "\n", + "\n", + "#calculation\n", + "R2=(vo*R3)/(2*Vsat)\n", + "k=R3/(4*fo*R2) #Using fo=R3/(4*R1*C1*R2),k=R1*C1;\n", + "R1=k/C1\n", + "\n", + "\n", + "#result\n", + "print \"Resistance R2 is\",round(R2/10**3),\"kilo ohm\"\n", + "print \"Resistance R1 is\",round(R1/10**3),\"kilo ohm\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 7.17" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Terminal voltage Vc is 10.43 volts\n", + "Approximate Nominal freq fo is 26.09 kHz\n", + "Approximate Nominal freq fo1 is 41.67 kHz\n", + "Approximate Nominal freq fo2 is 8.33 kHz\n", + "Change in output freq delta_fo is 33.33 kHz\n" + ] + } + ], + "source": [ + "\n", + "#Example 7.17\n", + "#In the circuit of figure 7-25(c), V=12 V, R2=1.5 Kilo ohm, R1=R3=10 Kilo ohm\n", + "#and C1=0.001 uF.\n", + "#a)Determine the nominal frequency of all the output waveforms.\n", + "#b)Compute the modulation in the output frequencies if Vc is varied between 9.5 V\n", + "#and 11.5 V.\n", + "\n", + "\n", + "from __future__ import division #to perform decimal division\n", + "import math\n", + "\n", + "\n", + "#Variable declaration\n", + "R2=1.5*10**3\n", + "R1=10*10**3\n", + "R3=10*10**3\n", + "C1=0.001*10**-6\n", + "V=12 #Supply voltage\n", + "Vc1=9.5\n", + "Vc2=11.5\n", + "\n", + "#calculation\n", + "Vc=R3*V/(R2+R3) #Using voltage divider rule\n", + "fo=2*(V-Vc)/(V*R1*C1)\n", + "fo1=2*(V-Vc1)/(V*R1*C1)\n", + "fo2=2*(V-Vc2)/(V*R1*C1)\n", + "delta_fo=fo1-fo2 #Change in output freq\n", + "\n", + "\n", + "#result\n", + "print \"Terminal voltage Vc is\",round(Vc,2),\"volts\"\n", + "print \"Approximate Nominal freq fo is\",round(fo/10**3,2),\"kHz\"\n", + "print \"Approximate Nominal freq fo1 is\",round(fo1/10**3,2),\"kHz\"\n", + "print \"Approximate Nominal freq fo2 is\",round(fo2/10**3,2),\"kHz\"\n", + "print \"Change in output freq delta_fo is\",round(delta_fo/10**3,2),\"kHz\"\n", + "\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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |