{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 14: Phase Locked Loops" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.1: Free_running_frequency_and_Lock_range.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 14.1\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "R_T = 10;// in k ohm\n", "R_T = R_T * 10^3;// in ohm\n", "C_T = 0.005;// in µF\n", "C_T = C_T * 10^-6;// in F\n", "C=10*10^-6;// in F\n", "f_out = 0.25/(R_T*C_T);// in Hz\n", "disp('Free Running frequency is : '+string(f_out*10^-3)+' kHz');\n", "// Part (ii)\n", "V=20;// in V\n", "f_L= 8*f_out/V;// in Hz\n", "disp('Lock range in kHz is : ±'+string(f_L*10^-3)+' kHz')\n", "// Part (iii)\n", "f_C= sqrt(f_L/(2*%pi*3.6*10^3*C));// in Hz\n", "disp('Capture range is : ±'+string(f_C)+' Hz')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 14.2: Frequency_and_number_of_bits.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 14.2\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f_out_max = 200;// in kHz\n", "f_out_min = 4;// in Hz\n", "f_CLK = 2.2*f_out_max;// in kHz\n", "disp(f_CLK,'Frequency of reference oscillation in kHz is');\n", "f_CLK= f_CLK*10^3;// in Hz\n", "// Formula f_out_min= f_CLK/2^n\n", "n=log(f_CLK/f_out_min)/log(2);\n", "disp(round(n),'The number of bits required in the phase accumulator is : ')" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }