# Chapter : 5 - Filters¶

## Example 5.1 : Page No - 204¶

In [2]:
from numpy import pi
#Given data
R = 10 # in k ohm
R = R * 10**3 # in ohm
C = 0.001 # in µF
C = C * 10**-6 # in F
f_c = 1/(2*pi*R*C) # Hz
f_c = f_c * 10**-3 # in kHz
print "Cutoff frequency = %0.3f kHz" %f_c
R_F = 100 # in k ohm
R1 = 10 # in k ohm
A_F = 1+(R_F/R1)
print "The passband voltage gain = %0.f" %A_F

Cutoff frequency = 15.915 kHz
The passband voltage gain = 11


## Example 5.2 : Page No - 204¶

In [4]:
#Given data
R1 = 10 # in k ohm
R_F = R1 # in k ohm
print "The value of R_F = %0.f kΩ" %R_F
C = 0.001 # in µF
C = C  *10**-6 # in F
f_c = 10 # in kHz
f_c = f_c * 10**3 # in Hz
R = 1/(2*pi*f_c*C) # in ohm
R  = R * 10**-3 # in k ohm
print "The value of R = %0.1f kΩ" %R

The value of R_F = 10 kΩ
The value of R = 15.9 kΩ


## Example 5.3 : Page No - 204¶

In [7]:
#Given data
f_c = 2 # in kHz
f_c = f_c * 10**3 # in Hz
C = 0.01 # in µF
C = C * 10**-6 # in F
R = 1/(2*pi*f_c*C) # in ohm
R = R * 10**-3 # in k ohm
R = 8.2 # in k ohm(Practical value)
A_F = 2.5
R1 = (A_F*R)/1.5 # in k ohm
R_F = 1.5*R1 # in k ohm
print "The value of R1 = %0.2f kΩ (standard value 15 kohm)" %R1
print "The value of R_F = %0.f kΩ" %R_F

The value of R1 = 13.67 kΩ (standard value 15 kohm)
The value of R_F = 20 kΩ


## Example 5.4 : Page No - 208¶

In [11]:
#Given data
f_c = 1 # in kHz
f_c = f_c * 10**3 # in Hz
C = 0.005*10**-6 # in F
R3 = 1/(2*pi*f_c*C) # in ohm
R3 = R3 * 10**-3 # in k ohm
R2 = R3 # in k ohm
R1 = 33 # in k ohm (standard value)
R_F = 0.586*R1 # in k ohm
print "The value of R1  = %0.f kΩ" %R1
print "The value of R2  = R3 = %0.2f kΩ" %R3
print "The value of R_F = %0.3f kΩ" %R_F
print "The value of C2  = C3 = %0.3f µF" %(C*10**6)

The value of R1  = 33 kΩ
The value of R2  = R3 = 31.83 kΩ
The value of R_F = 19.338 kΩ
The value of C2  = C3 = 0.005 µF


## Example 5.5 : Page No - 208¶

In [15]:
from __future__ import division
#Given data
R1 = 12 # in k ohm
R_F = 7 # in k ohm
R2 = 33 # in k ohm
R3 = R2 # in k ohm
R = R2 # in k ohm
R = R * 10**3 # in ohm
C1 = 0.002 # in µF
C1 = C1 * 10**-6 # in F
C2 = C1 # in F
C = C1 # in F
f_c = 1/(2*pi*R*C) # in Hz
f_c = f_c * 10**-3 # in kHz
print "Cut off frequency = %0.3f kHz" %f_c
A_F = 1+(R_F/R1)
print "Pass band voltage gain = %0.3f" %A_F

#Note : The unit of cut off frequency in the book is wrong

Cut off frequency = 2.411 kHz
Pass band voltage gain = 1.583


## Example 5.6 : Page No - 209¶

