Chapter 9: Filter Design

Example 9.2, Page 344

In [1]:
import math

#Variable declaration
foo=2.05*10**6  #Hz
fc=2*10**6      #cut-off frequency,Hz
Zo=75           #nominal impedance,ohms

#Calculations
Wc=2*math.pi*2*10**6
L=Zo/Wc*2       #H
C=2/(Zo*Wc)     #F
m=math.sqrt(1-(fc/foo)**2)

#Results
print "m=%.4f"%m
print "m*L/2=%.2e H"%(m*L/2)
print "m*C=%.3e F"%(m*C)
print "(1-m**2)*L/4/m=%.2e"%((1-m**2)*L/4/m)
m=0.2195
m*L/2=1.31e-06 H
m*C=4.658e-10 F
(1-m**2)*L/4/m=1.29e-05

Example 9.3, Page 348

In [2]:
import math

#Variable declaration
Zo=75       #image impedance,ohms
Wc=2*math.pi*2*10**6
foo=2.05*10**6  #Hz

#Calculations
L=Zo/Wc*2
m=0.6
C=2/(Zo*Wc)

#Results
print "m*L/2=%.2e H"%(m*L/2)
print "m*C=%.3e F"%(m*C/2)
print "(1-m^2)*L/4/m=%.2e"%((1-m**2)*L/2/m)
m*L/2=3.58e-06 H
m*C=6.366e-10 F
(1-m^2)*L/4/m=6.37e-06

Example 9.4, Page 350

In [3]:
import math

#Variable declaration
Zo=75       #nominal impedance,ohms
Wc=2*math.pi*2*10**6
foo=1.95*10**6  #Hz
fc=2*10**6      #Hz

#Calculations
L=Zo/Wc/2
C=1./2/(Zo*Wc)
m=math.sqrt(1-(foo/fc)**2)

#Results
print "L=%.3e H"%L
print "C=%.3e F"%C
print "m=%.4f"%m
print "2*C/m=%.4e F"%(2*C/m)
print "L/m=%.4e H"%(L/m)
print "4*m*C/(1-m^2)=%.4e F"%((4*m*C)/(1-m**2))
L=2.984e-06 H
C=5.305e-10 F
m=0.2222
2*C/m=4.7750e-09 F
L/m=1.3430e-05 H
4*m*C/(1-m^2)=4.9602e-10 F

Example 9.5, Page 357

In [4]:
import math

#Variable declaration
Le=3.        #dB
E=10**(Le/10)-1
L=15.        #dB
Wc=1
W=1.3*Wc

#Calculations
n=1./2*(math.log10(10**(L/10)-1)-math.log10(E))/math.log10(W/Wc)
m=math.acosh(math.sqrt(10**(0.1*L)-1))/math.acosh(W/Wc)

#Results
print "n=%.2f"%n
print "m=%.2f"%m
n=6.53
m=3.17

Example 9.6, Page 361

In [5]:
import math

#Variable declaration
L=30.    #dB
W=40*10**6  #Hz
Wc=10*10**6 #Hz
Le=3.        #dB
E=10**(Le/10)
Zo=50.       #ohms

#Calculations&Results
Wc=2*math.pi*10**6*10
L=Zo/Wc
C=2./(Zo*Wc)
n=1./2*(math.log(10**(L/10)-1)-math.log(E-1))/math.log(W/Wc)
print "n=%.2f"%n
print "g1=%.0f\ng2=%.0f\ng3=%.0f"%(2*math.sin(math.pi/6),2*math.sin(math.pi/2),2*math.sin(math.pi*5/6))
print "L1=L3=%.4e H"%L
print "C2=%.3e F"%C
Zo=50   #ohms
Wc=2*math.pi*10**6*10
L=Zo*2/Wc
C=1/(Zo*Wc)
print "L2=%.4e H"%L
print "C1=C3=%.4e F"%C
n=17.17
g1=1
g2=2
g3=1
L1=L3=7.9577e-07 H
C2=6.366e-10 F
L2=1.5915e-06 H
C1=C3=3.1831e-10 F

