bionet.utils.trig_poly.gen_trig_poly

bionet.utils.trig_poly.gen_trig_poly(T, dt, am, method='fft', scale_down=False)

Construct a trigonometric polynomial with specified Dirichlet coefficients.

Parameters:

T : float

Period (i.e., duration) of the trigonometric polynomial.

dt : float

Time resolution.

am : int or numpy.ndarray

Trigonometric polynomial order or array of Dirichlet coefficients. If the latter, the length of the array must be odd.

method : {‘fft’, ‘inner’}

Method to use when computing coefficients. The FFT method is generally faster than using inner products.

scale_down : bool

If true, linearly scale down all coefficients such that the magnitude of the high-frequency coefficients are reduced the most.

Returns:

u : numpy.ndarray

Generated signal.