def _cos_win(M, a, sym=True):
 if _len_guards(M):
  return np.ones(M)
 (M, needs_trunc) = _extend(M, sym)
 fac = np.linspace((- np.pi), np.pi, M)
 w = np.zeros(M)
 for k in range(len(a)):
  w += (a[k] * np.cos((k * fac)))
 return _truncate(w, needs_trunc)

def _cos_win ( M , a , sym = True ) : if _len_guards ( M ) : return np . ones ( M ) ( M , needs_trunc ) = _extend ( M , sym ) fac = np . linspace ( ( - np . pi ) , np . pi , M ) w = np . zeros ( M ) for k in range ( len ( a ) ) : w += ( a [ k ] * np . cos ( ( k * fac ) ) ) return _truncate ( w , needs_trunc )
generic weighted sum of cosine terms window parameters m : int number of points in the output window a : array_like sequence of weighting coefficients .