import math
#Problem 13.2")
# Given
#|Hv| = 1/math.sqrt(2) (1)")
#resistance R1 = 5kohm")
R1 = 5000;
#Hv(w) = 1/1+%i*(w/wx) (2)")
#wx = 1/(R1*C2)
#On solving we get
#wx = 2*10**-4/C2 (3)")
#a)")
C2 = 10*10**-9;
#Taking modulus of (2)
#|Hv(w)| = 1/math.sqrt(1+(w/wx)**2)")
#Equating (1) and (2)
wx = 2*10**-4/C2;
fx = (wx/(2*math.pi))*10**-3
print "Frequencya) is %3.2fkHz"%(fx)
#b)")
C2b = 1*10**-9;
#As frequency is inversely proportional to C2 (from (3))
fx1 = (C2/C2b)*fx
print "Frequencyb) is %3.2fkHz"%(fx1)
import math
# Given
#From the above transfer function
#Comparing the denominator with s**2+a*s+b with w = math.sqrt(b)
a = 300;b = 10**6;
#Therefore center frequency is
w0 = math.sqrt(10**6)
#The lower and upper frequencies are
wl = math.sqrt(a**2/4+b)-a/2
wh = math.sqrt(a**2/4+b)+a/2
B = wh-wl #It can be inferred that B = a
Q = math.sqrt(b)/a
print "Center frequency = %drad/s"%(w0);
print "Low power frequency = %3.2frad/sHigh power frequency = %3.2frad/s"%(wl,wh);
print "Bandwidth = %drad/sQuality factor = %3.2f"%(B,Q)
import math
# Given
#From the above transfer function
#Comparing the denominator with s**2+a*s+b with w = math.sqrt(b)
a = 30;
b = 10**6;
#Therefore center frequency is
w0 = math.sqrt(10**6)
#The lower and upper frequencies are
wl = math.sqrt(a**2/4+b)-a/2
wh = math.sqrt(a**2/4+b)+a/2
B = wh-wl
Q = math.sqrt(b)/a
print "Center frequency = %drad/s"%(w0);
print "Low power frequency = %3.2frad/sHigh power frequency = %3.2frad/s"%(wl,wh);
print "Bandwidth = %drad/sQuality factor = %3.2f"%(B,Q)