{ "metadata": { "name": "", "signature": "sha256:35cefa1a4ef186a1d32cec5eab7cbcc5a59aadb0b75b7fb4053796fe08e1ae51" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter -6 Digitally Controlled Frequency Synthesizers" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 6.1 - Page 180" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from numpy import pi\n", "import math\n", "from fractions import Fraction \n", "# Given data\n", "R1= 15*10**3 # in \u03a9\n", "C1= 0.01*10**-6 # in F\n", "C2= 10*10**-6 # in F\n", "R2= 3.6*10**3 # in \u03a9\n", "Vpos= 12 # in V\n", "Vneg= -12 # in V\n", "f_out= 1.2/(4*R1*C1) # free running frequency in Hz\n", "f_out= f_out*10**-3 # in kHz\n", "print \"The free running frequency = %0.f kHz\" %f_out \n", "f_L= 8*f_out/(Vpos-(Vneg)) #Lock-range in kHz\n", "print \"Lock-range of the circuit = \u00b1 \", Fraction(f_L).limit_denominator(100), \"kHz\" \n", "f_L= f_L*10**3 # in Hz\n", "f_C= math.sqrt(f_L/(2*pi*R2*C2)) # Hz\n", "print \"Capture-range of the circuit = \u00b1 %0.2f Hz\" %f_C" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The free running frequency = 2 kHz\n", "Lock-range of the circuit = \u00b1 2/3 kHz\n", "Capture-range of the circuit = \u00b1 54.29 Hz\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 6.2 - Page 185" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Given data\n", "f_out_max= 200 # in kHz\n", "f_lowest= 1 # in Hz\n", "# Frequency of reference oscillator,\n", "f_ref_os= 2.2*f_out_max # in kHz\n", "print \"The frequency of reference oscillator = %0.f kHz\" %f_ref_os\n", "# Formula used : f_lowest= f_ref_os/2**n\n", "n= round(math.log(f_ref_os*10**3/f_lowest, 10)/math.log(2,10))\n", "print a\n", "print \"The number of bits required = %0.f\" %n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The frequency of reference oscillator = 440 kHz\n", "19.0\n", "The number of bits required = 19\n" ] } ], "prompt_number": 26 } ], "metadata": {} } ] }