def general_gaussian(M, p, sig, sym=True):
 if _len_guards(M):
  return np.ones(M)
 (M, needs_trunc) = _extend(M, sym)
 n = (np.arange(0, M) - ((M - 1.0) / 2.0))
 w = np.exp(((-0.5) * (np.abs((n / sig)) ** (2 * p))))
 return _truncate(w, needs_trunc)

def general_gaussian ( M , p , sig , sym = True ) : if _len_guards ( M ) : return np . ones ( M ) ( M , needs_trunc ) = _extend ( M , sym ) n = ( np . arange ( 0 , M ) - ( ( M - 1.0 ) / 2.0 ) ) w = np . exp ( ( ( - 0.5 ) * ( np . abs ( ( n / sig ) ) ** ( 2 * p ) ) ) ) return _truncate ( w , needs_trunc )
return a window with a generalized gaussian shape .