In [18]:
#Given data
f_c = 2 # in kHz
f_c = f_c * 10**3 # in Hz
C2 = 0.033 # in µF
C2 = C2 * 10**-6 # in F
C3 = C2 # in F
C = C2 # in F
R2 = 1/(2*pi*f_c*C) # in ohm
R2 = R2 * 10**-3 # in k ohm
R3=R2 # in kohm
print "The value of R2 = R3 = %0.1f kΩ" %R2
#R_F= 0.586*R1
R1= 2*R2*(1+0.586)/0.586 # in k ohm
print "The value of R1 = %0.f kΩ" %R1
R1= 15 # in k ohm
R_F = 0.586 * R1 # in k ohm
print "The value of R_F = %0.2f kΩ" %R_F
print "R_F may be taken as a pot of 10 kΩ"

The value of R2 = R3 = 2.4 kΩ
The value of R1 = 13 kΩ
The value of R_F = 8.79 kΩ
R_F may be taken as a pot of 10 kΩ


## Example 5.7 : Page No - 209¶

In [26]:
import math
#Given data
f_c = 1 # in kHz
f_c = f_c * 10**3 # in Hz
C2 = 0.0047 # in µF
C2 = C2 * 10**-6 # in F
C3 = C2 # in F
C = C2 # in F
R2 = 1/(2*pi*f_c*C) # in ohm
R2 = R2 * 10**-3 # in k ohm
R3= R2 # in kohm
# Let
R1=30 # in kohm
R_F= R1*0.586 # in kohm
print "The value of R2 = R3 = %0.f kΩ" %math.floor(R2)
print "The value of C2 = C3 = %0.4f micro F" %(C3*10**6)
print "The value of R1 = %0.f kΩ" %R1
print "The value of R_F = %0.f kΩ" %R_F
print "The standard value of R_F is 20 kΩ"

The value of R2 = R3 = 33 kΩ
The value of C2 = C3 = 0.0047 micro F
The value of R1 = 30 kΩ
The value of R_F = 18 kΩ
The standard value of R_F is 20 kΩ


## Example 5.8 : Page No - 215¶

In [47]:
from math import sqrt
#Given data
f_c = 1.5 # in kHz
f_c = f_c * 10**3 # in Hz
alpha = sqrt(2)
R_F = (2-alpha) # in ohm
print "The value of R_F = %0.3f Ω" %R_F
R_i = 1 # in ohm
A_F = 1+(R_F/R_i)
print "The pass band gain = %0.3f" %A_F
Omega_c = 2*pi*f_c # in rad/sec
C = 1 # in F
R = 1/Omega_c # in ohm
R = R * 10**7 # in ohm
R=R*10**-3 # in kohm
R1 = R # in k ohm
R2=R1 # in kohm
print "The value of R1 = R2 = %0.3f kΩ" %R1
C = C/10**7 # in µF
C = C * 10**9 # in nF
C1=C # in nF
C2= C1 # in nF
print "The value of C1 = C2 = %0.f nF" %C1

#Note: The unit of R1 and R2 is wrong in the book

The value of R_F = 0.586 Ω
The pass band gain = 1.586
The value of R1 = R2 = 1.061 kΩ
The value of C1 = C2 = 100 nF


## Example 5.9 : Page No - 216¶

In [48]:
#Given data
alpha = 1.414
f_c = 1.5 # in kHz
f_c = f_c * 10**3 # in Hz
C1 = 2/alpha # in F
C2 = alpha/2 # in F
R1 = 1 # in ohm
R2 = R1 # in ohm
R_F = 2 # in ohm
Omega_c = 2*pi*f_c # in rad/sec
R = 1/Omega_c # in ohm
R = R * 10**7 # in ohm
R1 = R # in ohm
R2= R1 # in ohm
R_F = 2*R # in ohm
C1 = C1/10**7 # in F
C2 = C2/10**7 # in F
print "The value of R1  = R2 = %0.3f kohm" %(R1*10**-3)
print "The value of C1  = %0.1f nF" %(C1*10**9)
print "The value of C2  = %0.1f nF" %(C2*10**9)
print "The value of R_F = %0.3f kohm" %(R_F*10**-3)

