Chapter -6 Digitally Controlled Frequency Synthesizers

Example 6.1 - Page 180

In [1]:
from numpy import pi
import math
from fractions import Fraction 
# Given data
R1= 15*10**3 # in Ω
C1= 0.01*10**-6 # in F
C2= 10*10**-6 # in F
R2= 3.6*10**3 # in Ω
Vpos= 12 # in V
Vneg= -12 # in V
f_out= 1.2/(4*R1*C1) # free running frequency in Hz
f_out= f_out*10**-3 # in kHz
print "The free running frequency = %0.f kHz" %f_out 
f_L= 8*f_out/(Vpos-(Vneg)) #Lock-range in kHz
print "Lock-range of the circuit = ± ", Fraction(f_L).limit_denominator(100), "kHz" 
f_L= f_L*10**3 # in Hz
f_C= math.sqrt(f_L/(2*pi*R2*C2)) # Hz
print "Capture-range of the circuit = ± %0.2f Hz" %f_C
The free running frequency = 2 kHz
Lock-range of the circuit = ±  2/3 kHz
Capture-range of the circuit = ± 54.29 Hz

Example 6.2 - Page 185

In [26]:
# Given data
f_out_max= 200 # in kHz
f_lowest= 1 # in Hz
# Frequency of reference oscillator,
f_ref_os= 2.2*f_out_max # in kHz
print "The frequency of reference oscillator = %0.f kHz" %f_ref_os
# Formula used : f_lowest= f_ref_os/2**n
n= round(math.log(f_ref_os*10**3/f_lowest, 10)/math.log(2,10))
print a
print "The number of bits required = %0.f" %n
The frequency of reference oscillator = 440 kHz
19.0
The number of bits required = 19