def FS_Zolotarev(N, R, x_min, x_max, x_num, plot_far=False, dB_limit=-40): """Function to evaluate Fourier series coefficients of Chebyshev far-field pattern""" if (N % 2 == 0): print("Order needs to be an ODD number for null patterns") else: m_start = -N # make this (2*P+1) ... and take fourier for only half period m_stop = N m = zl.z_m_frm_R(N, R, a=0.1, b=0.9999999999999) m = str(m) N = str(N) fun_str_re = 'zl.z_Zolotarev(' + N + ',' + 'np.sin(x)' + ',' + m + ')' m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) if (plot_far): x, AF = IFS(zm, 2 * np.pi, m_start, m_stop, x_min, x_max, x_num) AF = 20 * np.log10(abs(AF)) AF = pl.cutoff(AF, dB_limit) plt.plot(x * (180 / np.pi), AF) plt.axis('tight') plt.grid(True) plt.title('Far-field Pattern') plt.xlabel(r'$\phi$') plt.ylabel('AF') plt.show() return m_index, zm
def FS_Zolotarev(N, R, x_min, x_max, x_num, plot_far=False, dB_limit= -40): """Function to evaluate Fourier series coefficients of Chebyshev far-field pattern""" if(N % 2 == 0): print "Order needs to be an ODD number for null patterns" else: m_start = -N # make this (2*P+1) ... and take fourier for only half period m_stop = N m = zl.z_m_frm_R(N, R, a=0.1, b=0.9999999999999) m = str(m) N = str(N) fun_str_re = 'zl.z_Zolotarev(' + N + ',' + 'np.sin(x)' + ',' + m +')' m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) if(plot_far): x, AF = IFS(zm, 2 * np.pi, m_start, m_stop, x_min, x_max, x_num) AF = 20 * np.log10(abs(AF)) AF = pl.cutoff(AF, dB_limit) plt.plot(x * (180 / np.pi), AF); plt.axis('tight'); plt.grid(True) plt.title('Far-field Pattern') plt.xlabel(r'$\phi$') plt.ylabel('AF') plt.show() return m_index, zm
def FS_Chebyshev(N, R, x_min, x_max, x_num, plot_far=False, dB_limit= -40): """Function to evaluate Fourier series coefficients of Chebyshev far-field pattern""" c = np.cosh(np.arccosh(R) / (N)) c = str(c) if(N % 2 == 0): m_start = int(-N / 2) m_stop = int(N / 2) N = str(N) fun_str_re = 'special.eval_chebyt(' + N + ',' + c + '*np.cos(x/2))' m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) else: m_start = -N # make this (2*P+1) ... and take fourier for only half period m_stop = N N = str(N) fun_str_re = 'special.eval_chebyt(' + N + ',' + c + '*np.cos(x))' m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) if(plot_far): x, AF = IFS(zm, 2 * np.pi, m_start, m_stop, x_min, x_max, x_num) AF = 20 * np.log10(abs(AF)) AF = pl.cutoff(AF, dB_limit) plt.plot(x * (180 / np.pi), AF); plt.axis('tight'); plt.grid(True) plt.title('Far-field Pattern') plt.xlabel(r'$\phi$') plt.ylabel('AF') plt.show() return m_index, zm
def FS_Bayliss(N, R, mbar, alpha_x, x_min, x_max, x_num, plot_far=False, dB_limit= -40): """Function to evaluate Fourier series coefficients of Chebyshev far-field pattern""" R = str(R) mbar = str(mbar) alpha_x = str(alpha_x) if(N % 2 == 0): print "Order needs to be an ODD number for null patterns" else: m_start = -N m_stop = N N = str(N) fun_str_re = 'eval_Bayliss(' + N + ',' + R + ',' + mbar + ',' + alpha_x + ',' + 'x' +')' print fun_str_re m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) if(plot_far): x, AF = IFS(zm, 2 * np.pi, m_start, m_stop, x_min, x_max, x_num) AF = 20 * np.log10(abs(AF)) AF = pl.cutoff(AF, dB_limit) plt.plot(x * (180 / np.pi), AF); plt.axis('tight'); plt.grid(True) plt.title('Far-field Pattern') plt.xlabel(r'$\phi$') plt.ylabel('AF') plt.show() return m_index, zm
def FS_Taylor(N, R, mbar, alpha_x, x_min, x_max, x_num, plot_far=False, dB_limit=-40): """Function to evaluate Fourier series coefficients of Chebyshev far-field pattern""" R = str(R) mbar = str(mbar) alpha_x = str(alpha_x) if (N % 2 == 0): m_start = int(-N / 2) m_stop = int(N / 2) N = str(N) fun_str_re = 'eval_Taylor(' + N + ',' + R + ',' + mbar + ',' + alpha_x + ',' + 'x' + ')' print(fun_str_re) m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) else: m_start = -N m_stop = N N = str(N) fun_str_re = 'eval_Taylor(' + N + ',' + R + ',' + mbar + ',' + alpha_x + ',' + 'x' + ')' print(fun_str_re) m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) if (plot_far): x, AF = IFS(zm, 2 * np.pi, m_start, m_stop, x_min, x_max, x_num) AF = 20 * np.log10(abs(AF)) AF = pl.cutoff(AF, dB_limit) plt.plot(x * (180 / np.pi), AF) plt.axis('tight') plt.grid(True) plt.title('Far-field Pattern') plt.xlabel(r'$\phi$') plt.ylabel('AF') plt.show() return m_index, zm
def FS_Chebyshev(N, R, x_min, x_max, x_num, plot_far=False, dB_limit=-40): """Function to evaluate Fourier series coefficients of Chebyshev far-field pattern""" c = np.cosh(np.arccosh(R) / (N)) c = str(c) if (N % 2 == 0): m_start = int(-N / 2) m_stop = int(N / 2) N = str(N) fun_str_re = 'special.eval_chebyt(' + N + ',' + c + '*np.cos(x/2))' m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) else: m_start = -N # make this (2*P+1) ... and take fourier for only half period m_stop = N N = str(N) fun_str_re = 'special.eval_chebyt(' + N + ',' + c + '*np.cos(x))' m_index, zm = FS(fun_str_re, m_start=m_start, m_stop=m_stop, err_lim=1e-5) if (plot_far): x, AF = IFS(zm, 2 * np.pi, m_start, m_stop, x_min, x_max, x_num) AF = 20 * np.log10(abs(AF)) AF = pl.cutoff(AF, dB_limit) plt.plot(x * (180 / np.pi), AF) plt.axis('tight') plt.grid(True) plt.title('Far-field Pattern') plt.xlabel(r'$\phi$') plt.ylabel('AF') plt.show() return m_index, zm