Example 9.7, Page 363

In [6]:
import math

#Variable declaration
Gr=0.01     #dB
L = 5.       #dB
W = 400.*10**6  #Hz
Wc = 100.*10**6 #Hz

#Calculations&Results
m = math.degrees(math.acosh(math.sqrt((10**(0.1*L)-1)/(10**(0.1*Gr)-1))))/math.degrees(math.acosh(W/Wc))
print "m=%.f"%m
m=3
E=math.log(1/math.tanh(Gr/17.37))
X=math.sinh(E/2/m)
n=3
gp=1

for p in range(1,n+1):
    ap=math.sin((2*p-1)*math.pi/2/m)
    bp=X**2+math.sin(p*math.pi/m)**2
    print "ap=%.1f\nbp=%.4f\n"%(ap,bp)

gp=0.62425
print "g0=g4=1"
print "p=1\tgp=0.62425"
for p in range(2,n+1):
    gp=4*math.sin((2*(p-1)-1)*math.pi/2/m)*math.sin((2*p-1)*math.pi/2/m)/(X**2+math.sin((p-1)*math.pi/m)**2)/gp
    print "p=%.0f\tgp=%.5f"%(p,gp)


print "L1=L3=%.4e H\nC1=%.4e F"%(75*0.62425/(2*math.pi*10**8),0.9662/(75*2*math.pi*10**8))
m=2
ap=0.5
bp=3.2760

ap=1.0
bp=3.2760

ap=0.5
bp=2.5260

g0=g4=1
p=1	gp=0.62425
p=2	gp=0.97798
p=3	gp=0.62425
L1=L3=7.4514e-08 H
C1=2.0503e-11 F

Example 9.8, Page 366

In [7]:
import math

#Variable declaration
Gr=3        #dB

#Calculations&Results
m=3
for p in range(1,4):
    ap=math.sin((2*p-1)*math.pi/2/m)
    print "p=%.0f\tap=%.1f"%(p,ap)


E=math.log(1/math.tanh(Gr/17.37))
X=math.sinh(E/2/m)
print "\nE=%.4f\nX=%.4f\n"%(E,X)
for p in range(1,4):
    bp=X**2+math.sin(p*math.pi/m)**2
    print "p=%.0f\tbp=%.4f"%(p,bp)

gp=3.349
print "\ng0=g4=1\ng1=3.349"
for p in range(2,4):
    gp=4*math.sin((2*(p-1)-1)*math.pi/2/m)*math.sin((2*p-1)*math.pi/2/m)/(X**2+math.sin((p-1)*math.pi/m)**2)/gp
    print "gp=%.4f"%gp

print "\nL1=L3=%.1e H\nC2=%.4e F"%(75*3.349/(2*math.pi*10**8),0.7116/(75*2*math.pi*10**8))
p=1	ap=0.5
p=2	ap=1.0
p=3	ap=0.5

E=1.7660
X=0.2986

p=1	bp=0.8392
p=2	bp=0.8392
p=3	bp=0.0892

g0=g4=1
g1=3.349
gp=0.7117
gp=3.3490

L1=L3=4.0e-07 H
C2=1.5101e-11 F

Example 9.9, Page 371

In [8]:
import math

#Variable declaration
#From example 9.7
gL=0.62425
gc=0.9662
m=3

#Calculations&Results
Wc=2*math.pi*100*10**6
CHP=1/(Wc*gL)
LHP=1/(Wc*gc)
print "CHP=%.3e F\nLHP=%.3e H"%(CHP,LHP)
C1=2.5495/75*10**3
L2=75*1.6472
print "C1=C3=%.0f pF\nL2=%.1f nH"%(C1,L2)
CHP=2.550e-09 F
LHP=1.647e-09 H
C1=C3=34 pF
L2=123.5 nH

