def sinc(x, N):
 y = (np.sin(((N * x) / 2)) / np.sin((x / 2)))
 y[np.isnan(y)] = N
 return y

def sinc ( x , N ) : y = ( np . sin ( ( ( N * x ) / 2 ) ) / np . sin ( ( x / 2 ) ) ) y [ np . isnan ( y ) ] = N return y
generate the main lobe of a sinc function x: array of indexes to compute; n: size of fft to simulate returns y: samples of the main lobe of a sinc function .