# Last edited on 2021-07-31 13:13:46 by jstolfi from math import cos, pi def hann_mesa(x,mrg): # Unit window with support {[-1 _ +1]} that decays to 0 # wihing {mrg} of the edge.. xa = abs(x) if xa >= 1: w = 0.0 elif xa <= 1-mrg: w = 1.0 else: w = 0.5*(1 + cos(pi*(1 - (1 - xa)/mrg))) return w # ----------------------------------------------------------------------