def genBhLobe(x):
 N = 512
 f = (((x * np.pi) * 2) / N)
 df = ((2 * np.pi) / N)
 y = np.zeros(x.size)
 consts = [0.35875, 0.48829, 0.14128, 0.01168]
 for m in range(0, 4):
  y += ((consts[m] / 2) * (sinc((f - (df * m)), N) + sinc((f + (df * m)), N)))
 y = ((y / N) / consts[0])
 return y

def genBhLobe ( x ) : N = 512 f = ( ( ( x * np . pi ) * 2 ) / N ) df = ( ( 2 * np . pi ) / N ) y = np . zeros ( x . size ) consts = [ 0.35875 , 0.48829 , 0.14128 , 0.01168 ] for m in range ( 0 , 4 ) : y += ( ( consts [ m ] / 2 ) * ( sinc ( ( f - ( df * m ) ) , N ) + sinc ( ( f + ( df * m ) ) , N ) ) ) y = ( ( y / N ) / consts [ 0 ] ) return y
generate the main lobe of a blackman-harris window x: bin positions to compute returns y: main lobe os spectrum of a blackman-harris window .