spkit
.sinc_dirichlet¶
- spkit.sinc_dirichlet(x, N)¶
Generate the main lobe of a sinc function
Generate the main lobe of a sinc function (Dirichlet kernel)
- Parameters:
- x: array of indexes to compute
- N: size of FFT to simulate
- Returns:
- y: samples of the main lobe of a sinc function
See also
Notes
#TODO
References
Examples
>>> #sp.sinc_dirichlet >>> import numpy as np >>> import matplotlib.pyplot as plt >>> import spkit as sp >>> t = 2*np.arange(-50, 50)/201 >>> y = sp.sinc_dirichlet(t,N=512) >>> plt.plot(t,y,label='N=512') >>> y = sp.sinc_dirichlet(t,N=128) >>> plt.plot(t,y,label='N=128') >>> y = sp.sinc_dirichlet(t,N=64) >>> plt.plot(t,y,label='N=64') >>> plt.xlim([t[0],t[-1]]) >>> plt.grid() >>> plt.legend() >>> plt.show()
code:
#sp.sinc_dirichlet import numpy as np import matplotlib.pyplot as plt import spkit as sp t = 2*np.arange(-50, 50)/201 y = sp.sinc_dirichlet(t,N=512) plt.plot(t,y,label='N=512') y = sp.sinc_dirichlet(t,N=128) plt.plot(t,y,label='N=128') y = sp.sinc_dirichlet(t,N=64) plt.plot(t,y,label='N=64') plt.xlim([t[0],t[-1]]) plt.grid() plt.legend() plt.show()