Chapter06 : Active Filters

Exa 6.2 : page 250

In [1]:
from math import pi
# given data 
R=10 #in Kohm
C=0.01 #in uF
R1=4.7 #in Kohm
RF=47 #in Kohm
fc=1/(2*pi*R*1000*C*10**-6) #in Hz
AF=1+RF/R1 #unitless
print "Cut-off frequency = %0.2f kHz" %(fc/1E3)
print "Pass band gain =",AF
Cut-off frequency = 1.59 kHz
Pass band gain = 11.0

Exa 6.3 : page 250

In [2]:
from math import pi, ceil
# given data 
fc=2 #in KHz
AF=2 #unitless
# let C=0.01 uF
C=0.01 #in uF
R=(1/(2*pi*fc*1E3*C*1E-6))/1E3 #in Kohm
R=ceil(R) 
# Bias compensation Rbc
# Rbc=R1*RF/(R1+RF) ohm
# R=R1*RF/(R1+RF)=Rdash/2 ohm   
#Rdash=R1=RF=2*R #in ohm
Rdash=2*R #in ohm
R1=2*R #in ohm
RF=2*R #in ohm
R1=RF #in kohm
print "Component values are :" 
print "R1 = RF = %0.2f kohm" %(R1)
print "R = %0.2f kohm"%R
Component values are :
R1 = RF = 16.00 kohm
R = 8.00 kohm

Exa 6.4 : page 251

In [4]:
from __future__ import division
# given data 
fc_original=2 #in KHz
fc_new=3 #in KHz
R_original=8 #in Kohm
R_new=fc_original*R_original/fc_new #in Kohm
print "New value of resistance = %0.2f ohm"%R_new
New value of resistance = 5.33 ohm

Exa 6.5 : page 254

In [7]:
# given data 
fc=1 #in KHz
AF=2 #unitless
# let C=0.01 uF
C=0.01 #in uF
R=(1/(2*pi*fc*1000*C*10**-6))/1000 #in Kohm
#For Bias compensation
#Rbc=R1*RF/(R1+RF) ohm
#R=R1*RF/(R1+RF)=Rdash/2 ohm" 
#Rdash=R1=RF=2*R #in ohm
Rdash=2*R #in ohm
R1=2*R #in ohm
RF=2*R #in ohm
R1=RF #in kohm
print "Component values are :" 
print "R1 = RF = %0.1f kohm" %(R1)
print "R = %0.1f kohm"%R 
Component values are :
R1 = RF = 31.8 kohm
R = 15.9 kohm

Exa 6.6 : page 260

In [9]:
from math import sqrt, pi
# given data 
AF=5 #unitless
fc=1 #in KHz
alfa=1.414 #unitless
# assume C2=0.1 uF
C2=0.1 #in uF
C3=(C2*alfa**2)/4 # in uF
R=1/(2*pi*fc*10**3*sqrt(C2*10**-6*C3*10**-6)) #in ohm
#Take RF=10 Kohm
RF=10 #in  Kohm
R1=RF/(AF-1) #in Kohm
print "Value of R = %0.2f kohm"%(R/1E3)
print "Value of RF = %0.2f kohm" %(RF)
print "Value of R1 = %0.2f kohm"%R1
Value of R = 2.25 kohm
Value of RF = 10.00 kohm
Value of R1 = 2.50 kohm

Exa 6.7 : page 261

In [10]:
from math import sqrt, pi
# given data 
C2=0.1 #in uF
C3=0.0333 #in uF
alfa=2*sqrt(C3/C2) #unitless
print "Value of alfa = %0.2f" %alfa 
print "This filter is situated between Butterworth and the Chebyshev, hence approximating Klp=1.1" 
Klp=1.1 #unitless
R=2.25 #in Kohm
f3dB=Klp/(2*pi*R*sqrt(C2*C3)) #in KHz
print "f3dB = %0.2f kHz" %f3dB
#Note : Answer in the book is wrong
Value of alfa = 1.15
This filter is situated between Butterworth and the Chebyshev, hence approximating Klp=1.1
f3dB = 1.35 kHz

Exa 6.8 : page 261

In [11]:
from math import pi
# given data 
Klp=1 #unitless# it is 1 for butterworth filter
alfa=1.414 #unitless# it is 1.414 for butterworth filter
fc=1 #in KHz
R=15.9 #in Kohm
# assume C=0.01 uF
C=0.01 #in uF
R=Klp/(2*pi*fc*1000*C*10**-6) # in ohm
AF=3-alfa #unitless
R1=2*R/0.369 #in Kohm
RF=(AF-1)*R1 #in Kohm
A2=5/AF #unitless
print "Value of RF = %0.2f kohm" %(RF/1000)
print "Gain of this amplifier = %0.2f "%A2 
Value of RF = 50.55 kohm
Gain of this amplifier = 3.15 

Exa 6.9 : page 262