The value of R1  = R2 = 1.061 kohm
The value of C1  = 141.4 nF
The value of C2  = 70.7 nF
The value of R_F = 2.122 kohm


## Example 5.12 : Page No - 220¶

In [95]:
from __future__ import division
from math import log10
#Given data
f_c = 10 # in kHz
f_c = f_c * 10**3 # in Hz
C = 0.01 # in µF
C= C*10**-6 # in F
Ri= 10*10**3 # in Ω
n=2
Q= 1/1.414
R= 1/(2*pi*f_c*C) # in Ω
Af= 3-1/Q
Rf= (Af-1)*Ri # in Ω
print "The value of C = %0.2f µF" %(C*10**6)
print "The value of R = %0.3f kΩ" %(R*10**-3)
print "The value of Rf = %0.2f kΩ" %(Rf*10**-3)
print "Frequency versus gain magnitude shown in following table:"
print "-----------------------------------------------------------------------------------------"
print "|      Frequency in Hz                                 Gain Magnitude in dB |H(s)|      |"
print "-----------------------------------------------------------------------------------------"
f= 1000 # in Hz
HsdB= 20*log10(Af/sqrt(1+(omega/omega_c)**4))
print "|           ",int(f),"                                               ",int(HsdB),"                    |"
f= 2000 # in Hz
HsdB= 20*log10(Af/sqrt(1+(omega/omega_c)**4))
print "|           ",int(f),"                                               ",round(HsdB,3),"                |"
f= 5000 # in Hz
HsdB= 20*log10(Af/sqrt(1+(omega/omega_c)**4))
print "|           ",int(f),"                                               ",round(HsdB,2),"                 |"
f= 10000 # in Hz
HsdB= 20*log10(Af/sqrt(1+(omega/omega_c)**4))
print "|          ",int(f),"                                               ",int(round(HsdB,2)),"                    |"
f= 50000 # in Hz
HsdB= 20*log10(Af/sqrt(1+(omega/omega_c)**4))
print "|          ",int(f),"                                              ",round(HsdB,2),"                |"
f= 100000 # in Hz
HsdB= 20*log10(Af/sqrt(1+(omega/omega_c)**4))
print "|         ",int(f),"                                              ",round(HsdB,2),"                |"
print "-----------------------------------------------------------------------------------------"

The value of C = 0.01 µF
The value of R = 1.592 kΩ
The value of Rf = 5.86 kΩ
Frequency versus gain magnitude shown in following table:
-----------------------------------------------------------------------------------------
|      Frequency in Hz                                 Gain Magnitude in dB |H(s)|      |
-----------------------------------------------------------------------------------------
|            1000                                                 4                     |
|            2000                                                 3.999                 |
|            5000                                                 3.74                  |
|           10000                                                 1                     |
|           50000                                                -23.96                 |
|          100000                                                -35.99                 |
-----------------------------------------------------------------------------------------


## Example 5.13 : Page No - 221¶

In [97]:
#Given data
f_c = 1 # in kHz
f_c = f_c * 10**3 # in Hz
C = 0.1 # in µF
print "The value of C = %0.1f µF" %C
C = C * 10**-6 # in F
R = 1/(2*pi*f_c*C) # in ohm
print "The value of R = %0.3f kΩ" %(R*10**-3)
Q1 = 1/0.765
alpha1 = 1/Q1
Q2 = 1/1.848
alpha2 = 1/Q2
A_F1 = 3-alpha1
A_F2 = 3-alpha2
R_i =10*10**3 # in ohm
R_F = (A_F1-1)*R_i # in ohm
print "For first stage the value of R_F = %0.2f kΩ" %(R_F*10**-3)
R_i = 100*10**3 # ohm
R_F = (A_F2-1)*R_i # in ohm
print "For second stage the value of R_F = %0.1f kΩ" %(R_F*10**-3)

