%matplotlib inline
f0=15*10**3; #center frequency in hertz
BW=1*10**3;
Q=f0/BW;
if Q>10:
print('narrow band filter, Q = %d'%Q)
R2=10*10**3;
R1=0.586*R2; #FOR BUTTERWORTH RESPONSE
print('R1 in ohms =%d'%R1)
print('5.6kilo ohm will be ideally close to maximally flat butterworth response')
import math
R_A=1*10**3;
R2=1*10**3;
R_B=R_A;
R=R_A;
C_A=0.022*10**-6;
C_B=C_A;
C=C_A;
f_c=1/(2*math.pi*R*C); #critical frequency
R1=0.586*R2; #for butterworth response
print('critical frequency in hertz =%f'%f_c)
print('value of R1 in ohms = %d'%R1)
import math
f_c=2860.0;
R=1.8*10**3;
C=1/(2*math.pi*f_c*R);
R2=R;
R1=0.152*R2; #BUTTERWORTH RESPONSE IN FIRST STAGE
R4=R;
R3=1.235*R4; #BUTTERWORTH RESPONSE IN SECOND STAGE
C=C*10**8
print('capacitance in farads = %f *10^-8'%C);
print('R1 in ohms for butterworth response in first stage = %.1f'%R1)
print('R3 in ohms for butterworth response in second stage = %d'%R3)
import math
f_c=10*10**3; #critical frequency in hertz
R=33*10**3; #Assumption
R2=R;
C=1/(2*math.pi*f_c*R);
R1=0.586*R2; #for butterworth response
C=C*10**10
print('Capacitance in Farads = %f * 10^-10'%C)
print('R1 in ohms taking R2=33kilo-ohms = %d'%R1)
R1=3.3*10**3; #Assumption
R2=R1/0.586; #butterworth response
print('R2 in ohms taking R1=3.3kilo-ohms = %f'%R2)
import math
R1=68.0*10**3;
R2=180.0*10**3;
R3=2.7*10**3;
C=0.01*10**-6;
f0=(math.sqrt((R1+R3)/(R1*R2*R3)))/(2*math.pi*C);
A0=R2/(2*R1);
Q=math.pi*f0*C*R2;
BW=f0/Q;
print('center frequency in hertz = %f'%f0)
print('maximum gain = %f'%A0)
print('bandwidth in hertz = %f'%BW)
import math
R4=1000.0;
C1=0.022*10**-6;
R7=R4;
C2=C1;
R6=R4;
R5=100.0*10**3;
f_c=1/(2*math.pi*R4*C1); #critical frequency in hertz for each integrator
f0=f_c #center frequency
Q=(1+(R5/R6))/3;
BW=f0/Q;
print('center frequency in hertz = %f'%f0)
print('value of Q = %f'%Q)
print('bandwidth in hertz = %f'%BW)
import math
R4=12.0*10**3;
C1=0.22*10**-6;
R7=R4;
C2=C1;
R6=3.3*10**3;
Q=10;
f0=1/(2*math.pi*R7*C2);
R5=(3*Q-1)*R6;
print('center frequency in hertz = %f'%f0)
print('R5 in ohms = %d'%R5)
print('Nearest value is 100 kilo-ohms')