In [12]:
from __future__ import division
from math import pi
# given data 
R2=20 #in Kohm
R3=20 #in Kohm
R=R2 #in Kohm
C2=0.47 #in uF
C3=0.47 #in uF
C=C2 #in uF
RF=56 #in Kohm
R1=56 #in Kohm
AF=1+RF/R1 #unitless
alfa=3-AF #unitless
Klp=1.238 #unitless
print "Value of alfa = %0.2f" %alfa 
print "alfa=1 corresponds to chebyshev filter response." 
f3dB=Klp/(2*pi*R*1000*C*10**-6) #in Hz
print "Critical frequency = %0.2f Hz" %(f3dB)
Value of alfa = 1.00
alfa=1 corresponds to chebyshev filter response.
Critical frequency = 20.96 Hz

Exa 6.10 : page 263

In [13]:
from math import pi
# given data 
fc=2 #in kHz
alfa=1.414 #unitless
Klp=1 #unitless
#assume C=0.01 uF
C=0.01 #in uF
R=Klp/(2*pi*fc*1000*C*10**-6) #in ohm
AF=3-alfa #unitless
R1=2*R/0.369 #in ohm
RF=0.586*R1 #in ohm
print "Design components values are :" 
print "Value of R1 = %0.2f kohm"%(R1/1000)
print "Value of RF = %0.2f kohm"%(RF/1000)
print "Value of R2=R3=R= %0.2f kohm" %(R/1000)
print "Value of C2=C3=C= %0.2f uF" %(C)
Design components values are :
Value of R1 = 43.13 kohm
Value of RF = 25.28 kohm
Value of R2=R3=R= 7.96 kohm
Value of C2=C3=C= 0.01 uF

Exa 6.11 : page 267

In [14]:
# given data 
C=0.1 #in uF
R=11 #in Kohm
RF=5.6 #in Kohm
R1=10 #in Kohm
AF=1+RF/R1 #unitless
alfa=3-AF #unitless
Klp=1 #unitless# for Butterworth filter
Khp=1/Klp #unitless
f3dB=Khp/(2*pi*R*1000*C*10**-6) #in Hz
print "3 dB frequency = %0.2f Hz"%(f3dB)
print "Value of alfa = %0.2f"%alfa 
print "Value of alfa shows that it is a Butterworth flter." 
print "Passband gain for a high pass filter = %0.2f"%Khp
3 dB frequency = 144.69 Hz
Value of alfa = 1.44
Value of alfa shows that it is a Butterworth flter.
Passband gain for a high pass filter = 1.00

Exa 6.12 : page 267

In [15]:
from math import pi
# given data 
fc=2 #in KHz
alfa=1.414 #unitless
Klp=1 #unitless
#assume C=0.01 uF
C=0.01 #in uF
R=Klp/(2*pi*fc*1000*C*10**-6) #in ohm
AF=3-alfa #unitless
R1=2*R/0.369 #in ohm
RF=0.586*R1 #in ohm
print "Design components values are :" 
print "Value of R1 = %0.2f kohm" %(R1/1000)
print "Value of RF = %0.2f kohm" %(RF/1000)
print "Value of R2=R3=R= %0.2f kohm " %(R/1000)
print "Value of C2=C3=C= %0.2f uF" %(C)
Design components values are :
Value of R1 = 43.13 kohm
Value of RF = 25.28 kohm
Value of R2=R3=R= 7.96 kohm 
Value of C2=C3=C= 0.01 uF

Exa 6.13 : page 270

In [19]:
from math import pi, sqrt
# given data 
fL=200 #in Hz
fH=1 #in KHz
AFBP=4 #unitless
#for LP section design
#assume C=0.01 uF
C=0.01 #in uF
R=1/(2*pi*fH*1000*C*10**-6) #in ohm
print "For low pass section design component values are :" 
print "Value of R = %0.1f kohm" %(R/1000)
print "Value of C = %0.2f uF "%C
#for HP section design
#assume C=0.05 uF
C=0.05 #in uF
R=1/(2*pi*fL*1000*C*10**-6) #in ohm
print "For high pass section design component values are :" 
print "Value of R = %0.1f kohm" %R
print "Value of C = %0.2f uF"%C
print "We have AFBP=AFHP*AFLP=4" 
print "R=10 kohm" 
fc=sqrt(fH*fL*1000) #in Hz
BW=fH*1000-fL #in Hz
Q=fc/BW #unitless
print "Center frequency = %0.2f Hz"%fc
print "BW = %0.2f Hz"%BW
print "Selectivity = %0.2f" %Q
print "As Q<10, hence the given filter is wide band pass filter."
For low pass section design component values are :
Value of R = 15.9 kohm
Value of C = 0.01 uF 
For high pass section design component values are :
Value of R = 15.9 kohm
Value of C = 0.05 uF
We have AFBP=AFHP*AFLP=4
R=10 kohm
Center frequency = 447.21 Hz
BW = 800.00 Hz
Selectivity = 0.56
As Q<10, hence the given filter is wide band pass filter.

Exa 6.14 : page 274

