import math
#The resismath.tance R = 1000 Ohm
R = 10**3;
#The Capacitance C = 0.5*10**-6 F
C = 0.1*10**-6;
#Cutoff frequency for RC filter is f
f = 1./(2*math.pi*R*C)
#White noise power spectral density n
n = 10**(-9);
#Noise power at filter output P
P = (math.pi/2)*n*f;
print 'Noise power at output filter is ',P,' Watt'
#Noise power at filter output P_new when cutoff frequency is doubled
P_new = (math.pi/2)*n*2*f;
print 'Noise power at output filter when cutoff frequency is doubled is ',P_new,' Watt'
#Ideal Low Pass filter Bandwidth B = 1000 Hz
B = 1000.;
print 'Output Noise Power is ',n*B,' Watt'
print 'Output Noise Power when cut-off frequency is doubled is ',2*n*B,' Watt'
#Proportionality consmath.tant T = 0.01
T = 0.01;
#Output noise power O
O = n*(B**3)*(T**2)*(4./3)*(math.pi)**2;
print 'Output Noise Power when signal is passed through a differentiator passed through ideal low pass filter %.4f'%O,' Watt'
O_new = 8*n*(B**3)*(T**2)*(4./3)*(math.pi)**2;
print 'Output Noise Power when signal is passed through a differentiator passed through ideal low pass\
\n filter and when cut-off frequency is doubled is %.4f'%O_new,' Watt'
import math
from scipy.integrate import quad
#Given signal strength S = 0.001 W
S = 0.001;
#Gaussian Noise Magnitude n
n = 10**(-8);
#Frequency of signal f = 4000 Hz
F = 4000.;
#Noise at equalizer output N
def f8(f):
return n*(1+(f**2)/F**2)
N = quad(f8,-F,F)[0]
#Signal to Noise Ratio value is SNR
SNR = S/N;
print 'SNR value is ',round(10*math.log10(SNR),4),' dB'