The value of C = 0.1 µF
The value of R = 1.592 kΩ
For first stage the value of R_F = 12.35 kΩ
For second stage the value of R_F = 15.2 kΩ


## Example 5.14 : Page No - 225¶

In [99]:
#Given data
f_c = 10 # in kHz
f_c = f_c *10**3 # in Hz
C = 0.0047 # in µF
C = C * 10**-6 # in F
R = 1/(2*pi*f_c*C) # in ohm
R = R * 10**-3 # in k ohm
print "The value of R = %0.3f kΩ" %R

The value of R = 3.386 kΩ


## Example 5.15 : Page No - 225¶

In [103]:
#Given data
R = 15 # in k ohm
R = R *10**3 # in ohm
C = 0.01 # in µF
C = C * 10**-6 # in F
f_c = 1/(2*pi*R*C) # in Hz
f_c= round(f_c)
print "Cut off frequency = %0.f Hz" %f_c
Omega_c = 2*pi*f_c # in rad/sec
print "The value of omega_c = %0.3f k rad/sec" %(Omega_c*10**-3)

# Note: There is calculation error to find the value of omega_c. So the answer in the book is wrong

Cut off frequency = 1061 Hz
The value of omega_c = 6.666 k rad/sec


## Example 5.16 printed as 5.13 : Page No - 226¶

In [105]:
#Given data
R1 = 27 # in k ohm
R1 = R1 * 10**3 # in ohm
R2 = R1 # in ohm
R3 = R2  # in ohm
R = R1 # in ohm
R_L = 10 # in k ohm
R_F = 16 # in k ohm
C2 = 0.005 # in µF
C2 = C2 * 10**-6 # in F
C3 = C2 # in F
C = C3 # in F
f_c = 1/(2*pi*R*C) # in Hz
f_c = f_c * 10**-3 # in kHz
R1= R1*10**-3 # in kohm
print "Cut off frequency = %0.2f kHz" %f_c
A_F = 1+(R_F/R1)
print "Voltage gain = %0.3f" %A_F

Cut off frequency = 1.18 kHz
Voltage gain = 1.593


## Example 5.17 : Page No - 229¶

In [107]:
#Given data
alpha = 1.732
k_f = 1.274
C1 = 1 # in F
C2 = C1 # in F
R1 = alpha/2 # in ohm
R2 = 2/alpha # in ohm
R_F = R2 # in ohm
f_3dB = 2 # in kHz
f_3dB = f_3dB * 10**3 # in Hz
f_c = f_3dB/k_f # in Hz
Omega_c = 2*pi*f_c # in rad/sec
R1 = R1/Omega_c # in ohm
R1 = R1 * 10**8 # in ohm
R2 = R2/Omega_c # in ohm
R2 = R2 * 10**8 # in ohm
R_F = R2 # in ohm
C1 = C1/10**8 # in F
print "The value of R1 = %0.4f kΩ" %(R1*10**-3)
print "The value of R2 = R_F = %0.3f kΩ" %(R2*10**-3)
print "The value of C1 = C2 = %0.f nF" %(C1*10**9)

The value of R1 = 8.7797 kΩ
The value of R2 = R_F = 11.707 kΩ
The value of C1 = C2 = 10 nF


## Example 5.18 printed as 5.15 : Page No - 232¶

In [111]:
from math import sqrt
#Given data
Cdesh = 0.01 # in µF
Cdesh= Cdesh* 10**-6 # in F
f_H = 1 # in kHz
f_H = f_H * 10**3 # in Hz
Rdesh= 1/(2*pi*f_H*Cdesh) # in ohm
A_F2 = 2
R1desh = 10*10**3 # in ohm
Rdesh_F= R1desh # in ohm
print "(i) Low-pass Filter Components : "
print "The value of R1' = %0.f kΩ" %(R1desh*10**-3)
print "The value of R'  = %0.1f kΩ" %(Rdesh*10**-3)
print "The value of R'F = %0.f kΩ" %(Rdesh_F*10**-3)
print "The value of C   = %0.2f µF" %(Cdesh*10**6)
C = 0.05 # in µF
C = C * 10**-6 # in F
f_L = 100 # in Hz
R = 1/(2*pi*f_L*C) # in ohm
A_F1 = 2
R1 = 10*10**3 # in ohm
R_F = R1 # in ohm
print "\n(ii) High pass Filter Components"
print "The value of R1  = %0.f kΩ" %(R1*10**-3)
print "The value of R   = %0.3f kΩ" %(R*10**-3)
print "The value of R_F = %0.f kΩ" %(R_F*10**-3)
print "The value of C   = %0.2f µF" %(C*10**6)
Q = sqrt(f_H*f_L)/(f_H-f_L)
print "The quality factor = %0.3f" %Q