In [22]:
from math import sqrt, pi
# given data 
fL=2 #in KHz
fH=2.5 #in KHz
AF=-5 #unitless
fc=sqrt(fH*1000*fL*1000) #in Hz
BW=fH*1000-fL*1000 #in Hz
Q=fc/BW #unitless
print "Center frequency = %0.f Hz"%fc
print "BW = %0.2f Hz"%BW
print "Selectivity = %0.3f " %Q 
#assume C=0.01 uF
C=0.01 #in uF
R2=2/(2*pi*C*10**-6*BW) #in Kohm
R1=-R2/(2*AF) #in KOhm
R3=R1/((4*pi*pi*R1*R2*fc*1000*fc*1000*C*C*10**-12)-1) #in Kohm
print "Value of R1 = %0.2f kohm "%(R1/1000)
print "Value of R2 = %0.2f kohm "%(R2/1000)
print "Value of R3 = %0.2f ohm "%(R3*1000)
print "Value of C = %0.2f uF" %C
Center frequency = 2236 Hz
BW = 500.00 Hz
Selectivity = 4.472 
Value of R1 = 6.37 kohm 
Value of R2 = 63.66 kohm 
Value of R3 = 0.80 ohm 
Value of C = 0.01 uF

Exa 6.15 : page 276

In [23]:
# given data 
AF=-10 #unitless
Q=20 #unitless
fc=50 #in Hz
fc1=fc #in Hz
fc2=fc #in Hz
fc3=fc #in Hz
Q1=0.51*Q #unitless
Q2=0.51*Q #unitless
Q3=0.51*Q #unitless
AF1=-(-AF)**(1/3) #unitless
print "A single op-amp band passed filter can be design with specifications :" 
print "Center frequency = %0.2f Hz" %fc
print "AF1 = %0.2f "%AF1 
print "Q1 = %0.2f "%Q1 
A single op-amp band passed filter can be design with specifications :
Center frequency = 50.00 Hz
AF1 = -2.15 
Q1 = 10.20 

Exa 6.16 : page 282

In [24]:
from math import tan, pi
# given data 
f=2 #in KHz
fi_degree=-135 #in degree
fi_radian=fi_degree*(pi/180) 
print "A phase shift of -135 degree is achieved by an all pass phase lag filter." 
#assume C=0.1 uF and R1=RF=10 Kohm
C=0.1 #in uF
R1=10 #in Kohm
RF=10 #in Kohm
R=tan(-fi_radian/2)/(2*pi*f*1000*C*10**-6) 
print "Component values are :" 
print "Value of R1 = %0.2f kohm "%R1
print "Value of RF = %0.2f kohm"%RF
print "Value of R = %0.2f kohm " %(R/1000)
print  "Value of C = %0.2f uF "%C
A phase shift of -135 degree is achieved by an all pass phase lag filter.
Component values are :
Value of R1 = 10.00 kohm 
Value of RF = 10.00 kohm
Value of R = 1.92 kohm 
Value of C = 0.10 uF 

Exa 6.17 : page 286

In [27]:
 # given data 
R=10 #in Kohm
R1=R #in Kohm
R2=R #in Kohm
R3=R #in Kohm
Rf=5.6 #in Kohm
R4=Rf #in Kohm
R5=Rf #in Kohm
RA=2.7 #in Kohm
RB=1.5 #in Kohm
C=0.01 #in uF
C1=C #in uF
C2=C #in uF
alfa=3*RB/(RA+RB) 
print "Value of alfa = %0.2f"%alfa 
print "This value correspondes to the chebyshev response." 
C=0.01 #in uF
C1=C #in uF
C2=C #in uF
fc=1/(2*pi*Rf*1000*C*10**-6) #in Hz
Klp=1.238 #unitless
fH=fc*Klp #in Hz
Khp=1/Klp #unitless
fL=fc*Khp#in Hz
print "Critical frequency = %0.2f kHz"%(fc/1000)
print "High cut-off frequency = %0.2f kHz" %(fH/1000)
print "Low cut-off frequency = %0.2f kHz "%(fL/1000)
C=0.01 #in uF
C1=C #in uF
C2=C #in uF
fc=1/(2*pi*Rf*1000*C*10**-6) #in Hz
print "Band pass center frequency = %0.2f kHz" %(fc/1000)
C=0.01 #in uF
C1=C #in uF
C2=C #in uF
alfa=3*RB/(RA+RB) #unitless
Q=1/alfa #unitless
fc=1/(2*pi*Rf*1000*C*10**-6) #in Hz
BW=fc/Q #in Hz
print "Band pass bandwidth = %0.2f kHz" %(BW/1000)
C=0.01 #in uF
C1=C #in uF
C2=C #in uF
alfa=3*RB/(RA+RB) #in unitless
Q=1/alfa #in unitless
print "The band pass gain at center frequency = %0.3f "%Q 
Value of alfa = 1.07
This value correspondes to the chebyshev response.
Critical frequency = 2.84 kHz
High cut-off frequency = 3.52 kHz
Low cut-off frequency = 2.30 kHz 
Band pass center frequency = 2.84 kHz
Band pass bandwidth = 3.05 kHz
The band pass gain at center frequency = 0.933