In [3]:

```
from __future__ import division
from math import pi
# design loss pass constant K-filter
k=600 #ohms
fc=2500 #Hz
l=(k/(pi*fc)) #H
c=((1/(pi*fc*k))) #farad
print "Inductance = %0.1f mH" %(l*10**3)
print "Capacitance = %0.3f micro-F " %(c*10**6)
```

In [13]:

```
from math import pi
#T-type band pass filter
#given data :
K=500 # in ohm
f1=4 # in kHz
f2=1 # in kHz
L1=K/(pi*(f1-f2))
Ls=L1/2
print "Inductance in each series arm, Ls = %0.2f mH " %Ls
C1=(f1-f2)*10**3/(4*pi*K*f1*f2)
Cs=2*C1
print "Capacity in each series arm, Cs = %0.2f micro-F" %Cs
L2=((f1-f2)*K*1e3)/(4*pi*f1*f2*1e6)*1e3 # mH
print "Shunt arm inductance, L2 = %0.1f mH" %L2
Csh=1*10**6/(pi*(f1-f2)*10**3*K)
print "Capacity in shunt arm, Csh = %0.2f micro-F" % Csh
```