# Note : In High pass filter components, the value of R is calculated 31.83 kΩ but at last it is writter as 3.183 kΩ
#       so the answer of R in High pass filter components is wrong.

(i) Low-pass Filter Components :
The value of R1' = 10 kΩ
The value of R'  = 15.9 kΩ
The value of R'F = 10 kΩ
The value of C   = 0.01 µF

(ii) High pass Filter Components
The value of R1  = 10 kΩ
The value of R   = 31.831 kΩ
The value of R_F = 10 kΩ
The value of C   = 0.05 µF
The quality factor = 0.351


## Example 5.19 : Page No - 234¶

In [113]:
#Given data
f_c = 2 # in kHz
f_c = f_c * 10**3 # in Hz
A_F = 10
Q = 4
C = 0.01 # in µF
C = C * 10**-6 # in F
R1 = Q/(2*pi*f_c*C*A_F) # in ohm
R1 = R1 * 10**-3 # in k ohm
print "The value of R1 =",round(R1,3),"kΩ (standard value 3.3 kΩ)"
R2 = Q/(2*pi*f_c*C*(2*Q**2-A_F)) # in ohm
R2 = R2 * 10**-3 # in k ohm
print "The value of R2 =",round(R2,3),"kΩ (standard value 1.5 kΩ)"
R3 = Q/(pi*f_c*C) # in ohm
R3 = R3 * 10**-3 # in k ohm
print "The value of R3 =", round(R3,2),"kΩ (standard value 63 kΩ)"
f_c1 = 1 # in kHz
Rdesh2 = R2*(((f_c*10**-3)/f_c1)**2) # in k ohm
print "The value of R'2 =", round(Rdesh2,3),"kΩ (standard value 5.8 kΩ)"

The value of R1 = 3.183 kΩ (standard value 3.3 kΩ)
The value of R2 = 1.447 kΩ (standard value 1.5 kΩ)
The value of R3 = 63.66 kΩ (standard value 63 kΩ)
The value of R'2 = 5.787 kΩ (standard value 5.8 kΩ)


## Example 5.20 Printed as 5.17 : Page No - 236¶

In [117]:
#Given data
f_H = 100 # in Hz
f_L = 2 # in kHz
f_L = f_L * 10**3 # in Hz
C = 0.01 # in µF
C = C * 10**-6 # in F
R = 1/(2*pi*f_L*C) # in ohm
R = R * 10**-3 # in k ohm
A_F = 2
R1 = 10 # in k ohm
# A_F= 1+R_F/R1 or
R_F= (A_F-1)*R1 # in k ohm
print "(i) High-pass Section Components : "
print "The value of C = %0.2f µF" %(C*10**6)
print "The value of R = %0.2f kΩ" %R
print "The value of R_F = R1 = %0.f kΩ" %R_F
Cdesh = 0.1 # in µF
Cdesh= Cdesh* 10**-6 # in F
Rdesh = 1/(2*pi*f_H*Cdesh) # in ohm
Rdesh= Rdesh * 10**-3 # in k ohm
Rdesh1 = 10 # in k ohm
Rdesh_F= Rdesh1 # in k ohm
print "\n(ii) Low-pass Section components : "
print "The value of C' = %0.1f µF" %(Cdesh*10**6)
print "The value of R' = %0.3f kΩ" %Rdesh
print "The value of R'F = R'1 = %0.f kΩ" %Rdesh_F
R2 = 10 # in k ohm
R3 = R2 # in k ohm
R4 = R2 # in k ohm
R_OM = (R2*R3*R4)/(R2*R3+R3*R4+R4*R2) # in k ohm
print "\n(iii) Summing Amplifier component"
print "The value of R_OM = %0.1f kΩ" %R_OM

