#page no 50
#calculate the resonant frequency and bandwidth
#prob no 2.1
from math import pi,sqrt
#Given:
#Refer the fig 2.6 of page 50. L1=25uH;C1=50pF
L1=25.*10**-6;C1=50.*10**-12;Q=15;
#calculations
#A) The resonent freqency is given as
fo=(1/(2*pi*sqrt(L1*C1)));
#B) The bandwidth is given as
B=fo/Q;
#results
print 'a)The resonant frequency is ',round(fo/10**6,2),'MHz'
print 'The bandwidth is ',round(B/1000.),'kHz'
#page no 62
# prob no. 2.2
#calculate the operating frequency, gain
from math import pi,sqrt
# Given : Hartley oscillators L=10uH; C=100pF
L=10.*10**-6; C=100.*10**-12;N1=10;N2=100.
#calculations and results
# A)The operating frequency is
fo=1/(2.*pi*sqrt(L*C));
print '1)The operating frequency is',round(fo/10**6,2),'MHz'
# The feedback fraction is given by
B=-N1/N2;
#Operating gain is given as
A=1/B;
print '2)Operating gain',A
print 'The -ve sign denotes a phase inversion'
#B) The operating frequency is same as in part A)
N1=20;N2=80.;
# The feedback fraction is given by
B=(N1+N2)/N1;
#Operating gain is given as
A=1./B;
print '3)Operating gain',A
# page no 66
#prob no 2.3
#calculate the operating frequency and feedback fraction
from math import pi,sqrt
#Given:
C1=10.*10**-12; C2=100.*10**-12; L=1*10**-6;
#calculations and results
# The effective capacitance is
CT=(C1*C2)/(C1+C2);
# The operating frequency is
f0=1/(2*pi*sqrt(L*CT));
print 'The effective capacitance (pF)=',round(CT*10**12,2);
print '1)The operating frequency is',round(f0/10**6,1),'Hz'
# The feedback fraction is given approximately by
B=-C1/C2;
print 'The feedback fraction is',B
# For the common-base ckt, the op-freq is same but the feedback fraction willbe different.
C1=100*10**-12; C2=10*10**-12;
# It is given by
B=C2/(C1+C2);
print 'The feedback fraction is',round(B,4)
# page no 68
#prob no 2.4
#caclculate the effective total capacitance and operating frequency
#Refer fig 2.22
from math import pi,sqrt
#Given:
c1=1000.;c2=100.;c3=10.;#all values are in pf
#calculations and results
#The effective total capacitance
Ct=1/((1/c1)+(1/c2)+(1/c3));
print 'The effective total capacitance is',round(Ct,2),'pF'
CT=Ct*10**-12;L=10**-6;
#The operating freq is
f0=1/(2*pi*sqrt(L*CT));
print 'The operating freq is',round(f0/10**6,2),'MHz'
# page no 70
#prob no 2.5
#calculate the resonant freq and tuning voltage
from math import sqrt,pi
#Given:
C=80*10**-12; L= 100*10**-6;
#calculations
#Part a) The resonent frequency is
f0=1/(2*pi*sqrt(L*C));
# Part b) In this part the circuit is resonate on doubling the frequency,therefore
f1=2*f0;
# from the equation of resonent frequency
C1=1/(4*(pi*f1)**2*L);
# Now for tuning voltage we have to use equation C1=Co/sqrt(1+2V)
Co=C;
# after solving the expression
v=((Co/C1)**2 -1)/2;
#results
print 'The resonent freq is',round(f0/10**6,2),'MHz'
print 'The tuning voltage is ',v,'V'
#page no 76
#calculate the output frequencies
#problem 2.7
#Given:
# all frequencies are in MHz
f1=11.;f2=10;
#calculations
# output frequencies at the output of square-law mixer
a=f1+f2;
b=f1-f2;
#results
print 'The output frequencies at the output of square-law mixer are : ',a,'MHz ',b,'MHz'
#page no 85
#calculate the capture range, lock range, frequency
#problem no. 2.8
# all the frequencies are in MHz
#Given:
freq_free_run =12.;
freq_lock1 =10.;
freq_lock2 =16.;
#calculations and results
# capture range is approximately twice the difference between the free-running freq and the freq at which lock is first achieved
capture_range =2*(freq_free_run - freq_lock1 );
print 'The capture range is ',capture_range,'MHz'
# lock range is approximately twice the the difference between the freq where lock is lost and free-running freq
lock_range = 2*(freq_lock2 - freq_free_run);
print 'The lock range is ',lock_range,'MHz'
# The PLL freq response id approximate symmetrical.
#This means the free-running freq is in the center of the lock range and capture range. Therefore
freq_lock_acquired = freq_free_run + (capture_range/2);
freq_lock_lost = freq_free_run - capture_range
print 'The freq at which the lock is acquired, moving downward in freq is ',freq_lock_acquired,'MHz'
print 'Lock will be lost on the way down at',freq_lock_lost,'MHz'
#page no 86
#calculate the values of N at high and low ends
# prob no 2.9
# refer fig 2.38
#Given:
#Here we are using a 10MHz crystal, it will be necessar to devide it by a factor to get 10kHz
f_osc = 10.*10**6; f_ref=10.*10**3;f0_1=540.*10**3;f0_2=1700.*10**3;
#calculations
Q=f_osc/f_ref;
# we have to specify the range of values of N. Find N at each and of the tuning range
N1=f0_1/f_ref;
N2=f0_2/f_ref;
#results
print 'The values of N at high end is',N2
print 'The values of N at low end is',N1
#page no 89
# prob no 2.10
# refer fig 2.40
#Given:
P=10.;f_ref=10.*10**3;M=10.;
#consider
N=1.;
#calculations
# With a fixed-modulus prescalar, the min freq step is
step_size=M*f_ref;
# With the two-modulus system, let the main divider modulus N remain constant &
#increase the modulus m to (m+1) to find how much the freq changes.
# for 1st case, o/p freq
fo=(M+N*P)*f_ref;
# for 2nd case where leave N alone but changes M to M+1, new o/p freq
fo_=(M+1+N*P)*f_ref;
# The difference is
f= fo_-fo;
#results
print 'The step size that would have been obtained without prescaling',f,'Hz'
#page no 91
#prob no 2.11
#refer fig 2.42
#Given:
f_ref= 20.*10**3;
f_osc= 10.*10**6;
N1=10;N2=100.;
#calculations
f0=(N1*f_ref) + f_osc;
f1=(N2*f_ref) + f_osc;
step_size=(f1-f0)/(N2-N1);
#results
print 'The output frequencies are',f0/10**6,'MHz',f1/10**6,'MHz'
print 'The step size is',step_size/1000.,'kHz'