#In this example the values of a1,a2,a3,a4 are found
#the values of z1 z2 z3 are substituted in the equation AF=(z-z1)(z-z2)(z-z3)
a1=-1
a2=1
a3=-1
a4=1
print "The values of a1, a2, a3 and a4 are %d, %d, %d and %d respectively"%(a1,a2,a3,a4)
import numpy as np
import scipy.integrate as integrate
a=np.zeros(11)
for m in range(0,11):
a[m]=integrate.quad(lambda x: exp(-1j*m*x) , (-pi/sqrt(2)) , (pi/sqrt(2)))[0]
maxval = a[0]
for i in range(0,11):
if maxval<a[i]:
maxval = a[i]
print 'Normalized Co-efficients:';
for i in range(0,11):
a[i]=a[i]/maxval
print 'a',i,':',a[i]