Chapter 17 : Active filters

Example 17.1, Page No 716

In [16]:
import math
#initialisation of variables

rs=600.0
R1=12.0*10**3
Rl=100.0*10**3
C1=0.013*10**-6

#Calculations
print("when Rl is not connected")
fc=1.0/(2*3.14*R1*C1)
print(" when Rl is connected")
fc=1.0/(2*3.14*((R1*Rl)/(R1+Rl))*C1)
Attn=3#at fc attenuation is =3dB
falloffrate=6
print("attenuation at 2fc")
Attn=3+6
print("attenuation at 2fc is %ddB " %Attn)
Attn=3+6+6

#Results
print(" attenuation at 4fc is %ddB " %Attn)
when Rl is not connected
 when Rl is connected
attenuation at 2fc
attenuation at 2fc is 9dB 
 attenuation at 4fc is 15dB 

Example 17.2, Page No 718

In [17]:
import math

#initialisation of variables
Ib=500.0*10**-9
f=1.0*10**3

#Calculations
R1=(70.0*10**-3)/Ib
R1=140*10**3#use standard value
R2=R1
C1=(1/(2*3.14*R1*f))*10**12

#Results
print(" capacitor used is of %.2f pF " %C1)
 capacitor used is of 1137.40 pF 

Example 17.3 Page No 719

In [18]:
import math

#initialisation of variables

print("first order high pass active filter")
f=5.0*10**3
C1=1000.0*10**-12
fu=1.0*10**6

#Calculations
R1=1.0/(2*3.14*f*C1)
BW=fu-f
print(" bandwidth is %.2f kHz " %(BW/1000))
first order high pass active filter
 bandwidth is 995.00 kHz 

Example 17.4, Page No 724

In [19]:
import math
#initialisation of variables

f=1.0*10**3
Ib=500.0*10**-9
print("butterworth second order filter")

#Calculations
R=(70.0*10**-3)/Ib
R1=R/2.0
R1=68.1*10**3#use standard value
R2=R1 
R3=2.0*R1
Xc1=math.sqrt(2)*R2
C1=1/(2*3.14*f*math.sqrt(2)*R2)
C2=2*C1
fc=1/(2*3.14*(math.sqrt(R1*R2*C1*C2)))

#Results
print("actual cutoff frequency is %d kHz " %(fc/1000))
butterworth second order filter
actual cutoff frequency is 1 kHz 

Example 17.5 Page No 725

In [20]:
import math
#initialisation of variables

f=12.0*10**3
C1=1000.0*10**-12
print("butterworth second order filter")
C2=C1

#Calculations
R2=(math.sqrt(2))/(2*3.14*f*C1)
R1=.5*R2
R3=R2
fc=1.0/(2*3.14*(math.sqrt(R1*R2*C1*C2)))

#Results
print("actual cutoff frequency is %d KHz " %(fc/1000))
butterworth second order filter
actual cutoff frequency is 11 KHz 

Example 17.6 Page No 729

In [21]:
import math

#initialisation of variables
f=30.0*10**3
C1=1000.0*10**-12
print(" third order low pass filter")
print("-20 dB per decade stage")

#Calculations
fc1=f/.65
R1=1.0/(2*3.14*fc1*C1)
R2=R1
print("-40dB per decade stage")
C3=1000*10**-12
C2=2*C3
fc2=f/.8
R4=1/(2*3.14*fc2*C3*(math.sqrt(2)))
R3=R4
R5=R3+R4

#Results
print("The value of R5 is %.2f kohm" %(R5/1000))
 third order low pass filter
-20 dB per decade stage
-40dB per decade stage
The value of R5 is 6.01 kohm

Example 17.7, Page No 730

In [22]:
import math
#initialisation of variables

f=20.0*10**3
print("3rd order high pass filter")
print("-20dB per decade stage")
R1=121.0*10**3

#Calculations
fc1=.65*f
C1=1/(2*3.14*fc1*R1)
#this is so small it might be effected by stray capacitor.redesign  %first choosing a suitable capacitance C1
C1=100*10**-12
R1=1/(2*3.14*f*C1)
R2=R1
print("-40dB per decade stage")
C3=1000*10**-12
R4=(math.sqrt(2))/(2*3.14*.8*f*C3)
C2=C3
R3=.5*R4
R5=R4

#Results
print("The value of R5 is %.2f kohm" %(R5/1000))
3rd order high pass filter
-20dB per decade stage
-40dB per decade stage
The value of R5 is 14.07 kohm

Example 17.8 Page No 734

In [23]:
import math 

#initialisation of variables
f1=300.0
f2=30.0*10**3
print(" single stage band pass filter")

#Calculations
C2=1000*10**-12
R2=1/(2*3.14*f2*C2)
R1=R2
Xc1=R1#at voltage gain Av=1
C1=1/(2*3.14*f1*R1)
R3=R2

#Results
print("The value of R3 is %.2f kohm" %(R3/1000))
 single stage band pass filter
The value of R3 is 5.31 kohm

Example 17.9 Page No 736

In [24]:
import math
#initialisation of variables

f1=300.0
f2=30.0*10**3

#Calculations
fo=math.sqrt(f1*f2)
BW=f2-f1
Q=fo/BW

#Results
print("The value of Q is %.2f " %(Q))
The value of Q is 0.10 

Example 17.10 Page No 737

In [25]:
import math

#initialisation of variables

R1=60.4*10**3
R4=1.21*10**3
C=.012*10**-6
R2=121.0*10**3

#Calculations
Q=math.sqrt((R1+R4)/(2*R4))
fo=Q/(3.14*C*R2)
print(" center frequency is %3.2fHz " %fo)
BW=fo/Q

#Results
print(" bandwidth is %3.1fHz " %BW)
 center frequency is 1106.68Hz 
 bandwidth is 219.3Hz 

Example 17.12, Page No 744

In [26]:
import math

#initialisation of variables
f1=10.3*10**3
f2=10.9*10**3
C1=1000.0*10**-12

#Calculations
C2=C1
fo=math.sqrt(f1*f2)
R5=1.0/(2*3.14*fo*C1)
R1=R5
Q=fo/(f2-f1)
R2=R1*(2*Q-1)

#Results
print("The value of R2 is %.2f kohm" %(R2/1000))
The value of R2 is 515.76 kohm

Example 17.13, Page No 750

In [27]:
import math
#initialisation of variables
f1=10.3*10**3
f2=10.9*10**3
Hobp=34

#Calculations
math.sqrt(f1*f2)
Q=fo/(f2-f1)
R3=120.0*10**3
R2=R3/Q
R1=R3/Hobp
k=50*fo

#Results
print("The value of k is %.2f " %(k/1000))
The value of k is 529.79