def gen_cosine_amp(amp=100, period=1000, x0=0, xn=50000, step=1, k=0.0001):
 cos = np.zeros((((xn - x0) * step), 1, 1))
 for i in range(len(cos)):
  idx = (x0 + (i * step))
  cos[(i, 0, 0)] = (amp * np.cos((((2 * np.pi) * idx) / period)))
  cos[(i, 0, 0)] = (cos[(i, 0, 0)] * np.exp(((- k) * idx)))
 return cos

def gen_cosine_amp ( amp = 100 , period = 1000 , x0 = 0 , xn = 50000 , step = 1 , k = 0.0001 ) : cos = np . zeros ( ( ( ( xn - x0 ) * step ) , 1 , 1 ) ) for i in range ( len ( cos ) ) : idx = ( x0 + ( i * step ) ) cos [ ( i , 0 , 0 ) ] = ( amp * np . cos ( ( ( ( 2 * np . pi ) * idx ) / period ) ) ) cos [ ( i , 0 , 0 ) ] = ( cos [ ( i , 0 , 0 ) ] * np . exp ( ( ( - k ) * idx ) ) ) return cos
generates an absolute cosine time series with the amplitude exponentially decreasing arguments: amp: amplitude of the cosine function period: period of the cosine function x0: initial x of the time series xn: final x of the time series step: step of the time series discretization k: exponential rate .