(i) High-pass Section Components :
The value of C = 0.01 µF
The value of R = 7.96 kΩ
The value of R_F = R1 = 10 kΩ

(ii) Low-pass Section components :
The value of C' = 0.1 µF
The value of R' = 15.915 kΩ
The value of R'F = R'1 = 10 kΩ

(iii) Summing Amplifier component
The value of R_OM = 3.3 kΩ


## Example 5.21 : Page No - 238¶

In [119]:
#Given data
f_N = 50 # in Hz
C = 0.47 # in µF
C = C * 10**-6 # in F
R = 1/(2*pi*f_N*C) # in ohm
R = R * 10**-3 # in k ohm
print "The value of Resistance = %0.3f kohm" %R

The value of Resistance = 6.773 kohm


## Example 5.22 : Page No - 240¶

In [140]:
from math import atan
#Given data
R = 10 # in k ohm
R = R * 10**3 # in ohm
C = 0.01 # in µF
C = C * 10**-6 # in F
f = 2 # in kHz
f = f * 10**3 # in Hz
Phi = -2*atan(2*pi*R*C*f)*180/pi # in degree
print "The phase shift = %0.2f degree" %Phi

The phase shift = -102.98 degree


## Example 5.23 : Page No - 241¶

In [142]:
#Given data
f_L = 200 # in Hz
f_H = 1 # in kHz
f_H = f_H * 10**3 # in Hz
f_c = sqrt(f_H*f_L) # in Hz
print "The center frequency = %0.1f Hz" %f_c
Q = f_c/(f_H-f_L)
print "Quality factor = %0.3f" %Q

The center frequency = 447.2 Hz
Quality factor = 0.559


## Example 5.24 : Page No - 241¶

In [146]:
#Given data
f1 = 5 # in kHz
f1 = f1 * 10**3 # in Hz
f2 = 15 # in kHz
f2 = f2 * 10**3 # in Hz
Cdesh = 0.01 # in µF
Cdesh= Cdesh * 10**-6 # in F
Rdesh = 1/(2*pi*f2*Cdesh) # in ohm
A_F1 = 1.414
A_F2 = A_F1
Rdesh1 = 10 # in k ohm
Rdesh_F = (A_F1-1)*Rdesh1 # in k ohm
print "(i) Low pass Filter components : "
print "The value of R'1 = %0.f kΩ" %Rdesh1
print "The value of R'  = %0.3f kΩ" %(Rdesh*10**-3)
print "The value of R'F = %0.2f kΩ" %Rdesh_F
print "The value of C'  = %0.2f µF" %(Cdesh*10**6)
C = 0.05 # in µF
C = C * 10**-6 # in F
R = 1/(2*pi*f1*C) #in ohm
R1 = 10 # in k ohm
R_F = (A_F1-1)*R1 # in k ohm
print "\n(ii) High pass Filter components : "
print "The value of R1  = %0.f kΩ" %R1
print "The value of R   = %0.2f Ω" %R
print "The value of R_F = %0.2f kΩ" %R_F
print "The value of C   = %0.2f µF" %(C*10**6)

(i) Low pass Filter components :
The value of R'1 = 10 kΩ
The value of R'  = 1.061 kΩ
The value of R'F = 4.14 kΩ
The value of C'  = 0.01 µF

(ii) High pass Filter components :
The value of R1  = 10 kΩ
The value of R   = 636.62 Ω
The value of R_F = 4.14 kΩ
The value of C   = 0.05 µF