Example 9.10, Page 374

In [9]:
import math

#Variable declaration
fl=10*10**6     #Hz
fu=40*10**6     #Hz

#Calculations&Results
Wu=2*math.pi*40*10**6
Wl=2*math.pi*10*10**6
gc=0.9662
gL=0.62425
Wo=2*math.pi*20*10**6
fo=math.sqrt(fl*fu)
print "fo=%.e Hz"%fo

CBP1=(Wu-Wl)/(Wo**2*gL)
LBP1=gL/(Wu-Wl)
print "CBP1=%.3f nF\nLBP1=%.4f nH"%(CBP1/10**-9,LBP1/10**-9)

CBP2=(Wu-Wl)/(Wo**2*gc)
LBP2=gc/(Wu-Wl)
print "\nCBP2=%.3f nF\nLBP2=%.4f nH"%(CBP2/10**-9,LBP2/10**-9)

print "\nC1=C3=%.2f pF"%(19.122*1000/75)

print "L1=L3=%.4f nH"%(75*3.3116)

print "\nL2=%.4f uH"%(75*12.354/1000)

print "C2=%.3f pF"%(5.1258/75*1000)
fo=2e+07 Hz
CBP1=19.122 nF
LBP1=3.3117 nH

CBP2=12.354 nF
LBP2=5.1259 nH

C1=C3=254.96 pF
L1=L3=248.3700 nH

L2=0.9265 uH
C2=68.344 pF

Example 9.11, Page 377

In [10]:
import math

#Variable declaration
fl=10*10**6     #Hz
fu=40*10**6     #Hz

#Calculations&Results
Wu=2*math.pi*40*10**6
Wl=2*math.pi*10*10**6
gc=2
gL=1
Wo=2*math.pi*20*10**6
fo=math.sqrt(fl*fu)
print "fo=%.e Hz"%fo

LBS1=(Wu-Wl)/(Wo**2*gL)
CBS1=gL/(Wu-Wl)
print "CBS1=%.3f nF\nLBS1=%.2f nH"%(CBS1/10**-9,LBS1/10**-9)
CBS2=1./gc/(Wu-Wl)
LBS2=(Wu-Wl)*gc/(Wo**2)

print "\nCBS2=%.2f nF\nLBS2=%.3f nH"%(LBS2/10**-9,CBS2/10**-9)


print "\nC1=C3=%.2f pF"%(5.305/75*1000)

print "L1=L3=%.1f nH"%(75*11.94)

print "L2=%.1f uH"%(75*2.653/1000)

print "C2=%.1f pF"%(23.87/75*1000)
fo=2e+07 Hz
CBS1=5.305 nF
LBS1=11.94 nH

CBS2=23.87 nF
LBS2=2.653 nH

C1=C3=70.73 pF
L1=L3=895.5 nH
L2=0.2 uH
C2=318.3 pF

Example 9.12, Page 382

In [11]:
import math

#Variable declaration
print "go=g4=1"
n=3.

#Calculations&Results
for p in range(1,3):
    gp=2*math.sin((2*p-1)*math.pi/2/n)
    print "gp=%.f"%gp

print "Q1=Q3=%.4f rad=%.1f degree"%(50./150,50./150*180/math.pi)
print "Q2=%.2f rad=%.2f degree"%(30*2./50,30*2./50*180/math.pi)
go=g4=1
gp=1
gp=2
Q1=Q3=0.3333 rad=19.1 degree
Q2=1.20 rad=68.75 degree

Example 9.13, Page 387

In [12]:
import math

#Variable declaration
n=3
print "go=g4=1"

#Calculations&Results
for p in range(1,n+1):
    gp=2*math.sin((2*p-1)*math.pi/2/n)
    print "gp=%.f"%gp
go=g4=1
gp=1
gp=2
gp=1