## Example 7.3.1,Pg.no.227¶

In [20]:
import math
fs_min=550*10**3
fs_max=1600*10**3
IF=455*10**3
#Determination of freq tuning ranges
fo_min=fs_min+IF
fo_max=fs_max+IF
print 'The freq tuning range is',fo_min,'Hz to',fo_max,'Hz'
Rf=(fo_max)/(fo_min)   #calculation of freq tuning range ratio
print 'The tuning range ratio of oscillator is',Rf,'ohm'
Rc=Rf**2               #calculation of capacitance tuning range ratio
print 'The capacitor tuning range ratio of oscillator is',Rc
#For RF section
Rf1=fs_max/fs_min;
print 'The tuning range ratio of RF−ckt is',Rf1
Rc1=Rf1**2
print 'The capacitor tuning range ratio of RF−ckt is',Rc1

The freq tuning range is 1005000 Hz to 2055000 Hz
The tuning range ratio of oscillator is 2 ohm
The capacitor tuning range ratio of oscillator is 4
The tuning range ratio of RF−ckt is 2
The capacitor tuning range ratio of RF−ckt is 4


## Example 7.4.1,Pg.no.230¶

In [21]:
import math
Rco=8.463
Rfo=2.909
Rcs=4.182
Rfo=2.045
fo_max =2055.0*10**3
fo_min=1005.0*10**3
Cs_max=350.0
#For the RF section
Cs_min=Cs_max/Rcs
Cs_min=round(Cs_min,0)
print 'The Cs min is',Cs_min,'*10^-12','F'

The Cs min is 84.0 *10^-12 F


## Example 7.6.1,Pg.no.234¶

In [22]:
import math
from math import sqrt
IF=465.0  #IF in KHz
fs=1000   #Tuning freq in KHz
Q=50.0    #Quality factor
#Oscillator freq fo is given as
fo=fs+IF;
#a) Image freq is given as
fi=fo+IF
print 'Image freq is',fi,'Hz'
y=fi/fs-fs/fi
#b) image rejection is given as
Ar=1/sqrt(1+(y*Q)**2)
Ar_dB=20*math.log10(Ar)
Ar_dB=round(Ar_dB,2)
print 'Image rejection is',Ar_dB

Image freq is 1930.0 Hz
Image rejection is -36.98


## Example 7.7.1,Pg.no.236¶

In [34]:
import math
fs=950        #in KHz
IF=455        #in KHz
m=[1,2]
n=[1,2]
f0=fs+IF
print 'The sum of frequencies are'
for i in range (1,2):
for j in range (1,2):
fu1=j/i *f0 + 1/i*IF
print fu1
print 'The difference of frequencies are'
for i in range (1,2):
for j in range (1,2):
fu2=j/i*f0 - 1/i*IF
print fu2

The sum of frequencies are
1860
The difference of frequencies are
950